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 '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.EnumLiteMapACLFORWARDINGACTION_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.EnumLiteMapACLLOGACTION_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.EnumLiteMapuint32 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.Builderuint32 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.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.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.Parseruint32 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.Builderuint32 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.Parserstring 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.Listrepeated .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 extends acl.Acl.AclEntryOrBuilder>
+ 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.ArrayListstring 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.Listrepeated .acl.AclEntry entries = 5;
+ */
+ @java.lang.Override
+ public java.util.Listrepeated .acl.AclEntry entries = 5;
+ */
+ @java.lang.Override
+ public java.util.List extends acl.Acl.AclEntryOrBuilder>
+ 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.Builderstring 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.Listrepeated .acl.AclEntry entries = 5;
+ */
+ public java.util.Listrepeated .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 extends acl.Acl.AclEntry> 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 extends acl.Acl.AclEntryOrBuilder>
+ 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.ListSERVICESTATUS_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* ----- 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.Builderimplements - // @@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.Builderimplements - // @@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 extends context.ContextOuterClass.TopologyIdOrBuilder> - 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 extends context.ContextOuterClass.ServiceIdOrBuilder> - 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.ListtopologyIds_; - /** - * repeated .context.TopologyId topology_ids = 2;
- */ - @java.lang.Override - public java.util.ListgetTopologyIdsList() { - return topologyIds_; - } - /** - * repeated .context.TopologyId topology_ids = 2;
- */ - @java.lang.Override - public java.util.List extends context.ContextOuterClass.TopologyIdOrBuilder> - 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.ListserviceIds_; - /** - * repeated .context.ServiceId service_ids = 3;
- */ - @java.lang.Override - public java.util.ListgetServiceIdsList() { - return serviceIds_; - } - /** - * repeated .context.ServiceId service_ids = 3;
- */ - @java.lang.Override - public java.util.List extends context.ContextOuterClass.ServiceIdOrBuilder> - 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.Builderimplements - // @@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.ListtopologyIds_ = - 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.ListgetTopologyIdsList() { - 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.Parserparser() { + 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 extends context.ContextOuterClass.TopologyIdOrBuilder> + 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 extends context.ContextOuterClass.ServiceIdOrBuilder> + 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 extends context.ContextOuterClass.TopologyId> 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 extends context.ContextOuterClass.TopologyIdOrBuilder> - 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.ListtopologyIds_; + /** + * repeated .context.TopologyId topology_ids = 2;
+ */ + @java.lang.Override + public java.util.ListgetTopologyIdsList() { + return topologyIds_; + } + /** + * repeated .context.TopologyId topology_ids = 2;
+ */ + @java.lang.Override + public java.util.List extends context.ContextOuterClass.TopologyIdOrBuilder> + 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.ListserviceIds_; + /** + * repeated .context.ServiceId service_ids = 3;
+ */ + @java.lang.Override + public java.util.ListgetServiceIdsList() { + return serviceIds_; + } + /** + * repeated .context.ServiceId service_ids = 3;
+ */ + @java.lang.Override + public java.util.List extends context.ContextOuterClass.ServiceIdOrBuilder> + 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.Builderimplements + // @@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.ListtopologyIds_ = + 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.ListgetTopologyIdsList() { + 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 extends context.ContextOuterClass.TopologyId> 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 extends context.ContextOuterClass.TopologyIdOrBuilder> + 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.ListgetServiceIdsList() { + 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 extends context.ContextOuterClass.ServiceId> 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 extends context.ContextOuterClass.ServiceIdOrBuilder> + 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 extends context.ContextOuterClass.ContextIdOrBuilder> + 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.ListgetContextIdsList() { + return contextIds_; + } + /** + * repeated .context.ContextId context_ids = 1;
+ */ + @java.lang.Override + public java.util.List extends context.ContextOuterClass.ContextIdOrBuilder> + 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.Builderimplements + // @@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.ListgetContextIdsList() { + 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 extends context.ContextOuterClass.ContextId> 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 extends context.ContextOuterClass.ContextIdOrBuilder> + 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 extends context.ContextOuterClass.ContextOrBuilder> + 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.ListgetContextsList() { + return contexts_; + } + /** + * repeated .context.Context contexts = 1;
+ */ + @java.lang.Override + public java.util.List extends context.ContextOuterClass.ContextOrBuilder> + 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.Builderimplements + // @@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.ListgetContextsList() { + 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 extends context.ContextOuterClass.Context> 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 extends context.ContextOuterClass.ContextOrBuilder> + 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.Builderimplements + // @@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_; + /** + *