diff --git a/.gitignore b/.gitignore
index a9144d6699af12319a67e8bad5cec982f3ae6a8c..20b98c30c5b3edb0983578b0a5f74fb1c1f3025e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -171,5 +171,8 @@ local_k8s_deployment.sh
# asdf configuration
.tool-versions
+# libyang build files
+libyang/
+
# Other logs
**/logs/*.log.*
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 8fe5e6c5db2815ff2c5fcbf28b6fedeec3e060c0..e2d653e0360b694891adc966d6d0b1124ed72ac4 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,4 +1,4 @@
-# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
+# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -17,29 +17,34 @@ stages:
#- dependencies
- build
- unit_test
- #- deploy
- #- end2end_test
+ - end2end_test
-# include the individual .gitlab-ci.yml of each micro-service
+# include the individual .gitlab-ci.yml of each micro-service and tests
include:
#- local: '/manifests/.gitlab-ci.yml'
- local: '/src/monitoring/.gitlab-ci.yml'
- - local: '/src/compute/.gitlab-ci.yml'
+ - local: '/src/nbi/.gitlab-ci.yml'
- local: '/src/context/.gitlab-ci.yml'
- local: '/src/device/.gitlab-ci.yml'
- local: '/src/service/.gitlab-ci.yml'
- local: '/src/dbscanserving/.gitlab-ci.yml'
- local: '/src/opticalattackmitigator/.gitlab-ci.yml'
- local: '/src/opticalattackdetector/.gitlab-ci.yml'
- # - local: '/src/opticalattackmanager/.gitlab-ci.yml'
- - local: '/src/automation/.gitlab-ci.yml'
+ - local: '/src/opticalattackmanager/.gitlab-ci.yml'
+ - local: '/src/opticalcontroller/.gitlab-ci.yml'
+ - local: '/src/ztp/.gitlab-ci.yml'
- local: '/src/policy/.gitlab-ci.yml'
+ - local: '/src/forecaster/.gitlab-ci.yml'
#- local: '/src/webui/.gitlab-ci.yml'
#- local: '/src/l3_distributedattackdetector/.gitlab-ci.yml'
#- local: '/src/l3_centralizedattackdetector/.gitlab-ci.yml'
#- local: '/src/l3_attackmitigator/.gitlab-ci.yml'
- #- local: '/src/slice/.gitlab-ci.yml'
+ - local: '/src/slice/.gitlab-ci.yml'
#- local: '/src/interdomain/.gitlab-ci.yml'
- local: '/src/pathcomp/.gitlab-ci.yml'
#- local: '/src/dlt/.gitlab-ci.yml'
- local: '/src/load_generator/.gitlab-ci.yml'
+ - local: '/src/bgpls_speaker/.gitlab-ci.yml'
+
+ # This should be last one: end-to-end integration tests
+ - local: '/src/tests/.gitlab-ci.yml'
diff --git a/.gitlab/issue_templates/new-feature-with-design.md b/.gitlab/issue_templates/new-feature-with-design.md
index ec08771641bcf5193ea4db45581bc85eb1a0a5b9..b6ae943b64ebed5c64509737975fc5f302181806 100644
--- a/.gitlab/issue_templates/new-feature-with-design.md
+++ b/.gitlab/issue_templates/new-feature-with-design.md
@@ -40,7 +40,7 @@ components deployed.
## Impacted Components
-List of impacted components: Context, Device, Service, PathComp, Slice, Monitoring, Automation, Policy, Compute, etc.
+List of impacted components: Context, Device, Service, PathComp, Slice, Monitoring, ZTP, Policy, NBI, etc.
Just an enumeration, elaboration of impacts is done below.
## Component1 Impact
diff --git a/README.md b/README.md
index 5bfb6d70d947f631e8694b3dcf6c872cf1248ea4..8825795b864938af9fd2eb67e181c719ee9fbd26 100644
--- a/README.md
+++ b/README.md
@@ -1,14 +1,25 @@
# ETSI TeraFlowSDN Controller
-[ETSI OpenSource Group for TeraFlowSDN](https://tfs.etsi.org/)
+The [ETSI Software Development Group TeraFlowSDN (SDG TFS)](https://tfs.etsi.org/) is developing an open source cloud native SDN controller enabling smart connectivity services for future networks beyond 5G.
-Former, [Teraflow H2020 project](https://teraflow-h2020.eu/) - Secured autonomic traffic management for a Tera of SDN Flows
+The project originated from "[Teraflow H2020 project](https://teraflow-h2020.eu/) - Secured autonomic traffic management for a Tera of SDN Flows", a project funded by the European Union’s Horizon 2020 Research and Innovation programme that finished on 30th June 2023.
-Branch "master" : [![pipeline status](https://labs.etsi.org/rep/tfs/controller/badges/master/pipeline.svg)](https://labs.etsi.org/rep/tfs/controller/-/commits/master) [![coverage report](https://labs.etsi.org/rep/tfs/controller/badges/master/coverage.svg)](https://labs.etsi.org/rep/tfs/controller/-/commits/master)
-Branch "develop" : [![pipeline status](https://labs.etsi.org/rep/tfs/controller/badges/develop/pipeline.svg)](https://labs.etsi.org/rep/tfs/controller/-/commits/develop) [![coverage report](https://labs.etsi.org/rep/tfs/controller/badges/develop/coverage.svg)](https://labs.etsi.org/rep/tfs/controller/-/commits/develop)
+## Available branches and releases
-# Installation Instructions and Functional Tests
-The [TeraFlowSDN Wiki](https://labs.etsi.org/rep/tfs/controller/-/wikis/home) pages include details on using the ETSI TeraFlowSDN release 2.0.
+[![Latest Release](https://labs.etsi.org/rep/tfs/controller/-/badges/release.svg)](https://labs.etsi.org/rep/tfs/controller/-/releases)
-The documentation, installation instructions, and description of the functional tests defined to enable experimentation with the ETSI TeraFlowSDN Controller can be found in the Wiki pages
+- The branch `master` ([![pipeline status](https://labs.etsi.org/rep/tfs/controller/badges/master/pipeline.svg)](https://labs.etsi.org/rep/tfs/controller/-/commits/master) [![coverage report](https://labs.etsi.org/rep/tfs/controller/badges/master/coverage.svg)](https://labs.etsi.org/rep/tfs/controller/-/commits/master)), points always to the latest stable version of the TeraFlowSDN controller.
+
+- The branches `release/X.Y.Z`, point to the code for the different release versions indicated in the branch name.
+ - Code in these branches can be considered stable, and no new features are planned.
+ - In case of bugs, point releases increasing revision number (Z) might be created.
+
+- The `develop` ([![pipeline status](https://labs.etsi.org/rep/tfs/controller/badges/develop/pipeline.svg)](https://labs.etsi.org/rep/tfs/controller/-/commits/develop) [![coverage report](https://labs.etsi.org/rep/tfs/controller/badges/develop/coverage.svg)](https://labs.etsi.org/rep/tfs/controller/-/commits/develop)) branch is the main development branch and contains the latest contributions.
+ - **Use it with care! It might not be stable.**
+ - The latest developments and contributions are added to this branch for testing and validation before reaching a release.
+
+
+## Documentation
+The [TeraFlowSDN Wiki](https://labs.etsi.org/rep/tfs/controller/-/wikis/home) pages include the main documentation for the ETSI TeraFlowSDN Controller.
+The documentation includes project documentation, installation instructions, functional tests, supported NBIs and SBIs, etc.
diff --git a/clean_testing_environment.sh b/clean_testing_environment.sh
index b9c502ade6f34e3a19ebeafa67c222b10ea3f99d..f037a2a39309abb192c36943c014c4a3b893dd98 100755
--- a/clean_testing_environment.sh
+++ b/clean_testing_environment.sh
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
-# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
+# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/common_requirements.in b/common_requirements.in
index 37b70c993e913602f9d5e509d0c887802c5d0b1e..3aa30e174f43d6f8758f49b3104a20cc8580a7ff 100644
--- a/common_requirements.in
+++ b/common_requirements.in
@@ -1,4 +1,4 @@
-# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
+# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/coverage/.coveragerc.template b/coverage/.coveragerc.template
index 4421399ca30027e3032001dae64e6fa0b7fa41cb..3d8065acabefc65daad28fd4bd2e166b84d11d8b 100644
--- a/coverage/.coveragerc.template
+++ b/coverage/.coveragerc.template
@@ -1,4 +1,4 @@
-# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
+# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/data/perf/old/MW/generate.sh b/data/perf/old/MW/generate.sh
index a7fd03b2ffc8f546e7778e77bc3197661bcb0336..ccef4e113b3216bc4e4dddcd4be793c2bba32501 100755
--- a/data/perf/old/MW/generate.sh
+++ b/data/perf/old/MW/generate.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
+# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/data/perf/old/MW/generate_plot.py b/data/perf/old/MW/generate_plot.py
index 3d2d3a77c130ab4a3aac6bb5e9fba3eab59de67a..22befef305bf33b4aa150bf60fbd39fac3c61402 100644
--- a/data/perf/old/MW/generate_plot.py
+++ b/data/perf/old/MW/generate_plot.py
@@ -1,4 +1,4 @@
-# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
+# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/data/perf/old/OpenConfig/generate.sh b/data/perf/old/OpenConfig/generate.sh
index 6a6123bab2c2a1d0f475a0503a0af8d1612e7cac..5147d49626143919814a6184e02cbabdaf32b5cf 100755
--- a/data/perf/old/OpenConfig/generate.sh
+++ b/data/perf/old/OpenConfig/generate.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
+# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/data/perf/old/OpenConfig/generate_plot.py b/data/perf/old/OpenConfig/generate_plot.py
index 63166d7ac67802d1dcd37fafa6299cb6af898c8e..8d50ab81fd41d5dc8963aa3a9dc317bd3487fd54 100644
--- a/data/perf/old/OpenConfig/generate_plot.py
+++ b/data/perf/old/OpenConfig/generate_plot.py
@@ -1,4 +1,4 @@
-# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
+# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/data/perf/old/TE/te-cdf.py b/data/perf/old/TE/te-cdf.py
index fdcc1f679e7f5c3c1523ee1edaaa260727d72884..a3e7cc53006f5b1f513ee2b3b23938d33cb93fcd 100644
--- a/data/perf/old/TE/te-cdf.py
+++ b/data/perf/old/TE/te-cdf.py
@@ -1,4 +1,4 @@
-# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
+# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/data/perf/old/XR/generate.sh b/data/perf/old/XR/generate.sh
index a2663295956aa20e4ed4f10a32a4f56f0df6fe29..d5b70476331f3a3e6ffcaa77cd3f2ef68008bc67 100755
--- a/data/perf/old/XR/generate.sh
+++ b/data/perf/old/XR/generate.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
+# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/data/perf/old/XR/generate_plot.py b/data/perf/old/XR/generate_plot.py
index d9cf628a1fd1608b5d312ebb443714a980040790..f27c37e53a287d90c209620282a25d5f92152f1e 100644
--- a/data/perf/old/XR/generate_plot.py
+++ b/data/perf/old/XR/generate_plot.py
@@ -1,4 +1,4 @@
-# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
+# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/data/perf/old/emulated/generate.sh b/data/perf/old/emulated/generate.sh
index c6140652514a8f35e01d7e788668d8c94e9aa064..7b978c1fd4f2962693926f9cf443a6d03ee17161 100755
--- a/data/perf/old/emulated/generate.sh
+++ b/data/perf/old/emulated/generate.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
+# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/data/perf/old/emulated/generate_plot.py b/data/perf/old/emulated/generate_plot.py
index 0f74bc401a518b706e9d17ab18a0e501edb7edcd..d049386c3cf010ae53e8f2a91a8354bdd54f910b 100644
--- a/data/perf/old/emulated/generate_plot.py
+++ b/data/perf/old/emulated/generate_plot.py
@@ -1,4 +1,4 @@
-# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
+# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/deploy/all.sh b/deploy/all.sh
index 9584dd32d121b7f63e7c7f177bf7bee8c287b4c9..c169bc92c0d9a6dea87de919ad20b4cf3afc1199 100755
--- a/deploy/all.sh
+++ b/deploy/all.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
+# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -27,7 +27,7 @@ export TFS_REGISTRY_IMAGES=${TFS_REGISTRY_IMAGES:-"http://localhost:32000/tfs/"}
# If not already set, set the list of components, separated by spaces, you want to build images for, and deploy.
# By default, only basic components are deployed
-export TFS_COMPONENTS=${TFS_COMPONENTS:-"context device automation monitoring pathcomp service slice compute webui load_generator"}
+export TFS_COMPONENTS=${TFS_COMPONENTS:-"context device ztp monitoring pathcomp service slice nbi webui load_generator"}
# If not already set, set the tag you want to use for your images.
export TFS_IMAGE_TAG=${TFS_IMAGE_TAG:-"dev"}
diff --git a/deploy/component.sh b/deploy/component.sh
index 922aa5e0ec77a2c6acd73db1195a9ec3d2b160fb..89d2383d7c62393753de27abf9d0a15f67066c76 100755
--- a/deploy/component.sh
+++ b/deploy/component.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
+# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -40,6 +40,21 @@ export TFS_GRAFANA_PASSWORD=${TFS_GRAFANA_PASSWORD:-"admin123+"}
# Automated steps start here
########################################################################################################################
+DOCKER_BUILD="docker build"
+DOCKER_MAJOR_VERSION=$(docker --version | grep -o -E "Docker version [0-9]+\." | grep -o -E "[0-9]+" | cut -c 1-3)
+if [[ $DOCKER_MAJOR_VERSION -ge 23 ]]; then
+ # If Docker version >= 23, build command was migrated to docker-buildx
+ # In Ubuntu, in practice, means to install package docker-buildx together with docker.io
+ # Check if docker-buildx plugin is installed
+ docker buildx version 1>/dev/null 2>/dev/null
+ if [[ $? -ne 0 ]]; then
+ echo "Docker buildx command is not installed. Check: https://docs.docker.com/build/architecture/#install-buildx"
+ echo "If you installed docker through APT package docker.io, consider installing also package docker-buildx"
+ exit 1;
+ fi
+ DOCKER_BUILD="docker buildx build"
+fi
+
# Constants
GITLAB_REPO_URL="labs.etsi.org:5050/tfs/controller"
TMP_FOLDER="./tmp"
@@ -59,18 +74,18 @@ for COMPONENT in $TFS_COMPONENTS; do
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"
+ if [ "$COMPONENT" == "ztp" ] || [ "$COMPONENT" == "policy" ]; then
+ $DOCKER_BUILD -t "$IMAGE_NAME" -f ./src/"$COMPONENT"/Dockerfile ./src/"$COMPONENT"/ > "$BUILD_LOG"
elif [ "$COMPONENT" == "pathcomp" ]; then
BUILD_LOG="$TMP_LOGS_FOLDER/build_${COMPONENT}-frontend.log"
- docker build -t "$COMPONENT-frontend:$TFS_IMAGE_TAG" -f ./src/"$COMPONENT"/frontend/Dockerfile . >> "$BUILD_LOG"
+ $DOCKER_BUILD -t "$COMPONENT-frontend:$TFS_IMAGE_TAG" -f ./src/"$COMPONENT"/frontend/Dockerfile . >> "$BUILD_LOG"
BUILD_LOG="$TMP_LOGS_FOLDER/build_${COMPONENT}-backend.log"
- docker build -t "$COMPONENT-backend:$TFS_IMAGE_TAG" -f ./src/"$COMPONENT"/backend/Dockerfile . >> "$BUILD_LOG"
+ $DOCKER_BUILD -t "$COMPONENT-backend:$TFS_IMAGE_TAG" -f ./src/"$COMPONENT"/backend/Dockerfile . >> "$BUILD_LOG"
# next command is redundant, but helpful to keep cache updated between rebuilds
- docker build -t "$COMPONENT-backend:$TFS_IMAGE_TAG-builder" --target builder -f ./src/"$COMPONENT"/backend/Dockerfile . >> "$BUILD_LOG"
+ $DOCKER_BUILD -t "$COMPONENT-backend:$TFS_IMAGE_TAG-builder" --target builder -f ./src/"$COMPONENT"/backend/Dockerfile . >> "$BUILD_LOG"
else
- docker build -t "$IMAGE_NAME" -f ./src/"$COMPONENT"/Dockerfile . > "$BUILD_LOG"
+ $DOCKER_BUILD -t "$IMAGE_NAME" -f ./src/"$COMPONENT"/Dockerfile . > "$BUILD_LOG"
fi
if [ -n "$TFS_REGISTRY_IMAGES" ]; then
diff --git a/deploy/crdb.sh b/deploy/crdb.sh
index 5d87adf60bbb3303e9abe9cc17c4a68cbe295370..c979ad4f2c18861c6a93b6b04e5d8e3e71aae41e 100755
--- a/deploy/crdb.sh
+++ b/deploy/crdb.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
+# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -158,9 +158,19 @@ function crdb_undeploy_single() {
function crdb_drop_database_single() {
echo "Drop database if exists"
- CRDB_PORT_SQL=$(kubectl --namespace ${CRDB_NAMESPACE} get service cockroachdb-public -o 'jsonpath={.spec.ports[?(@.name=="sql")].port}')
- CRDB_CLIENT_URL="postgresql://${CRDB_USERNAME}:${CRDB_PASSWORD}@cockroachdb-0:${CRDB_PORT_SQL}/defaultdb?sslmode=require"
- kubectl exec -it --namespace ${CRDB_NAMESPACE} cockroachdb-0 -- \
+
+ if [[ -z "${GITLAB_CI}" ]]; then
+ #kubectl --namespace ${CRDB_NAMESPACE} get service cockroachdb-public -o yaml
+ CRDB_HOST=$(kubectl --namespace ${CRDB_NAMESPACE} get service cockroachdb-public -o 'jsonpath={.spec.clusterIP}')
+ CRDB_PORT=$(kubectl --namespace ${CRDB_NAMESPACE} get service cockroachdb-public -o 'jsonpath={.spec.ports[?(@.name=="sql")].port}')
+ else
+ CRDB_HOST="127.0.0.1"
+ CRDB_PORT=${CRDB_EXT_PORT_SQL}
+ fi
+
+ CRDB_CLIENT_URL="postgresql://${CRDB_USERNAME}:${CRDB_PASSWORD}@${CRDB_HOST}:${CRDB_PORT}/defaultdb?sslmode=require"
+ echo "CRDB_CLIENT_URL=${CRDB_CLIENT_URL}"
+ kubectl exec -i --namespace ${CRDB_NAMESPACE} cockroachdb-0 -- \
./cockroach sql --certs-dir=/cockroach/cockroach-certs --url=${CRDB_CLIENT_URL} \
--execute "DROP DATABASE IF EXISTS ${CRDB_DATABASE};"
echo
@@ -343,7 +353,7 @@ function crdb_undeploy_cluster() {
function crdb_drop_database_cluster() {
echo "Drop database if exists"
- kubectl exec -it --namespace ${CRDB_NAMESPACE} cockroachdb-client-secure -- \
+ kubectl exec -i --namespace ${CRDB_NAMESPACE} cockroachdb-client-secure -- \
./cockroach sql --certs-dir=/cockroach/cockroach-certs --host=cockroachdb-public --execute \
"DROP DATABASE IF EXISTS ${CRDB_DATABASE};"
echo
diff --git a/deploy/expose_dashboard.sh b/deploy/expose_dashboard.sh
index 65f715cabe6d688eb01dc5ae6afe7a21261aca94..f2391ab5d5b028bed11f23a2f95c06054d1f0cbc 100755
--- a/deploy/expose_dashboard.sh
+++ b/deploy/expose_dashboard.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
+# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/deploy/mock_blockchain.sh b/deploy/mock_blockchain.sh
index ef7811c87eabdcb7cf95db2e4cf1a6eee52ef6ca..fafa435b10f7c027e088435997ec01ebf1858d0f 100755
--- a/deploy/mock_blockchain.sh
+++ b/deploy/mock_blockchain.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
+# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -38,28 +38,44 @@ GITLAB_REPO_URL="labs.etsi.org:5050/tfs/controller"
TMP_FOLDER="./tmp"
# Create a tmp folder for files modified during the deployment
-TMP_MANIFESTS_FOLDER="$TMP_FOLDER/manifests"
+TMP_MANIFESTS_FOLDER="${TMP_FOLDER}/${K8S_NAMESPACE}/manifests"
mkdir -p $TMP_MANIFESTS_FOLDER
-TMP_LOGS_FOLDER="$TMP_FOLDER/logs"
+TMP_LOGS_FOLDER="${TMP_FOLDER}/${K8S_NAMESPACE}/logs"
mkdir -p $TMP_LOGS_FOLDER
echo "Deleting and Creating a new namespace..."
-kubectl delete namespace $K8S_NAMESPACE
+kubectl delete namespace $K8S_NAMESPACE --ignore-not-found
kubectl create namespace $K8S_NAMESPACE
printf "\n"
echo "Deploying components and collecting environment variables..."
ENV_VARS_SCRIPT=tfs_bchain_runtime_env_vars.sh
-echo "# Environment variables for TeraFlow Mock-Blockchain deployment" > $ENV_VARS_SCRIPT
+echo "# Environment variables for TeraFlowSDN Mock-Blockchain deployment" > $ENV_VARS_SCRIPT
PYTHONPATH=$(pwd)/src
+echo "export PYTHONPATH=${PYTHONPATH}" >> $ENV_VARS_SCRIPT
echo "Processing '$COMPONENT' component..."
IMAGE_NAME="$COMPONENT:$IMAGE_TAG"
IMAGE_URL=$(echo "$REGISTRY_IMAGE/$IMAGE_NAME" | sed 's,//,/,g' | sed 's,http:/,,g')
+DOCKER_BUILD="docker build"
+DOCKER_MAJOR_VERSION=$(docker --version | grep -o -E "Docker version [0-9]+\." | grep -o -E "[0-9]+" | cut -c 1-3)
+if [[ $DOCKER_MAJOR_VERSION -ge 23 ]]; then
+ # If Docker version >= 23, build command was migrated to docker-buildx
+ # In Ubuntu, in practice, means to install package docker-buildx together with docker.io
+ # Check if docker-buildx plugin is installed
+ docker buildx version 1>/dev/null 2>/dev/null
+ if [[ $? -ne 0 ]]; then
+ echo "Docker buildx command is not installed. Check: https://docs.docker.com/build/architecture/#install-buildx"
+ echo "If you installed docker through APT package docker.io, consider installing also package docker-buildx"
+ exit 1;
+ fi
+ DOCKER_BUILD="docker buildx build"
+fi
+
echo " Building Docker image..."
BUILD_LOG="$TMP_LOGS_FOLDER/build_${COMPONENT}.log"
-docker build -t "$IMAGE_NAME" -f ./src/dlt/mock_blockchain/Dockerfile . > "$BUILD_LOG"
+$DOCKER_BUILD -t "$IMAGE_NAME" -f ./src/dlt/mock_blockchain/Dockerfile . > "$BUILD_LOG"
if [ -n "$REGISTRY_IMAGE" ]; then
echo " Pushing Docker image to '$REGISTRY_IMAGE'..."
@@ -77,12 +93,12 @@ cp ./manifests/"${COMPONENT}".yaml "$MANIFEST"
if [ -n "$REGISTRY_IMAGE" ]; then
# Registry is set
- VERSION=$(grep -i "${GITLAB_REPO_URL}/${COMPONENT}:" "$MANIFEST" | cut -d ":" -f3)
+ VERSION=$(grep -i "${GITLAB_REPO_URL}/${COMPONENT}:" "$MANIFEST" | cut -d ":" -f4)
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
- VERSION=$(grep -i "${GITLAB_REPO_URL}/${COMPONENT}:" "$MANIFEST" | cut -d ":" -f3)
+ VERSION=$(grep -i "${GITLAB_REPO_URL}/${COMPONENT}:" "$MANIFEST" | cut -d ":" -f4)
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
@@ -91,8 +107,8 @@ echo " Deploying '$COMPONENT' component to Kubernetes..."
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} >> "$DEPLOY_LOG"
-kubectl --namespace $K8S_NAMESPACE scale deployment --replicas=1 ${COMPONENT_OBJNAME} >> "$DEPLOY_LOG"
+#kubectl --namespace $K8S_NAMESPACE scale deployment --replicas=0 ${COMPONENT_OBJNAME} >> "$DEPLOY_LOG"
+#kubectl --namespace $K8S_NAMESPACE scale deployment --replicas=1 ${COMPONENT_OBJNAME} >> "$DEPLOY_LOG"
echo " Collecting env-vars for '$COMPONENT' component..."
SERVICE_DATA=$(kubectl get service ${COMPONENT_OBJNAME} --namespace $K8S_NAMESPACE -o json)
diff --git a/deploy/nats.sh b/deploy/nats.sh
index b730cec4af66920e5a7d8a2235e63beff70e8694..366270a6915a1eef969846446ecc9152c3fa9531 100755
--- a/deploy/nats.sh
+++ b/deploy/nats.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
+# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -47,6 +47,10 @@ function nats_deploy_single() {
helm3 repo add nats https://nats-io.github.io/k8s/helm/charts/
echo
+ echo "Upgrade NATS Helm Chart"
+ helm3 repo update nats
+ echo
+
echo "Install NATS (single-node)"
echo ">>> Checking if NATS is deployed..."
if kubectl get --namespace ${NATS_NAMESPACE} statefulset/${NATS_NAMESPACE} &> /dev/null; then
@@ -81,6 +85,10 @@ function nats_deploy_single() {
echo "NATS Port Mapping"
echo ">>> Expose NATS Client port (4222->${NATS_EXT_PORT_CLIENT})"
NATS_PORT_CLIENT=$(kubectl --namespace ${NATS_NAMESPACE} get service ${NATS_NAMESPACE} -o 'jsonpath={.spec.ports[?(@.name=="client")].port}')
+ if [ -z "$NATS_PORT_CLIENT" ]; then
+ # NATS charts updated and port name changed from "client" to "nats"; fix to support new name and enable backward compatibility
+ NATS_PORT_CLIENT=$(kubectl --namespace ${NATS_NAMESPACE} get service ${NATS_NAMESPACE} -o 'jsonpath={.spec.ports[?(@.name=="nats")].port}')
+ fi
PATCH='{"data": {"'${NATS_EXT_PORT_CLIENT}'": "'${NATS_NAMESPACE}'/'${NATS_NAMESPACE}':'${NATS_PORT_CLIENT}'"}}'
kubectl patch configmap nginx-ingress-tcp-microk8s-conf --namespace ingress --patch "${PATCH}"
diff --git a/deploy/qdb.sh b/deploy/qdb.sh
index e930b5a6cfdba8897ec138e97e3115da8917554f..acbcfd4f96ccbd2b09d5d82f66a1bf801a710780 100755
--- a/deploy/qdb.sh
+++ b/deploy/qdb.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
+# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -160,10 +160,17 @@ function qdb_undeploy() {
}
function qdb_drop_tables() {
- QDB_HOST=$(kubectl --namespace ${QDB_NAMESPACE} get service questdb-public -o 'jsonpath={.spec.clusterIP}')
- QDB_PORT=$(kubectl --namespace ${QDB_NAMESPACE} get service questdb-public -o 'jsonpath={.spec.ports[?(@.name=="http")].port}')
-
echo "Drop tables, if exist"
+
+ if [[ -z "${GITLAB_CI}" ]]; then
+ #kubectl --namespace ${QDB_NAMESPACE} get service questdb-public -o yaml
+ QDB_HOST=$(kubectl --namespace ${QDB_NAMESPACE} get service questdb-public -o 'jsonpath={.spec.clusterIP}')
+ QDB_PORT=$(kubectl --namespace ${QDB_NAMESPACE} get service questdb-public -o 'jsonpath={.spec.ports[?(@.name=="http")].port}')
+ else
+ QDB_HOST="127.0.0.1"
+ QDB_PORT=${QDB_EXT_PORT_HTTP}
+ fi
+
curl "http://${QDB_HOST}:${QDB_PORT}/exec?fmt=json&query=DROP+TABLE+IF+EXISTS+${QDB_TABLE_MONITORING_KPIS}+;"
echo
curl "http://${QDB_HOST}:${QDB_PORT}/exec?fmt=json&query=DROP+TABLE+IF+EXISTS+${QDB_TABLE_SLICE_GROUPS}+;"
diff --git a/deploy/show.sh b/deploy/show.sh
index a4084ac65402c7987504fbcacdf6aa5b44029fc4..4fa1ce3a6dac5194e967ccbe0826a6ed9a64e3f8 100755
--- a/deploy/show.sh
+++ b/deploy/show.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
+# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/deploy/tfs.sh b/deploy/tfs.sh
index 261996acb3a11cc582a6c3a6bb3a2253e20fdd5c..3fdbe77fb502c42aaf7dd507ab239f6b3bb20056 100755
--- a/deploy/tfs.sh
+++ b/deploy/tfs.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
+# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -27,7 +27,7 @@ export TFS_REGISTRY_IMAGES=${TFS_REGISTRY_IMAGES:-"http://localhost:32000/tfs/"}
# If not already set, set the list of components, separated by spaces, you want to build images for, and deploy.
# By default, only basic components are deployed
-export TFS_COMPONENTS=${TFS_COMPONENTS:-"context device automation monitoring pathcomp service slice compute webui load_generator"}
+export TFS_COMPONENTS=${TFS_COMPONENTS:-"context device ztp monitoring pathcomp service slice nbi webui load_generator"}
# If not already set, set the tag you want to use for your images.
export TFS_IMAGE_TAG=${TFS_IMAGE_TAG:-"dev"}
@@ -148,6 +148,10 @@ printf "\n"
echo "Create secret with NATS data"
NATS_CLIENT_PORT=$(kubectl --namespace ${NATS_NAMESPACE} get service ${NATS_NAMESPACE} -o 'jsonpath={.spec.ports[?(@.name=="client")].port}')
+if [ -z "$NATS_CLIENT_PORT" ]; then
+ # NATS charts updated and port name changed from "client" to "nats"; fix to support new name and enable backward compatibility
+ NATS_CLIENT_PORT=$(kubectl --namespace ${NATS_NAMESPACE} get service ${NATS_NAMESPACE} -o 'jsonpath={.spec.ports[?(@.name=="nats")].port}')
+fi
kubectl create secret generic nats-data --namespace ${TFS_K8S_NAMESPACE} --type='Opaque' \
--from-literal=NATS_NAMESPACE=${NATS_NAMESPACE} \
--from-literal=NATS_CLIENT_PORT=${NATS_CLIENT_PORT}
@@ -183,6 +187,22 @@ REDIS_PASSWORD=`uuidgen`
kubectl create secret generic redis-secrets --namespace=$TFS_K8S_NAMESPACE \
--from-literal=REDIS_PASSWORD=$REDIS_PASSWORD
echo "export REDIS_PASSWORD=${REDIS_PASSWORD}" >> $ENV_VARS_SCRIPT
+printf "\n"
+
+DOCKER_BUILD="docker build"
+DOCKER_MAJOR_VERSION=$(docker --version | grep -o -E "Docker version [0-9]+\." | grep -o -E "[0-9]+" | cut -c 1-3)
+if [[ $DOCKER_MAJOR_VERSION -ge 23 ]]; then
+ # If Docker version >= 23, build command was migrated to docker-buildx
+ # In Ubuntu, in practice, means to install package docker-buildx together with docker.io
+ # Check if docker-buildx plugin is installed
+ docker buildx version 1>/dev/null 2>/dev/null
+ if [[ $? -ne 0 ]]; then
+ echo "Docker buildx command is not installed. Check: https://docs.docker.com/build/architecture/#install-buildx"
+ echo "If you installed docker through APT package docker.io, consider installing also package docker-buildx"
+ exit 1;
+ fi
+ DOCKER_BUILD="docker buildx build"
+fi
for COMPONENT in $TFS_COMPONENTS; do
echo "Processing '$COMPONENT' component..."
@@ -191,25 +211,25 @@ for COMPONENT in $TFS_COMPONENTS; do
echo " Building Docker image..."
BUILD_LOG="$TMP_LOGS_FOLDER/build_${COMPONENT}.log"
- if [ "$COMPONENT" == "automation" ] || [ "$COMPONENT" == "policy" ]; then
- docker build -t "$COMPONENT:$TFS_IMAGE_TAG" -f ./src/"$COMPONENT"/Dockerfile ./src/"$COMPONENT"/ > "$BUILD_LOG"
+ if [ "$COMPONENT" == "ztp" ] || [ "$COMPONENT" == "policy" ]; then
+ $DOCKER_BUILD -t "$COMPONENT:$TFS_IMAGE_TAG" -f ./src/"$COMPONENT"/Dockerfile ./src/"$COMPONENT"/ > "$BUILD_LOG"
elif [ "$COMPONENT" == "pathcomp" ]; then
BUILD_LOG="$TMP_LOGS_FOLDER/build_${COMPONENT}-frontend.log"
- docker build -t "$COMPONENT-frontend:$TFS_IMAGE_TAG" -f ./src/"$COMPONENT"/frontend/Dockerfile . > "$BUILD_LOG"
+ $DOCKER_BUILD -t "$COMPONENT-frontend:$TFS_IMAGE_TAG" -f ./src/"$COMPONENT"/frontend/Dockerfile . > "$BUILD_LOG"
BUILD_LOG="$TMP_LOGS_FOLDER/build_${COMPONENT}-backend.log"
- docker build -t "$COMPONENT-backend:$TFS_IMAGE_TAG" -f ./src/"$COMPONENT"/backend/Dockerfile . > "$BUILD_LOG"
+ $DOCKER_BUILD -t "$COMPONENT-backend:$TFS_IMAGE_TAG" -f ./src/"$COMPONENT"/backend/Dockerfile . > "$BUILD_LOG"
# next command is redundant, but helpful to keep cache updated between rebuilds
IMAGE_NAME="$COMPONENT-backend:$TFS_IMAGE_TAG-builder"
- docker build -t "$IMAGE_NAME" --target builder -f ./src/"$COMPONENT"/backend/Dockerfile . >> "$BUILD_LOG"
+ $DOCKER_BUILD -t "$IMAGE_NAME" --target builder -f ./src/"$COMPONENT"/backend/Dockerfile . >> "$BUILD_LOG"
elif [ "$COMPONENT" == "dlt" ]; then
BUILD_LOG="$TMP_LOGS_FOLDER/build_${COMPONENT}-connector.log"
- docker build -t "$COMPONENT-connector:$TFS_IMAGE_TAG" -f ./src/"$COMPONENT"/connector/Dockerfile . > "$BUILD_LOG"
+ $DOCKER_BUILD -t "$COMPONENT-connector:$TFS_IMAGE_TAG" -f ./src/"$COMPONENT"/connector/Dockerfile . > "$BUILD_LOG"
BUILD_LOG="$TMP_LOGS_FOLDER/build_${COMPONENT}-gateway.log"
- docker build -t "$COMPONENT-gateway:$TFS_IMAGE_TAG" -f ./src/"$COMPONENT"/gateway/Dockerfile . > "$BUILD_LOG"
+ $DOCKER_BUILD -t "$COMPONENT-gateway:$TFS_IMAGE_TAG" -f ./src/"$COMPONENT"/gateway/Dockerfile . > "$BUILD_LOG"
else
- docker build -t "$COMPONENT:$TFS_IMAGE_TAG" -f ./src/"$COMPONENT"/Dockerfile . > "$BUILD_LOG"
+ $DOCKER_BUILD -t "$COMPONENT:$TFS_IMAGE_TAG" -f ./src/"$COMPONENT"/Dockerfile . > "$BUILD_LOG"
fi
echo " Pushing Docker image to '$TFS_REGISTRY_IMAGES'..."
@@ -279,8 +299,13 @@ for COMPONENT in $TFS_COMPONENTS; do
VERSION=$(grep -i "${GITLAB_REPO_URL}/${COMPONENT}-gateway:" "$MANIFEST" | cut -d ":" -f4)
sed -E -i "s#image: $GITLAB_REPO_URL/$COMPONENT-gateway:${VERSION}#image: $IMAGE_URL#g" "$MANIFEST"
else
- IMAGE_URL=$(echo "$TFS_REGISTRY_IMAGES/$COMPONENT:$TFS_IMAGE_TAG" | sed 's,//,/,g' | sed 's,http:/,,g')
- VERSION=$(grep -i "${GITLAB_REPO_URL}/${COMPONENT}:" "$MANIFEST" | cut -d ":" -f4)
+ if [ "$TFS_SKIP_BUILD" != "YES" ]; then
+ IMAGE_URL=$(echo "$TFS_REGISTRY_IMAGES/$COMPONENT:$TFS_IMAGE_TAG" | sed 's,//,/,g' | sed 's,http:/,,g')
+ VERSION=$(grep -i "${GITLAB_REPO_URL}/${COMPONENT}:" "$MANIFEST" | cut -d ":" -f4)
+ else
+ VERSION=$(grep -i "${GITLAB_REPO_URL}/${COMPONENT}:" "$MANIFEST" | cut -d ":" -f4)
+ IMAGE_URL=$(echo "$TFS_REGISTRY_IMAGES/$COMPONENT:$VERSION" | sed 's,//,/,g' | sed 's,http:/,,g')
+ fi
sed -E -i "s#image: $GITLAB_REPO_URL/$COMPONENT:${VERSION}#image: $IMAGE_URL#g" "$MANIFEST"
fi
@@ -344,11 +369,17 @@ for COMPONENT in $TFS_COMPONENTS; do
echo "Waiting for '$COMPONENT' component..."
COMPONENT_OBJNAME=$(echo "${COMPONENT}" | sed "s/\_/-/")
kubectl wait --namespace $TFS_K8S_NAMESPACE \
- --for='condition=available' --timeout=300s deployment/${COMPONENT_OBJNAME}service
+ --for='condition=available' --timeout=90s deployment/${COMPONENT_OBJNAME}service
+ WAIT_EXIT_CODE=$?
+ if [[ $WAIT_EXIT_CODE != 0 ]]; then
+ echo " Failed to deploy '${COMPONENT}' component, exit code '${WAIT_EXIT_CODE}', exiting..."
+ kubectl logs --namespace $TFS_K8S_NAMESPACE deployment/${COMPONENT_OBJNAME}service --all-containers=true
+ exit $WAIT_EXIT_CODE
+ fi
printf "\n"
done
-if [[ "$TFS_COMPONENTS" == *"webui"* ]]; then
+if [[ "$TFS_COMPONENTS" == *"monitoring"* ]] && [[ "$TFS_COMPONENTS" == *"webui"* ]]; then
echo "Configuring WebUI DataStores and Dashboards..."
sleep 5
@@ -554,3 +585,9 @@ if [[ "$TFS_COMPONENTS" == *"webui"* ]]; then
printf "\n\n"
fi
+
+if [ "$DOCKER_BUILD" == "docker buildx build" ]; then
+ echo "Pruning Docker Buildx Cache..."
+ docker buildx prune --force
+ printf "\n\n"
+fi
diff --git a/hackfest/containerlab/commands.txt b/hackfest/containerlab/commands.txt
index 18c629c0af2fe176a34f9b08a16405731c185243..df5fbc0ce0163f4ce06b862e90e29854dbae204a 100644
--- a/hackfest/containerlab/commands.txt
+++ b/hackfest/containerlab/commands.txt
@@ -60,22 +60,24 @@ docker exec -it clab-tfs-scenario-client2 bash
$ sudo bash -c "$(curl -sL https://get-gnmic.kmrd.dev)"
## gNMI Capabilities request
-$ gnmic -a clab-srlinux-srl1 -u admin -p NokiaSrl1! --skip-verify capabilities
+$ gnmic -a clab-tfs-scenario-srl1 -u admin -p NokiaSrl1! --skip-verify capabilities
## gNMI Get request
-$ gnmic -a clab-srlinux-srl1 -u admin -p NokiaSrl1! --skip-verify -e json_ietf get --path /system/name/host-name
-$ gnmic -a clab-srlinux-srl1 -u admin -p NokiaSrl1! --skip-verify -e json_ietf get --path /interface[name=mgmt0]
+$ gnmic -a clab-tfs-scenario-srl1 -u admin -p NokiaSrl1! --skip-verify -e json_ietf get --path /system/config/hostname
+$ gnmic -a clab-tfs-scenario-srl1 -u admin -p NokiaSrl1! --skip-verify -e json_ietf get --path /interfaces/interface[name=mgmt0]
+
## gNMI Set request
-$ gnmic -a clab-srlinux-srl1 -u admin -p NokiaSrl1! --skip-verify -e json_ietf set --update-path /system/name/host-name --update-value slr11
+$ gnmic -a clab-tfs-scenario-srl1 -u admin -p NokiaSrl1! --skip-verify -e json_ietf set --update-path /system/config/hostname --update-value srl11
-(we check the changed value)
-$ gnmic -a clab-srlinux-srl1 -u admin -p NokiaSrl1! --skip-verify -e json_ietf get --path /system/name/host-name
+(we check the changed value)
+$ gnmic -a clab-tfs-scenario-srl1 -u admin -p NokiaSrl1! --skip-verify -e json_ietf get --path /system/config/hostname
## Subscribe request
-$ gnmic -a clab-srlinux-srl1 -u admin -p NokiaSrl1! --skip-verify -e json_ietf subscribe --path /interface[name=mgmt0]/statistics
+$ gnmic -a clab-tfs-scenario-srl1 -u admin -p NokiaSrl1! --skip-verify -e json_ietf subscribe --path /interfaces/interface[name=mgmt0]/state/
+
(In another terminal, you can generate traffic)
-$ssh admin@clab-srlinux-srl1
+$ssh admin@clab-tfs-scenario-srl1
diff --git a/hackfest/containerlab/tfs-scenario.clab.yml b/hackfest/containerlab/tfs-scenario.clab.yml
index df197ebea70906874515240f18d2f06c4c307c88..f79378757827ff706be849b03277b947ee85f7fb 100644
--- a/hackfest/containerlab/tfs-scenario.clab.yml
+++ b/hackfest/containerlab/tfs-scenario.clab.yml
@@ -1,4 +1,4 @@
-# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
+# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/hackfest/gnmi/srlinux.clab.yml b/hackfest/gnmi/srlinux.clab.yml
index a589292ac5b58664646ab7d3cccebfd62c28a540..6cfeb6108cd88cb52bd5925a374ea8c6724f4c69 100644
--- a/hackfest/gnmi/srlinux.clab.yml
+++ b/hackfest/gnmi/srlinux.clab.yml
@@ -1,4 +1,4 @@
-# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
+# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/hackfest/grpc/connection.proto b/hackfest/grpc/connection.proto
index 0e8522768614ec4c698b87647118101ae0479aaa..0da1059f3d65357f520b5123cc29d4c6230e8388 100644
--- a/hackfest/grpc/connection.proto
+++ b/hackfest/grpc/connection.proto
@@ -1,4 +1,4 @@
-// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
+// Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/hackfest/grpc/connection/create.py b/hackfest/grpc/connection/create.py
index 7d134105d04b155abc2d3d4ad3e4efeef085c81a..9e32dd8d4e3c89555c039d417b5aab2f6d9ef321 100644
--- a/hackfest/grpc/connection/create.py
+++ b/hackfest/grpc/connection/create.py
@@ -1,5 +1,5 @@
#! /usr/bin/env python3
-# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
+# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/hackfest/grpc/connection/list.py b/hackfest/grpc/connection/list.py
index 5b1926d3cac8dbdf00d889726b1638e0a70ad6b2..e852b69b7cee16e02ca2021db83bbc11cd9c7538 100644
--- a/hackfest/grpc/connection/list.py
+++ b/hackfest/grpc/connection/list.py
@@ -1,5 +1,5 @@
#! /usr/bin/env python3
-# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
+# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/hackfest/grpc/connectionService.proto b/hackfest/grpc/connectionService.proto
index 8f6b5a6e781ba074239bfdbc2d05bea638b153a3..0a80f2c1a49056ce76766e720b427283fd63969d 100644
--- a/hackfest/grpc/connectionService.proto
+++ b/hackfest/grpc/connectionService.proto
@@ -1,4 +1,4 @@
-// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
+// Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/hackfest/grpc/connectionService/connectionService_client.py b/hackfest/grpc/connectionService/connectionService_client.py
index e5c1bf48186b4c5e7e3425e3601e32642e7d2fcc..2ed97ae97c4ef50c036635f8d5fb5812ad92c5b5 100644
--- a/hackfest/grpc/connectionService/connectionService_client.py
+++ b/hackfest/grpc/connectionService/connectionService_client.py
@@ -1,4 +1,4 @@
-# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
+# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/hackfest/grpc/connectionService/connectionService_server.py b/hackfest/grpc/connectionService/connectionService_server.py
index f1632db90cd6d7dbfd186fe3c4bad9da32195b28..ff991f44c16ac12ec7042f922dc9558ec08fcfbe 100644
--- a/hackfest/grpc/connectionService/connectionService_server.py
+++ b/hackfest/grpc/connectionService/connectionService_server.py
@@ -1,4 +1,4 @@
-# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
+# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/hackfest/grpc/connectionServiceWithNotif.proto b/hackfest/grpc/connectionServiceWithNotif.proto
index f2f5b17e317cd5c15461979cf2cf20462d3d72de..778203e2619aa938194107d855ea4949fdf550da 100644
--- a/hackfest/grpc/connectionServiceWithNotif.proto
+++ b/hackfest/grpc/connectionServiceWithNotif.proto
@@ -1,4 +1,4 @@
-// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
+// Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/hackfest/grpc/connectionServiceWithNotif/connectionServiceWithNotif_client.py b/hackfest/grpc/connectionServiceWithNotif/connectionServiceWithNotif_client.py
index 9518bf743221c0a2e2c1191be063aafff8eaccb5..2503f424f4dd3445d91c82daa235f4677e6f910a 100644
--- a/hackfest/grpc/connectionServiceWithNotif/connectionServiceWithNotif_client.py
+++ b/hackfest/grpc/connectionServiceWithNotif/connectionServiceWithNotif_client.py
@@ -1,4 +1,4 @@
-# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
+# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/hackfest/grpc/connectionServiceWithNotif/connectionServiceWithNotif_server.py b/hackfest/grpc/connectionServiceWithNotif/connectionServiceWithNotif_server.py
index 922f91837bc013f038985cbb0ef44aa234556696..d5c413064968c9ef30e015cf818e66066d45ceb9 100644
--- a/hackfest/grpc/connectionServiceWithNotif/connectionServiceWithNotif_server.py
+++ b/hackfest/grpc/connectionServiceWithNotif/connectionServiceWithNotif_server.py
@@ -1,4 +1,4 @@
-# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
+# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/hackfest/grpc/topologyService.proto b/hackfest/grpc/topologyService.proto
index 775e45addedd8fd30c888ddcd7f3de92a9b66a4b..6a38bf9c7dd1762743eda91b01c639f9bc5ae3ab 100644
--- a/hackfest/grpc/topologyService.proto
+++ b/hackfest/grpc/topologyService.proto
@@ -1,4 +1,4 @@
-// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
+// Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/hackfest/grpc/topologyService/topologyService_client.py b/hackfest/grpc/topologyService/topologyService_client.py
index ef628183bed45452f191fc3be07a87db97ed6650..aa1ffc2bf6269ebd7495c9f01438cfc73315c687 100644
--- a/hackfest/grpc/topologyService/topologyService_client.py
+++ b/hackfest/grpc/topologyService/topologyService_client.py
@@ -1,4 +1,4 @@
-# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
+# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/hackfest/grpc/topologyService/topologyService_server.py b/hackfest/grpc/topologyService/topologyService_server.py
index ff1c80e82a9bf3404c6e9da9b3c0f7c534d01889..dfd62aa13adf189c10477840c747fb34b610d5fc 100644
--- a/hackfest/grpc/topologyService/topologyService_server.py
+++ b/hackfest/grpc/topologyService/topologyService_server.py
@@ -1,4 +1,4 @@
-# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
+# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/hackfest/kafka/pub.py b/hackfest/kafka/pub.py
index e80dd5db82632b9ef17e7fdf017b8964ab357623..77564dfcb710677ecbd8fa9b2cbe8e6145c5baac 100644
--- a/hackfest/kafka/pub.py
+++ b/hackfest/kafka/pub.py
@@ -1,4 +1,4 @@
-# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
+# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/hackfest/kafka/sub.py b/hackfest/kafka/sub.py
index 233b9f9d0c8b4a4a744859beeaff0141c04e0560..2253c64674ce421d288344315649fbee64058432 100644
--- a/hackfest/kafka/sub.py
+++ b/hackfest/kafka/sub.py
@@ -1,4 +1,4 @@
-# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
+# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/hackfest/mock_osm/MockOSM.py b/hackfest/mock_osm/MockOSM.py
index 338db0e19becc8a9dd277beec7f3b4ceb2e765a3..7ced57d3efa64038d09f5cea21fb7098b8ceb2ba 100644
--- a/hackfest/mock_osm/MockOSM.py
+++ b/hackfest/mock_osm/MockOSM.py
@@ -1,4 +1,4 @@
-# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
+# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/hackfest/mock_osm/__init__.py b/hackfest/mock_osm/__init__.py
index 1549d9811aa5d1c193a44ad45d0d7773236c0612..3ee6f7071f145e06c3aeaefc09a43ccd88e619e3 100644
--- a/hackfest/mock_osm/__init__.py
+++ b/hackfest/mock_osm/__init__.py
@@ -1,4 +1,4 @@
-# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
+# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/hackfest/mock_osm/__main__.py b/hackfest/mock_osm/__main__.py
index 4ed25eaedbf4eba1f04ea41c72a751ecd7d6380b..48866fb2db7ac92c37f57561abc58c2d45df810a 100644
--- a/hackfest/mock_osm/__main__.py
+++ b/hackfest/mock_osm/__main__.py
@@ -1,4 +1,4 @@
-# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
+# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/hackfest/netconf-oc/device_definition.py b/hackfest/netconf-oc/device_definition.py
index 6e737f55675e811ebdd96a4d7471f1b4438c8e52..ecd3dd6ce5a7091d5223153ddd0f6e3cca7fc39d 100644
--- a/hackfest/netconf-oc/device_definition.py
+++ b/hackfest/netconf-oc/device_definition.py
@@ -1,4 +1,4 @@
-# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
+# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/hackfest/netconf-oc/interfaces.xml b/hackfest/netconf-oc/interfaces.xml
index c47fc44e3ba9ea0290823eb42feaa444d6179526..f04504bd408a7735ccdaa55c63c85ba25a7bde2d 100644
--- a/hackfest/netconf-oc/interfaces.xml
+++ b/hackfest/netconf-oc/interfaces.xml
@@ -1,6 +1,6 @@
-
-
- 4.0.0
-
- eu.teraflow
- automation
- 0.2.0
- TeraFlow Automation Component
- TeraFlow Automation Component
-
-
- 11
-
- true
- ${java.version}
- ${java.version}
- 3.8.1
- UTF-8
- UTF-8
-
- 3.20.2
- quarkus-bom
- io.quarkus.platform
- jacoco-unit-tests.exec
- jacoco-integration-tests.exec
- 0.8.6
-
- 0.34.1
- 3.3.0
- 3.1.0
- 3.8.1
- 3.1.2
- 3.0.0-M1
- 3.0.0-M3
- 3.0.0-M1
- 3.2.0
- 3.2.0
- 3.0.0-M5
- 3.8.0.2131
- 2.10.3
- 2.8.1
- ${quarkus.platform.version}
-
- 2.2.2.Final
-
-
-
-
- gitlab-maven
- ${env.CI_SERVER_URL}/api/v4/projects/${env.CI_PROJECT_ID}/packages/maven
-
-
-
- gitlab-maven
- ${env.CI_SERVER_URL}/api/v4/projects/${env.CI_PROJECT_ID}/packages/maven
-
-
-
-
-
-
-
-
- false
-
- central
- Central Repository
- https://repo.maven.apache.org/maven2
-
-
-
-
-
-
- io.quarkus
- quarkus-universe-bom
- ${quarkus.platform.version}
- pom
- import
-
-
-
-
-
-
-
- io.github.project-openubl
- quarkus-bouncycastle
- 1.2.2.Final
-
-
-
- io.quarkus
- quarkus-grpc
-
-
-
- io.quarkus
- quarkus-kubernetes
-
-
-
- io.quarkus
- quarkus-container-image-jib
-
-
-
- io.quarkus
- quarkus-kubernetes-service-binding
-
-
-
- io.quarkus
- quarkus-smallrye-health
-
-
-
- io.quarkus
- quarkus-resteasy-reactive
-
-
-
- io.quarkus
- quarkus-arc
-
-
-
- io.quarkus
- quarkus-config-yaml
-
-
-
-
- org.assertj
- assertj-core
- ${assertj.version}
- test
-
-
-
- org.jacoco
- org.jacoco.agent
- runtime
- test
- ${jacoco.version}
-
-
-
- io.quarkus
- quarkus-junit5
- test
-
-
-
- io.quarkus
- quarkus-junit5-mockito
- test
-
-
-
- io.quarkus
- quarkus-smallrye-metrics
-
-
-
-
-
-
-
-
- maven-assembly-plugin
- ${maven-assembly-plugin.version}
-
-
-
- maven-clean-plugin
- ${maven-clean-plugin.version}
-
-
-
- maven-compiler-plugin
- ${maven-compiler-plugin.version}
-
-
- ${java.version}
-
- -Xlint:deprecation
-
-
-
-
-
- maven-deploy-plugin
- ${maven-deploy-plugin.version}
-
-
-
- maven-failsafe-plugin
- ${maven-surefire-plugin.version}
-
-
- ${project.build.directory}/${jacoco.report.integration-test}
-
-
-
-
-
- integration-test
- verify
-
-
-
-
-
-
- maven-install-plugin
- ${maven-install-plugin.version}
-
-
-
- maven-jar-plugin
- ${maven-jar-plugin.version}
-
-
-
- true
-
-
-
-
-
-
- maven-resources-plugin
- ${maven-resources-plugin.version}
-
-
-
- maven-surefire-plugin
- ${maven-surefire-plugin.version}
-
- ${skipUTs}
-
- ${project.build.directory}/${jacoco.report.unit-test}
-
-
-
-
-
- org.sonarsource.scanner.maven
- sonar-maven-plugin
- ${sonarsource-scanner-plugin.version}
-
-
-
-
- io.quarkus
- quarkus-bootstrap-maven-plugin
- ${quarkus-maven-plugin.version}
-
-
-
- io.quarkus
- quarkus-maven-plugin
- ${quarkus-maven-plugin.version}
- true
-
-
-
- build
- generate-code
- generate-code-tests
-
-
-
-
-
-
- org.jacoco
- jacoco-maven-plugin
- ${jacoco.version}
-
-
- automation/*
- context/*
- device/*
- monitoring/*
- kpi_sample_types/*
- acl/*
-
-
-
-
- instrument-unit-tests
- process-classes
-
- instrument
-
-
-
- restore-unit-tests
- test
-
- restore-instrumented-classes
-
-
-
- report-unit-tests
- test
-
- report
-
-
- ${project.build.directory}/${jacoco.report.unit-test}
- ${project.reporting.outputDirectory}/jacoco-unit-tests
-
-
-
-
- instrument-integration-tests
- pre-integration-test
-
- instrument
-
-
-
- restore-integration-tests
- post-integration-test
-
- restore-instrumented-classes
-
-
-
-
- report-integration-tests
- post-integration-test
-
- report
-
-
- ${project.build.directory}/${jacoco.report.integration-test}
- ${project.reporting.outputDirectory}/jacoco-integration-tests
-
-
-
-
-
-
- maven-dependency-plugin
- ${maven-dependency-plugin.version}
-
-
- analyze-dependencies
-
- analyze-only
-
-
-
-
-
-
- maven-enforcer-plugin
- ${maven-enforcer-plugin.version}
-
-
-
- ${java.version}
-
-
- ${maven.version}
-
-
-
-
-
-
- enforce
-
-
-
-
-
-
- com.diffplug.spotless
- spotless-maven-plugin
- ${spotless-plugin.version}
-
-
-
-
- fmt:off
- fmt:on
-
-
-
- 1.10.0
-
-
-
-
-
- true
- 2
-
-
- true
- 4
-
-
-
-
-
- compile
-
- apply
-
-
-
-
-
-
-
-
-
- generate-consolidated-coverage
-
- false
-
-
-
-
- org.jacoco
- jacoco-maven-plugin
-
-
-
-
- merge-results
- verify
-
- merge
-
-
-
-
- ${project.build.directory}
-
- *.exec
-
-
-
- ${project.build.directory}/jacoco.exec
-
-
-
-
- post-merge-report
- verify
-
- report
-
-
- ${project.build.directory}/jacoco.exec
- ${project.reporting.outputDirectory}/jacoco
-
-
-
-
-
-
-
-
-
-
diff --git a/src/automation/src/main/java/eu/teraflow/automation/AutomationConfiguration.java b/src/automation/src/main/java/eu/teraflow/automation/AutomationConfiguration.java
deleted file mode 100644
index 071e8f152da60017d7fb5563ed5e498156a49c37..0000000000000000000000000000000000000000
--- a/src/automation/src/main/java/eu/teraflow/automation/AutomationConfiguration.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
-* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package eu.teraflow.automation;
-
-import io.smallrye.config.ConfigMapping;
-
-@ConfigMapping(prefix = "automation")
-public interface AutomationConfiguration {
-
- boolean shouldSubscribeToContextComponent();
-}
diff --git a/src/automation/src/main/java/eu/teraflow/automation/AutomationGateway.java b/src/automation/src/main/java/eu/teraflow/automation/AutomationGateway.java
deleted file mode 100644
index 53803f51657d96475db8828f123cdefbb443f0ab..0000000000000000000000000000000000000000
--- a/src/automation/src/main/java/eu/teraflow/automation/AutomationGateway.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
-* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package eu.teraflow.automation;
-
-import automation.AutomationService;
-
-public interface AutomationGateway extends AutomationService {}
diff --git a/src/automation/src/main/java/eu/teraflow/automation/AutomationGatewayImpl.java b/src/automation/src/main/java/eu/teraflow/automation/AutomationGatewayImpl.java
deleted file mode 100644
index 217c76671cbb8524c7f0c0218e83fedc5e52bdb0..0000000000000000000000000000000000000000
--- a/src/automation/src/main/java/eu/teraflow/automation/AutomationGatewayImpl.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
-* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package eu.teraflow.automation;
-
-import automation.Automation;
-import automation.Automation.DeviceRoleConfig;
-import automation.Automation.DeviceRoleState;
-import context.ContextOuterClass;
-import eu.teraflow.automation.context.model.Device;
-import eu.teraflow.automation.model.DeviceRoleId;
-import eu.teraflow.automation.model.DeviceState;
-import io.quarkus.grpc.GrpcService;
-import io.smallrye.mutiny.Uni;
-import javax.inject.Inject;
-import org.eclipse.microprofile.metrics.MetricUnits;
-import org.eclipse.microprofile.metrics.annotation.Counted;
-import org.eclipse.microprofile.metrics.annotation.Timed;
-
-@GrpcService
-public class AutomationGatewayImpl implements AutomationGateway {
-
- private final AutomationService automationService;
- private final Serializer serializer;
-
- @Inject
- public AutomationGatewayImpl(AutomationService automationService, Serializer serializer) {
- this.automationService = automationService;
- this.serializer = serializer;
- }
-
- @Override
- @Counted(name = "automation_ztpGetDeviceRole_counter")
- @Timed(name = "automation_ztpGetDeviceRole_histogram", unit = MetricUnits.MILLISECONDS)
- public Uni ztpGetDeviceRole(Automation.DeviceRoleId request) {
- return Uni.createFrom()
- .item(() -> Automation.DeviceRole.newBuilder().setDevRoleId(request).build());
- }
-
- @Override
- @Counted(name = "automation_ztpGetDeviceRolesByDeviceId_counter")
- @Timed(name = "automation_ztpGetDeviceRolesByDeviceId_histogram", unit = MetricUnits.MILLISECONDS)
- public Uni ztpGetDeviceRolesByDeviceId(
- ContextOuterClass.DeviceId request) {
- return Uni.createFrom().item(() -> Automation.DeviceRoleList.newBuilder().build());
- }
-
- @Override
- @Counted(name = "automation_ztpAdd_counter")
- @Timed(name = "automation_ztpAdd_histogram", unit = MetricUnits.MILLISECONDS)
- public Uni ztpAdd(Automation.DeviceRole request) {
- final var devRoleId = request.getDevRoleId().getDevRoleId().getUuid();
- final var deviceId = serializer.deserialize(request.getDevRoleId().getDevId());
-
- return automationService
- .addDevice(deviceId)
- .onItem()
- .transform(device -> transformToDeviceRoleState(device, devRoleId, DeviceState.CREATED));
- }
-
- @Override
- @Counted(name = "automation_ztpUpdate_counter")
- @Timed(name = "automation_ztpUpdate_histogram", unit = MetricUnits.MILLISECONDS)
- public Uni ztpUpdate(DeviceRoleConfig request) {
- final var devRoleId = request.getDevRole().getDevRoleId().getDevRoleId().getUuid();
- final var deviceId = serializer.deserialize(request.getDevRole().getDevRoleId().getDevId());
- final var deviceConfig = serializer.deserialize(request.getDevConfig());
-
- return automationService
- .updateDevice(deviceId, deviceConfig)
- .onItem()
- .transform(device -> transformToDeviceRoleState(device, devRoleId, DeviceState.UPDATED));
- }
-
- @Override
- @Counted(name = "automation_ztpDelete_counter")
- @Timed(name = "automation_ztpDelete_histogram", unit = MetricUnits.MILLISECONDS)
- public Uni ztpDelete(Automation.DeviceRole request) {
- final var devRoleId = request.getDevRoleId().getDevRoleId().getUuid();
- return automationService
- .deleteDevice(devRoleId)
- .onItem()
- .transform(device -> transformToDeviceRoleState(device, devRoleId, DeviceState.DELETED));
- }
-
- @Override
- @Counted(name = "automation_ztpDeleteAll_counter")
- @Timed(name = "automation_ztpDeleteAll_histogram", unit = MetricUnits.MILLISECONDS)
- public Uni ztpDeleteAll(ContextOuterClass.Empty empty) {
- return Uni.createFrom().item(() -> Automation.DeviceDeletionResult.newBuilder().build());
- }
-
- private Automation.DeviceRoleState transformToDeviceRoleState(
- Device device, String devRoleId, DeviceState deviceState) {
- final var deviceRoleId = new DeviceRoleId(devRoleId, device.getDeviceId());
- final var serializeDeviceRoleId = serializer.serialize(deviceRoleId);
- final var serializedDeviceState = serializer.serialize(deviceState);
-
- return Automation.DeviceRoleState.newBuilder()
- .setDevRoleId(serializeDeviceRoleId)
- .setDevRoleState(serializedDeviceState)
- .build();
- }
-}
diff --git a/src/automation/src/main/java/eu/teraflow/automation/AutomationService.java b/src/automation/src/main/java/eu/teraflow/automation/AutomationService.java
deleted file mode 100644
index 9e3874eb2f97e4e47bc0b4a061a40c394eeb1ed4..0000000000000000000000000000000000000000
--- a/src/automation/src/main/java/eu/teraflow/automation/AutomationService.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
-* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package eu.teraflow.automation;
-
-import eu.teraflow.automation.context.model.Device;
-import eu.teraflow.automation.context.model.DeviceConfig;
-import io.smallrye.mutiny.Uni;
-
-public interface AutomationService {
-
- Uni addDevice(String deviceId);
-
- Uni deleteDevice(String deviceId);
-
- Uni updateDevice(String deviceId, DeviceConfig deviceConfig);
-}
diff --git a/src/automation/src/main/java/eu/teraflow/automation/AutomationServiceImpl.java b/src/automation/src/main/java/eu/teraflow/automation/AutomationServiceImpl.java
deleted file mode 100644
index 017a101fb1a5b35b018a775d36f24480104f586f..0000000000000000000000000000000000000000
--- a/src/automation/src/main/java/eu/teraflow/automation/AutomationServiceImpl.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
-* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package eu.teraflow.automation;
-
-import eu.teraflow.automation.context.ContextService;
-import eu.teraflow.automation.context.model.Device;
-import eu.teraflow.automation.context.model.DeviceConfig;
-import eu.teraflow.automation.device.DeviceService;
-import io.smallrye.mutiny.Uni;
-import javax.enterprise.context.ApplicationScoped;
-import javax.inject.Inject;
-import org.jboss.logging.Logger;
-
-@ApplicationScoped
-public class AutomationServiceImpl implements AutomationService {
- private static final Logger LOGGER = Logger.getLogger(AutomationServiceImpl.class);
- // private static final String MESSAGE = "Retrieved %s";
-
- private final DeviceService deviceService;
- private final ContextService contextService;
-
- @Inject
- public AutomationServiceImpl(DeviceService deviceService, ContextService contextService) {
- this.deviceService = deviceService;
- this.contextService = contextService;
- }
-
- @Override
- public Uni addDevice(String deviceId) {
- final var deserializedDeviceUni = contextService.getDevice(deviceId);
-
- deserializedDeviceUni
- .onFailure()
- .recoverWithNull()
- .subscribe()
- .with(
- device -> {
- final var id = deviceId;
-
- if (device == null) {
- LOGGER.warnf("%s is null. Ignoring...", device);
- return;
- }
-
- if (device.isEnabled()) {
- LOGGER.warnf("%s has already been enabled. Ignoring...", device);
- return;
- }
-
- // LOGGER.infof(MESSAGE, device);
-
- final var initialConfiguration =
- deviceService.getInitialConfiguration(device.getDeviceId());
-
- device.enableDevice();
- LOGGER.infof("Enabled device [%s]", id);
-
- initialConfiguration
- .subscribe()
- .with(
- deviceConfig -> {
- device.setDeviceConfiguration(deviceConfig);
- final var configuredDeviceIdUni = deviceService.configureDevice(device);
-
- configuredDeviceIdUni
- .subscribe()
- .with(
- configuredDeviceId ->
- LOGGER.infof(
- "Device [%s] has been successfully enabled and configured with %s.\n",
- id, deviceConfig));
- });
- });
-
- return deserializedDeviceUni;
- }
-
- @Override
- public Uni deleteDevice(String deviceId) {
- final var deserializedDeviceUni = contextService.getDevice(deviceId);
-
- deserializedDeviceUni
- .onFailure()
- .recoverWithNull()
- .subscribe()
- .with(
- device -> {
- final var id = deviceId;
-
- if (device == null) {
- LOGGER.warnf("%s is null. Ignoring...", device);
- return;
- }
-
- if (device.isDisabled()) {
- LOGGER.warnf("%s has already been disabled. Ignoring...", device);
- return;
- }
-
- device.disableDevice();
- LOGGER.infof("Disabled device [%s]", id);
-
- // LOGGER.infof(MESSAGE, device);
-
- final var empty = deviceService.deleteDevice(device.getDeviceId());
-
- empty
- .subscribe()
- .with(
- emptyMessage ->
- LOGGER.infof("Device [%s] has been successfully deleted.\n", id));
- });
-
- return deserializedDeviceUni;
- }
-
- @Override
- public Uni updateDevice(String deviceId, DeviceConfig deviceConfig) {
- final var deserializedDeviceUni = contextService.getDevice(deviceId);
-
- deserializedDeviceUni
- .onFailure()
- .recoverWithNull()
- .subscribe()
- .with(
- device -> {
- final var id = deviceId;
-
- if (device == null) {
- LOGGER.warnf("%s is null. Ignoring...", device);
- return;
- }
-
- if (!device.isEnabled()) {
- LOGGER.warnf("Cannot update disabled device %s. Ignoring...", device);
- return;
- }
-
- // LOGGER.infof(MESSAGE, device);
- device.setDeviceConfiguration(deviceConfig);
- final var updatedDeviceIdUni = deviceService.configureDevice(device);
-
- updatedDeviceIdUni
- .subscribe()
- .with(
- configuredDeviceId ->
- LOGGER.infof(
- "Device [%s] has been successfully updated with %s.\n",
- id, deviceConfig));
- });
-
- return deserializedDeviceUni;
- }
-}
diff --git a/src/automation/src/main/java/eu/teraflow/automation/Serializer.java b/src/automation/src/main/java/eu/teraflow/automation/Serializer.java
deleted file mode 100644
index b0729aa55b25da030f9722330e22a0976a3d007f..0000000000000000000000000000000000000000
--- a/src/automation/src/main/java/eu/teraflow/automation/Serializer.java
+++ /dev/null
@@ -1,1007 +0,0 @@
-/*
-* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package eu.teraflow.automation;
-
-import acl.Acl;
-import automation.Automation;
-import automation.Automation.ZtpDeviceState;
-import context.ContextOuterClass;
-import context.ContextOuterClass.ConfigRule_ACL;
-import context.ContextOuterClass.ConfigRule_Custom;
-import context.ContextOuterClass.ContextId;
-import context.ContextOuterClass.DeviceId;
-import context.ContextOuterClass.DeviceOperationalStatusEnum;
-import context.ContextOuterClass.Location.LocationCase;
-import context.ContextOuterClass.Uuid;
-import eu.teraflow.automation.acl.AclAction;
-import eu.teraflow.automation.acl.AclEntry;
-import eu.teraflow.automation.acl.AclForwardActionEnum;
-import eu.teraflow.automation.acl.AclLogActionEnum;
-import eu.teraflow.automation.acl.AclMatch;
-import eu.teraflow.automation.acl.AclRuleSet;
-import eu.teraflow.automation.acl.AclRuleTypeEnum;
-import eu.teraflow.automation.context.model.ConfigActionEnum;
-import eu.teraflow.automation.context.model.ConfigRule;
-import eu.teraflow.automation.context.model.ConfigRuleAcl;
-import eu.teraflow.automation.context.model.ConfigRuleCustom;
-import eu.teraflow.automation.context.model.ConfigRuleTypeAcl;
-import eu.teraflow.automation.context.model.ConfigRuleTypeCustom;
-import eu.teraflow.automation.context.model.Device;
-import eu.teraflow.automation.context.model.DeviceConfig;
-import eu.teraflow.automation.context.model.DeviceDriverEnum;
-import eu.teraflow.automation.context.model.DeviceEvent;
-import eu.teraflow.automation.context.model.DeviceOperationalStatus;
-import eu.teraflow.automation.context.model.Empty;
-import eu.teraflow.automation.context.model.EndPoint;
-import eu.teraflow.automation.context.model.EndPointId;
-import eu.teraflow.automation.context.model.Event;
-import eu.teraflow.automation.context.model.EventTypeEnum;
-import eu.teraflow.automation.context.model.GpsPosition;
-import eu.teraflow.automation.context.model.Location;
-import eu.teraflow.automation.context.model.LocationTypeGpsPosition;
-import eu.teraflow.automation.context.model.LocationTypeRegion;
-import eu.teraflow.automation.context.model.TopologyId;
-import eu.teraflow.automation.kpi_sample_types.model.KpiSampleType;
-import eu.teraflow.automation.model.DeviceRole;
-import eu.teraflow.automation.model.DeviceRoleConfig;
-import eu.teraflow.automation.model.DeviceRoleId;
-import eu.teraflow.automation.model.DeviceRoleType;
-import eu.teraflow.automation.model.DeviceState;
-import java.util.stream.Collectors;
-import javax.inject.Singleton;
-import kpi_sample_types.KpiSampleTypes;
-
-@Singleton
-public class Serializer {
-
- public DeviceId serializeDeviceId(String expectedDeviceId) {
- final var builder = DeviceId.newBuilder();
- final var uuid = serializeUuid(expectedDeviceId);
-
- builder.setDeviceUuid(uuid);
-
- return builder.build();
- }
-
- public String deserialize(DeviceId deviceId) {
- return deviceId.getDeviceUuid().getUuid();
- }
-
- public Automation.DeviceRoleId serialize(DeviceRoleId deviceRoleId) {
- final var builder = Automation.DeviceRoleId.newBuilder();
-
- final var deviceRoleDevRoleId = deviceRoleId.getId();
- final var deviceRoleDeviceId = deviceRoleId.getDeviceId();
-
- final var deviceRoleDevRoleIdUuid = serializeUuid(deviceRoleDevRoleId);
- final var deviceRoleDeviceIdUuid = serializeUuid(deviceRoleDeviceId);
-
- final var deviceId = DeviceId.newBuilder().setDeviceUuid(deviceRoleDeviceIdUuid);
-
- builder.setDevRoleId(deviceRoleDevRoleIdUuid);
- builder.setDevId(deviceId);
-
- return builder.build();
- }
-
- public DeviceRoleId deserialize(Automation.DeviceRoleId deviceRoleId) {
- final var devRoleId = deserialize(deviceRoleId.getDevRoleId());
- final var devId = deserialize(deviceRoleId.getDevId());
-
- return new DeviceRoleId(devRoleId, devId);
- }
-
- public Automation.DeviceRoleType serialize(DeviceRoleType deviceRoleType) {
- switch (deviceRoleType) {
- case NONE:
- return Automation.DeviceRoleType.NONE;
- case DEV_OPS:
- return Automation.DeviceRoleType.DEV_OPS;
- case DEV_CONF:
- return Automation.DeviceRoleType.DEV_CONF;
- case PIPELINE_CONF:
- return Automation.DeviceRoleType.PIPELINE_CONF;
- default:
- return Automation.DeviceRoleType.UNRECOGNIZED;
- }
- }
-
- public DeviceRoleType deserialize(Automation.DeviceRoleType serializedDeviceRoleType) {
- switch (serializedDeviceRoleType) {
- case DEV_OPS:
- return DeviceRoleType.DEV_OPS;
- case DEV_CONF:
- return DeviceRoleType.DEV_CONF;
- case PIPELINE_CONF:
- return DeviceRoleType.PIPELINE_CONF;
- case NONE:
- case UNRECOGNIZED:
- default:
- return DeviceRoleType.NONE;
- }
- }
-
- public Automation.ZtpDeviceState serialize(DeviceState deviceState) {
- switch (deviceState) {
- case CREATED:
- return ZtpDeviceState.ZTP_DEV_STATE_CREATED;
- case UPDATED:
- return ZtpDeviceState.ZTP_DEV_STATE_UPDATED;
- case DELETED:
- return ZtpDeviceState.ZTP_DEV_STATE_DELETED;
- case UNDEFINED:
- return ZtpDeviceState.ZTP_DEV_STATE_UNDEFINED;
- default:
- return ZtpDeviceState.UNRECOGNIZED;
- }
- }
-
- public DeviceState deserialize(Automation.ZtpDeviceState serializedDeviceState) {
- switch (serializedDeviceState) {
- case ZTP_DEV_STATE_CREATED:
- return DeviceState.CREATED;
- case ZTP_DEV_STATE_UPDATED:
- return DeviceState.UPDATED;
- case ZTP_DEV_STATE_DELETED:
- return DeviceState.DELETED;
- case ZTP_DEV_STATE_UNDEFINED:
- case UNRECOGNIZED:
- default:
- return DeviceState.UNDEFINED;
- }
- }
-
- public Automation.DeviceRole serialize(DeviceRole deviceRole) {
- final var builder = Automation.DeviceRole.newBuilder();
- final var serializedDeviceRoleId = serialize(deviceRole.getDeviceRoleId());
- final var serializedDeviceRoleType = serialize(deviceRole.getType());
-
- builder.setDevRoleId(serializedDeviceRoleId);
- builder.setDevRoleType(serializedDeviceRoleType);
-
- return builder.build();
- }
-
- public DeviceRole deserialize(Automation.DeviceRole deviceRole) {
- final var deviceRoleId = deserialize(deviceRole.getDevRoleId());
- final var deviceRoleType = deserialize(deviceRole.getDevRoleType());
-
- return new DeviceRole(deviceRoleId, deviceRoleType);
- }
-
- public Automation.DeviceRoleConfig serialize(DeviceRoleConfig deviceRoleConfig) {
- final var builder = Automation.DeviceRoleConfig.newBuilder();
- final var serializedDeviceRole = serialize(deviceRoleConfig.getDeviceRole());
- final var serializedDeviceConfig = serialize(deviceRoleConfig.getDeviceConfig());
-
- builder.setDevRole(serializedDeviceRole);
- builder.setDevConfig(serializedDeviceConfig);
-
- return builder.build();
- }
-
- public DeviceRoleConfig deserialize(Automation.DeviceRoleConfig deviceRoleConfig) {
- final var deviceRole = deserialize(deviceRoleConfig.getDevRole());
- final var deviceConfig = deserialize(deviceRoleConfig.getDevConfig());
-
- return new DeviceRoleConfig(deviceRole, deviceConfig);
- }
-
- public ContextOuterClass.EventTypeEnum serialize(EventTypeEnum eventTypeEnum) {
- switch (eventTypeEnum) {
- case CREATE:
- return ContextOuterClass.EventTypeEnum.EVENTTYPE_CREATE;
- case REMOVE:
- return ContextOuterClass.EventTypeEnum.EVENTTYPE_REMOVE;
- case UPDATE:
- return ContextOuterClass.EventTypeEnum.EVENTTYPE_UPDATE;
- case UNDEFINED:
- return ContextOuterClass.EventTypeEnum.EVENTTYPE_UNDEFINED;
- default:
- return ContextOuterClass.EventTypeEnum.UNRECOGNIZED;
- }
- }
-
- public EventTypeEnum deserialize(ContextOuterClass.EventTypeEnum serializedEventType) {
- switch (serializedEventType) {
- case EVENTTYPE_CREATE:
- return EventTypeEnum.CREATE;
- case EVENTTYPE_REMOVE:
- return EventTypeEnum.REMOVE;
- case EVENTTYPE_UPDATE:
- return EventTypeEnum.UPDATE;
- case EVENTTYPE_UNDEFINED:
- case UNRECOGNIZED:
- default:
- return EventTypeEnum.UNDEFINED;
- }
- }
-
- public ContextOuterClass.Timestamp serialize(double timestamp) {
- final var builder = ContextOuterClass.Timestamp.newBuilder();
-
- builder.setTimestamp(timestamp);
-
- return builder.build();
- }
-
- public double deserialize(ContextOuterClass.Timestamp serializedTimeStamp) {
-
- return serializedTimeStamp.getTimestamp();
- }
-
- public ContextOuterClass.Event serialize(Event event) {
- final var builder = ContextOuterClass.Event.newBuilder();
-
- final var eventType = serialize(event.getEventTypeEnum());
- final var timestamp = serialize(event.getTimestamp());
- builder.setEventType(eventType);
- builder.setTimestamp(timestamp);
-
- return builder.build();
- }
-
- public Event deserialize(ContextOuterClass.Event serializedEvent) {
- final var timestamp = deserialize(serializedEvent.getTimestamp());
- final var eventType = deserialize(serializedEvent.getEventType());
-
- return new Event(timestamp, eventType);
- }
-
- public ContextOuterClass.DeviceEvent serialize(DeviceEvent deviceEvent) {
- final var builder = ContextOuterClass.DeviceEvent.newBuilder();
- final var deviceIdUuid = serializeUuid(deviceEvent.getDeviceId());
- final var deviceId = DeviceId.newBuilder().setDeviceUuid(deviceIdUuid);
-
- builder.setDeviceId(deviceId);
- builder.setEvent(serialize(deviceEvent.getEvent()));
- builder.setDeviceConfig(serialize(deviceEvent.getDeviceConfig().orElse(null)));
-
- return builder.build();
- }
-
- public DeviceEvent deserialize(ContextOuterClass.DeviceEvent deviceEvent) {
- final var deviceId = deserialize(deviceEvent.getDeviceId());
- final var event = deserialize(deviceEvent.getEvent());
- final var deviceConfig = deserialize(deviceEvent.getDeviceConfig());
-
- return new DeviceEvent(deviceId, event, deviceConfig);
- }
-
- public ContextOuterClass.ConfigActionEnum serialize(ConfigActionEnum configAction) {
- switch (configAction) {
- case SET:
- return ContextOuterClass.ConfigActionEnum.CONFIGACTION_SET;
- case DELETE:
- return ContextOuterClass.ConfigActionEnum.CONFIGACTION_DELETE;
- case UNDEFINED:
- default:
- return ContextOuterClass.ConfigActionEnum.CONFIGACTION_UNDEFINED;
- }
- }
-
- public ConfigActionEnum deserialize(ContextOuterClass.ConfigActionEnum serializedConfigAction) {
- switch (serializedConfigAction) {
- case CONFIGACTION_SET:
- return ConfigActionEnum.SET;
- case CONFIGACTION_DELETE:
- return ConfigActionEnum.DELETE;
- case UNRECOGNIZED:
- case CONFIGACTION_UNDEFINED:
- default:
- return ConfigActionEnum.UNDEFINED;
- }
- }
-
- public ContextId serializeContextId(String expectedContextId) {
- final var builder = ContextId.newBuilder();
- final var uuid = serializeUuid(expectedContextId);
-
- builder.setContextUuid(uuid);
-
- return builder.build();
- }
-
- public String deserialize(ContextId contextId) {
- return contextId.getContextUuid().getUuid();
- }
-
- public ContextOuterClass.TopologyId serialize(TopologyId topologyId) {
- final var builder = ContextOuterClass.TopologyId.newBuilder();
-
- final var topologyIdContextId = topologyId.getContextId();
- final var topologyIdId = topologyId.getId();
-
- final var contextId = serializeContextId(topologyIdContextId);
- final var topologyIdIdUuid = serializeUuid(topologyIdId);
-
- builder.setContextId(contextId);
- builder.setTopologyUuid(topologyIdIdUuid);
-
- return builder.build();
- }
-
- public TopologyId deserialize(ContextOuterClass.TopologyId topologyId) {
- final var topologyIdContextId = deserialize(topologyId.getContextId());
- final var topologyIdId = deserialize(topologyId.getTopologyUuid());
-
- return new TopologyId(topologyIdContextId, topologyIdId);
- }
-
- public ContextOuterClass.EndPointId serialize(EndPointId endPointId) {
- final var builder = ContextOuterClass.EndPointId.newBuilder();
-
- final var endPointIdTopologyId = endPointId.getTopologyId();
- final var endPointIdDeviceId = endPointId.getDeviceId();
- final var endPointIdId = endPointId.getId();
-
- final var serializedTopologyId = serialize(endPointIdTopologyId);
- final var serializedDeviceId = serializeDeviceId(endPointIdDeviceId);
- final var serializedEndPointIdId = serializeUuid(endPointIdId);
-
- builder.setTopologyId(serializedTopologyId);
- builder.setDeviceId(serializedDeviceId);
- builder.setEndpointUuid(serializedEndPointIdId);
-
- return builder.build();
- }
-
- public EndPointId deserialize(ContextOuterClass.EndPointId serializedEndPointId) {
- final var serializedTopologyId = serializedEndPointId.getTopologyId();
- final var serializedDeviceId = serializedEndPointId.getDeviceId();
- final var serializedId = serializedEndPointId.getEndpointUuid();
-
- final var topologyId = deserialize(serializedTopologyId);
- final var deviceId = deserialize(serializedDeviceId);
- final var id = deserialize(serializedId);
-
- return new EndPointId(topologyId, deviceId, id);
- }
-
- public Acl.AclRuleTypeEnum serialize(AclRuleTypeEnum aclRuleTypeEnum) {
- switch (aclRuleTypeEnum) {
- case IPV4:
- return Acl.AclRuleTypeEnum.ACLRULETYPE_IPV4;
- case IPV6:
- return Acl.AclRuleTypeEnum.ACLRULETYPE_IPV6;
- case L2:
- return Acl.AclRuleTypeEnum.ACLRULETYPE_L2;
- case MPLS:
- return Acl.AclRuleTypeEnum.ACLRULETYPE_MPLS;
- case MIXED:
- return Acl.AclRuleTypeEnum.ACLRULETYPE_MIXED;
- case UNDEFINED:
- return Acl.AclRuleTypeEnum.ACLRULETYPE_UNDEFINED;
- default:
- return Acl.AclRuleTypeEnum.UNRECOGNIZED;
- }
- }
-
- public AclRuleTypeEnum deserialize(Acl.AclRuleTypeEnum serializedAclRuleTypeEnum) {
- switch (serializedAclRuleTypeEnum) {
- case ACLRULETYPE_IPV4:
- return AclRuleTypeEnum.IPV4;
- case ACLRULETYPE_IPV6:
- return AclRuleTypeEnum.IPV6;
- case ACLRULETYPE_L2:
- return AclRuleTypeEnum.L2;
- case ACLRULETYPE_MPLS:
- return AclRuleTypeEnum.MPLS;
- case ACLRULETYPE_MIXED:
- return AclRuleTypeEnum.MIXED;
- case UNRECOGNIZED:
- default:
- return AclRuleTypeEnum.UNDEFINED;
- }
- }
-
- public Acl.AclMatch serialize(AclMatch aclMatch) {
- final var builder = Acl.AclMatch.newBuilder();
-
- final var dscp = aclMatch.getDscp();
- final var protocol = aclMatch.getProtocol();
- final var srcAddress = aclMatch.getSrcAddress();
- final var dstAddress = aclMatch.getDstAddress();
- final var srcPort = aclMatch.getSrcPort();
- final var dstPort = aclMatch.getDstPort();
- final var startMplsLabel = aclMatch.getStartMplsLabel();
- final var endMplsLabel = aclMatch.getEndMplsLabel();
-
- builder.setDscp(dscp);
- builder.setProtocol(protocol);
- builder.setSrcAddress(srcAddress);
- builder.setDstAddress(dstAddress);
- builder.setSrcPort(srcPort);
- builder.setDstPort(dstPort);
- builder.setStartMplsLabel(startMplsLabel);
- builder.setEndMplsLabel(endMplsLabel);
-
- return builder.build();
- }
-
- public AclMatch deserialize(Acl.AclMatch serializedAclMatch) {
- final var dscp = serializedAclMatch.getDscp();
- final var protocol = serializedAclMatch.getProtocol();
- final var srcAddress = serializedAclMatch.getSrcAddress();
- final var dstAddress = serializedAclMatch.getDstAddress();
- final var srcPort = serializedAclMatch.getSrcPort();
- final var dstPort = serializedAclMatch.getDstPort();
- final var startMplsLabel = serializedAclMatch.getStartMplsLabel();
- final var endMplsLabel = serializedAclMatch.getEndMplsLabel();
-
- return new AclMatch(
- dscp, protocol, srcAddress, dstAddress, srcPort, dstPort, startMplsLabel, endMplsLabel);
- }
-
- public Acl.AclForwardActionEnum serialize(AclForwardActionEnum aclForwardActionEnum) {
- switch (aclForwardActionEnum) {
- case DROP:
- return Acl.AclForwardActionEnum.ACLFORWARDINGACTION_DROP;
- case ACCEPT:
- return Acl.AclForwardActionEnum.ACLFORWARDINGACTION_ACCEPT;
- case REJECT:
- return Acl.AclForwardActionEnum.ACLFORWARDINGACTION_REJECT;
- case UNDEFINED:
- return Acl.AclForwardActionEnum.ACLFORWARDINGACTION_UNDEFINED;
- default:
- return Acl.AclForwardActionEnum.UNRECOGNIZED;
- }
- }
-
- public AclForwardActionEnum deserialize(Acl.AclForwardActionEnum serializedAclForwardActionEnum) {
- switch (serializedAclForwardActionEnum) {
- case ACLFORWARDINGACTION_DROP:
- return AclForwardActionEnum.DROP;
- case ACLFORWARDINGACTION_ACCEPT:
- return AclForwardActionEnum.ACCEPT;
- case ACLFORWARDINGACTION_REJECT:
- return AclForwardActionEnum.REJECT;
- case UNRECOGNIZED:
- default:
- return AclForwardActionEnum.UNDEFINED;
- }
- }
-
- public Acl.AclLogActionEnum serialize(AclLogActionEnum aclLogActionEnum) {
- switch (aclLogActionEnum) {
- case NO_LOG:
- return Acl.AclLogActionEnum.ACLLOGACTION_NOLOG;
- case SYSLOG:
- return Acl.AclLogActionEnum.ACLLOGACTION_SYSLOG;
- case UNDEFINED:
- return Acl.AclLogActionEnum.ACLLOGACTION_UNDEFINED;
- default:
- return Acl.AclLogActionEnum.UNRECOGNIZED;
- }
- }
-
- public AclLogActionEnum deserialize(Acl.AclLogActionEnum serializedAclLogActionEnum) {
- switch (serializedAclLogActionEnum) {
- case ACLLOGACTION_NOLOG:
- return AclLogActionEnum.NO_LOG;
- case ACLLOGACTION_SYSLOG:
- return AclLogActionEnum.SYSLOG;
- case UNRECOGNIZED:
- default:
- return AclLogActionEnum.UNDEFINED;
- }
- }
-
- public Acl.AclAction serialize(AclAction aclAction) {
- final var builder = Acl.AclAction.newBuilder();
-
- final var aclForwardActionEnum = aclAction.getAclForwardActionEnum();
- final var aclLogActionEnum = aclAction.getAclLogActionEnum();
-
- final var serializedAclForwardActionEnum = serialize(aclForwardActionEnum);
- final var serializedAclLogActionEnum = serialize(aclLogActionEnum);
-
- builder.setForwardAction(serializedAclForwardActionEnum);
- builder.setLogAction(serializedAclLogActionEnum);
-
- return builder.build();
- }
-
- public AclAction deserialize(Acl.AclAction serializedAclAction) {
- final var serializedAclForwardActionEnum = serializedAclAction.getForwardAction();
- final var serializedAclLogActionEnum = serializedAclAction.getLogAction();
-
- final var aclForwardActionEnum = deserialize(serializedAclForwardActionEnum);
- final var aclLogActionEnum = deserialize(serializedAclLogActionEnum);
-
- return new AclAction(aclForwardActionEnum, aclLogActionEnum);
- }
-
- public Acl.AclEntry serialize(AclEntry aclEntry) {
- final var builder = Acl.AclEntry.newBuilder();
-
- final var sequenceId = aclEntry.getSequenceId();
- final var description = aclEntry.getDescription();
- final var aclMatch = aclEntry.getMatch();
- final var aclAction = aclEntry.getAction();
-
- final var serializedAclMatch = serialize(aclMatch);
- final var serializedAclAction = serialize(aclAction);
-
- builder.setSequenceId(sequenceId);
- builder.setDescription(description);
- builder.setMatch(serializedAclMatch);
- builder.setAction(serializedAclAction);
-
- return builder.build();
- }
-
- public AclEntry deserialize(Acl.AclEntry serializedAclEntry) {
- final var sequenceId = serializedAclEntry.getSequenceId();
- final var description = serializedAclEntry.getDescription();
- final var serializedAclMatch = serializedAclEntry.getMatch();
- final var serializedAclAction = serializedAclEntry.getAction();
-
- final var aclMatch = deserialize(serializedAclMatch);
- final var aclAction = deserialize(serializedAclAction);
-
- return new AclEntry(sequenceId, description, aclMatch, aclAction);
- }
-
- public Acl.AclRuleSet serialize(AclRuleSet aclRuleSet) {
- final var builder = Acl.AclRuleSet.newBuilder();
-
- final var name = aclRuleSet.getName();
- final var type = aclRuleSet.getType();
- final var description = aclRuleSet.getDescription();
- final var userId = aclRuleSet.getUserId();
- final var entries = aclRuleSet.getEntries();
-
- final var serializedType = serialize(type);
- final var serializedEntries =
- entries.stream().map(this::serialize).collect(Collectors.toList());
-
- builder.setName(name);
- builder.setType(serializedType);
- builder.setDescription(description);
- builder.setUserId(userId);
- builder.addAllEntries(serializedEntries);
-
- return builder.build();
- }
-
- public AclRuleSet deserialize(Acl.AclRuleSet serializedAclRuleSet) {
- final var serializedName = serializedAclRuleSet.getName();
- final var serializedType = serializedAclRuleSet.getType();
- final var serializedDescription = serializedAclRuleSet.getDescription();
- final var serializedUserId = serializedAclRuleSet.getUserId();
- final var serializedEntries = serializedAclRuleSet.getEntriesList();
-
- final var type = deserialize(serializedType);
- final var entries =
- serializedEntries.stream().map(this::deserialize).collect(Collectors.toList());
-
- return new AclRuleSet(serializedName, type, serializedDescription, serializedUserId, entries);
- }
-
- public ConfigRule_ACL serialize(ConfigRuleAcl configRuleAcl) {
- final var builder = ContextOuterClass.ConfigRule_ACL.newBuilder();
-
- final var endPointId = configRuleAcl.getEndPointId();
- final var aclRuleSet = configRuleAcl.getRuleSet();
-
- final var serializedEndPointId = serialize(endPointId);
- final var serializedAclRuleSet = serialize(aclRuleSet);
-
- builder.setEndpointId(serializedEndPointId);
- builder.setRuleSet(serializedAclRuleSet);
-
- return builder.build();
- }
-
- public ConfigRuleAcl deserialize(ConfigRule_ACL serializedConfigRuleAcl) {
- final var serializedEndPointId = serializedConfigRuleAcl.getEndpointId();
- final var serializedAclRuleSet = serializedConfigRuleAcl.getRuleSet();
-
- final var endPointId = deserialize(serializedEndPointId);
- final var aclRuleSet = deserialize(serializedAclRuleSet);
-
- return new ConfigRuleAcl(endPointId, aclRuleSet);
- }
-
- public ConfigRule_Custom serialize(ConfigRuleCustom configRuleCustom) {
- final var builder = ConfigRule_Custom.newBuilder();
-
- final var resourceKey = configRuleCustom.getResourceKey();
- final var resourceValue = configRuleCustom.getResourceValue();
-
- builder.setResourceKey(resourceKey);
- builder.setResourceValue(resourceValue);
-
- return builder.build();
- }
-
- public ConfigRuleCustom deserialize(ConfigRule_Custom serializedConfigRuleCustom) {
- final var serializedResourceKey = serializedConfigRuleCustom.getResourceKey();
- final var serializedResourceValue = serializedConfigRuleCustom.getResourceValue();
-
- return new ConfigRuleCustom(serializedResourceKey, serializedResourceValue);
- }
-
- public ContextOuterClass.ConfigRule serialize(ConfigRule configRule) {
- final var builder = ContextOuterClass.ConfigRule.newBuilder();
-
- final var configActionEnum = configRule.getConfigActionEnum();
- final var configRuleType = configRule.getConfigRuleType();
- final var configRuleTypeSpecificType = configRuleType.getConfigRuleType();
-
- if (configRuleTypeSpecificType instanceof ConfigRuleAcl) {
- final var endPointId = ((ConfigRuleAcl) configRuleTypeSpecificType).getEndPointId();
- final var aclRuleSet = ((ConfigRuleAcl) configRuleTypeSpecificType).getRuleSet();
-
- final var serializedEndPointId = serialize(endPointId);
- final var serializedAclRuleSet = serialize(aclRuleSet);
-
- final var serializedConfigRuleAcl =
- ConfigRule_ACL.newBuilder()
- .setEndpointId(serializedEndPointId)
- .setRuleSet(serializedAclRuleSet)
- .build();
-
- builder.setAcl(serializedConfigRuleAcl);
- }
-
- if (configRuleTypeSpecificType instanceof ConfigRuleCustom) {
- final var configRuleCustomResourceKey =
- ((ConfigRuleCustom) configRuleTypeSpecificType).getResourceKey();
- final var configRuleCustomResourceValue =
- ((ConfigRuleCustom) configRuleTypeSpecificType).getResourceValue();
-
- final var serializedConfigRuleCustom =
- ConfigRule_Custom.newBuilder()
- .setResourceKey(configRuleCustomResourceKey)
- .setResourceValue(configRuleCustomResourceValue)
- .build();
-
- builder.setCustom(serializedConfigRuleCustom);
- }
-
- final var serializedConfigActionEnum = serialize(configActionEnum);
-
- builder.setAction(serializedConfigActionEnum);
-
- return builder.build();
- }
-
- public ConfigRule deserialize(ContextOuterClass.ConfigRule serializedConfigRule) {
- final var serializedConfigActionEnum = serializedConfigRule.getAction();
- final var typeOfConfigRule = serializedConfigRule.getConfigRuleCase();
-
- final var configActionEnum = deserialize(serializedConfigActionEnum);
-
- switch (typeOfConfigRule) {
- case ACL:
- final var serializedConfigRuleAcl = serializedConfigRule.getAcl();
-
- final var configRuleAcl = deserialize(serializedConfigRuleAcl);
- final var configRuleTypeAcl = new ConfigRuleTypeAcl(configRuleAcl);
-
- return new ConfigRule(configActionEnum, configRuleTypeAcl);
- case CUSTOM:
- final var serializedConfigRuleCustom = serializedConfigRule.getCustom();
-
- final var configRuleCustom = deserialize(serializedConfigRuleCustom);
- final var configRuleTypeCustom = new ConfigRuleTypeCustom(configRuleCustom);
-
- return new ConfigRule(configActionEnum, configRuleTypeCustom);
- default:
- case CONFIGRULE_NOT_SET:
- throw new IllegalStateException("Config Rule not set");
- }
- }
-
- public ContextOuterClass.DeviceConfig serialize(DeviceConfig deviceConfig) {
- final var builder = ContextOuterClass.DeviceConfig.newBuilder();
-
- final var serializedConfigRules =
- deviceConfig.getConfigRules().stream().map(this::serialize).collect(Collectors.toList());
- builder.addAllConfigRules(serializedConfigRules);
-
- return builder.build();
- }
-
- public DeviceConfig deserialize(ContextOuterClass.DeviceConfig deviceConfig) {
- final var configRules =
- deviceConfig.getConfigRulesList().stream()
- .map(this::deserialize)
- .collect(Collectors.toList());
-
- return new DeviceConfig(configRules);
- }
-
- public ContextOuterClass.DeviceOperationalStatusEnum serialize(DeviceOperationalStatus opStatus) {
- switch (opStatus) {
- case ENABLED:
- return DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_ENABLED;
- case DISABLED:
- return DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_DISABLED;
- case UNDEFINED:
- default:
- return DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_UNDEFINED;
- }
- }
-
- public DeviceOperationalStatus deserialize(
- ContextOuterClass.DeviceOperationalStatusEnum opStatus) {
- switch (opStatus) {
- case DEVICEOPERATIONALSTATUS_ENABLED:
- return DeviceOperationalStatus.ENABLED;
- case DEVICEOPERATIONALSTATUS_DISABLED:
- return DeviceOperationalStatus.DISABLED;
- case DEVICEOPERATIONALSTATUS_UNDEFINED:
- case UNRECOGNIZED:
- default:
- return DeviceOperationalStatus.UNDEFINED;
- }
- }
-
- public KpiSampleTypes.KpiSampleType serialize(KpiSampleType kpiSampleType) {
- switch (kpiSampleType) {
- case PACKETS_TRANSMITTED:
- return KpiSampleTypes.KpiSampleType.KPISAMPLETYPE_PACKETS_TRANSMITTED;
- case PACKETS_RECEIVED:
- return KpiSampleTypes.KpiSampleType.KPISAMPLETYPE_PACKETS_RECEIVED;
- case BYTES_TRANSMITTED:
- return KpiSampleTypes.KpiSampleType.KPISAMPLETYPE_BYTES_TRANSMITTED;
- case BYTES_RECEIVED:
- return KpiSampleTypes.KpiSampleType.KPISAMPLETYPE_BYTES_RECEIVED;
- case UNKNOWN:
- return KpiSampleTypes.KpiSampleType.KPISAMPLETYPE_UNKNOWN;
- default:
- return KpiSampleTypes.KpiSampleType.UNRECOGNIZED;
- }
- }
-
- public KpiSampleType deserialize(KpiSampleTypes.KpiSampleType serializedKpiSampleType) {
- switch (serializedKpiSampleType) {
- case KPISAMPLETYPE_PACKETS_TRANSMITTED:
- return KpiSampleType.PACKETS_TRANSMITTED;
- case KPISAMPLETYPE_PACKETS_RECEIVED:
- return KpiSampleType.PACKETS_RECEIVED;
- case KPISAMPLETYPE_BYTES_TRANSMITTED:
- return KpiSampleType.BYTES_TRANSMITTED;
- case KPISAMPLETYPE_BYTES_RECEIVED:
- return KpiSampleType.BYTES_RECEIVED;
- case KPISAMPLETYPE_UNKNOWN:
- default:
- return KpiSampleType.UNKNOWN;
- }
- }
-
- public ContextOuterClass.Location serialize(Location location) {
- final var builder = ContextOuterClass.Location.newBuilder();
-
- final var locationType = location.getLocationType();
- final var locationTypeSpecificType = locationType.getLocationType();
-
- if (locationTypeSpecificType instanceof GpsPosition) {
- final var latitude = ((GpsPosition) locationTypeSpecificType).getLatitude();
- final var longitude = ((GpsPosition) locationTypeSpecificType).getLongitude();
-
- final var serializedGpsPosition =
- ContextOuterClass.GPS_Position.newBuilder()
- .setLatitude(latitude)
- .setLongitude(longitude)
- .build();
-
- builder.setGpsPosition(serializedGpsPosition);
- }
-
- if (locationTypeSpecificType instanceof String) {
- final var region = ((String) locationTypeSpecificType);
-
- builder.setRegion(region);
- }
-
- return builder.build();
- }
-
- public Location deserialize(ContextOuterClass.Location serializedLocation) {
- final var typeOfLocation = serializedLocation.getLocationCase();
-
- switch (typeOfLocation) {
- case REGION:
- final var region = serializedLocation.getRegion();
- final var locationTypeRegion = new LocationTypeRegion(region);
-
- return new Location(locationTypeRegion);
- case GPS_POSITION:
- final var serializedGpsPosition = serializedLocation.getGpsPosition();
- final var latitude = serializedGpsPosition.getLatitude();
- final var longitude = serializedGpsPosition.getLongitude();
-
- final var gpsPosition = new GpsPosition(latitude, longitude);
- final var locationTypeGpsPosition = new LocationTypeGpsPosition(gpsPosition);
-
- return new Location(locationTypeGpsPosition);
- default:
- case LOCATION_NOT_SET:
- throw new IllegalStateException("Location value not set");
- }
- }
-
- public ContextOuterClass.DeviceDriverEnum serialize(DeviceDriverEnum deviceDriverEnum) {
- switch (deviceDriverEnum) {
- case OPENCONFIG:
- return ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_OPENCONFIG;
- case TRANSPORT_API:
- return ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_TRANSPORT_API;
- case P4:
- return ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_P4;
- case IETF_NETWORK_TOPOLOGY:
- return ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_IETF_NETWORK_TOPOLOGY;
- case ONF_TR_352:
- return ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_ONF_TR_352;
- case XR:
- return ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_XR;
- case IETF_L2VPN:
- return ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_IETF_L2VPN;
- case UNDEFINED:
- default:
- return ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_UNDEFINED;
- }
- }
-
- public DeviceDriverEnum deserialize(
- ContextOuterClass.DeviceDriverEnum serializedDeviceDriverEnum) {
- switch (serializedDeviceDriverEnum) {
- case DEVICEDRIVER_OPENCONFIG:
- return DeviceDriverEnum.OPENCONFIG;
- case DEVICEDRIVER_TRANSPORT_API:
- return DeviceDriverEnum.TRANSPORT_API;
- case DEVICEDRIVER_P4:
- return DeviceDriverEnum.P4;
- case DEVICEDRIVER_IETF_NETWORK_TOPOLOGY:
- return DeviceDriverEnum.IETF_NETWORK_TOPOLOGY;
- case DEVICEDRIVER_ONF_TR_352:
- return DeviceDriverEnum.ONF_TR_352;
- case DEVICEDRIVER_XR:
- return DeviceDriverEnum.XR;
- case DEVICEDRIVER_IETF_L2VPN:
- return DeviceDriverEnum.IETF_L2VPN;
- case DEVICEDRIVER_UNDEFINED:
- case UNRECOGNIZED:
- default:
- return DeviceDriverEnum.UNDEFINED;
- }
- }
-
- public ContextOuterClass.EndPoint serialize(EndPoint endPoint) {
- final var builder = ContextOuterClass.EndPoint.newBuilder();
-
- final var endPointId = endPoint.getEndPointId();
- final var endPointType = endPoint.getEndPointType();
- final var kpiSampleTypes = endPoint.getKpiSampleTypes();
- final var endPointLocation = endPoint.getEndPointLocation();
-
- final var serializedEndPointId = serialize(endPointId);
- final var serializedKpiSampleTypes =
- kpiSampleTypes.stream().map(this::serialize).collect(Collectors.toList());
- if (endPointLocation != null) {
- final var serializedEndPointLocation = serialize(endPointLocation);
- builder.setEndpointLocation(serializedEndPointLocation);
- }
-
- builder.setEndpointId(serializedEndPointId);
- builder.setEndpointType(endPointType);
- builder.addAllKpiSampleTypes(serializedKpiSampleTypes);
-
- return builder.build();
- }
-
- public EndPoint deserialize(ContextOuterClass.EndPoint serializedEndPoint) {
- final var serializedEndPointId = serializedEndPoint.getEndpointId();
- final var endPointType = serializedEndPoint.getEndpointType();
- final var serializedKpiSampleTypes = serializedEndPoint.getKpiSampleTypesList();
- final var serializedEndPointLocation = serializedEndPoint.getEndpointLocation();
-
- final var endPointId = deserialize(serializedEndPointId);
- final var kpiSampleTypes =
- serializedKpiSampleTypes.stream().map(this::deserialize).collect(Collectors.toList());
-
- if (serializedEndPointLocation.getLocationCase() != LocationCase.LOCATION_NOT_SET) {
- final var endPointLocation = deserialize(serializedEndPointLocation);
- return new EndPoint.EndPointBuilder(endPointId, endPointType, kpiSampleTypes)
- .location(endPointLocation)
- .build();
- }
-
- return new EndPoint.EndPointBuilder(endPointId, endPointType, kpiSampleTypes).build();
- }
-
- public ContextOuterClass.Device serialize(Device device) {
- final var builder = ContextOuterClass.Device.newBuilder();
-
- final var deviceIdUuid = serializeUuid(device.getDeviceId());
- final var deviceId = DeviceId.newBuilder().setDeviceUuid(deviceIdUuid);
- final var deviceName = device.getDeviceName();
- final var deviceType = device.getDeviceType();
- final var deviceConfig = device.getDeviceConfig();
- final var deviceOperationalStatus = device.getDeviceOperationalStatus();
- final var deviceDrivers = device.getDeviceDrivers();
- final var deviceEndPoints = device.getEndPoints();
-
- final var serializedDeviceConfig = serialize(deviceConfig);
- final var serializedDeviceOperationalStatus = serialize(deviceOperationalStatus);
- final var serializedDeviceDrivers =
- deviceDrivers.stream().map(this::serialize).collect(Collectors.toList());
- final var serializedDeviceEndPoints =
- deviceEndPoints.stream().map(this::serialize).collect(Collectors.toList());
-
- builder.setDeviceId(deviceId);
- builder.setName(deviceName);
- builder.setDeviceType(deviceType);
- builder.setDeviceConfig(serializedDeviceConfig);
- builder.setDeviceOperationalStatus(serializedDeviceOperationalStatus);
- builder.addAllDeviceDrivers(serializedDeviceDrivers);
- builder.addAllDeviceEndpoints(serializedDeviceEndPoints);
-
- return builder.build();
- }
-
- public Device deserialize(ContextOuterClass.Device device) {
-
- final var serializedDeviceId = device.getDeviceId();
- final var deviceName = device.getName();
- final var deviceType = device.getDeviceType();
- final var serializedDeviceConfig = device.getDeviceConfig();
- final var serializedDeviceOperationalStatus = device.getDeviceOperationalStatus();
- final var serializedDeviceDrivers = device.getDeviceDriversList();
- final var serializedDeviceEndPoints = device.getDeviceEndpointsList();
-
- final var deviceId = deserialize(serializedDeviceId);
- final var deviceConfig = deserialize(serializedDeviceConfig);
- final var deviceOperationalStatus = deserialize(serializedDeviceOperationalStatus);
- final var deviceDrivers =
- serializedDeviceDrivers.stream().map(this::deserialize).collect(Collectors.toList());
- final var deviceEndPoints =
- serializedDeviceEndPoints.stream().map(this::deserialize).collect(Collectors.toList());
-
- return new Device(
- deviceId,
- deviceName,
- deviceType,
- deviceConfig,
- deviceOperationalStatus,
- deviceDrivers,
- deviceEndPoints);
- }
-
- public ContextOuterClass.Empty serializeEmpty(Empty empty) {
-
- final var builder = ContextOuterClass.Empty.newBuilder();
-
- return builder.build();
- }
-
- public Empty deserializeEmpty(ContextOuterClass.Empty serializedEmpty) {
- return new Empty();
- }
-
- public Uuid serializeUuid(String uuid) {
- return Uuid.newBuilder().setUuid(uuid).build();
- }
-
- public String deserialize(Uuid uuid) {
- return uuid.getUuid();
- }
-}
diff --git a/src/automation/src/main/java/eu/teraflow/automation/SimpleLivenessCheck.java b/src/automation/src/main/java/eu/teraflow/automation/SimpleLivenessCheck.java
deleted file mode 100644
index 7b7a3b0753dc8591fd44d800495ec80f822a4f93..0000000000000000000000000000000000000000
--- a/src/automation/src/main/java/eu/teraflow/automation/SimpleLivenessCheck.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
-* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package eu.teraflow.automation;
-
-import javax.enterprise.context.ApplicationScoped;
-import org.eclipse.microprofile.health.HealthCheck;
-import org.eclipse.microprofile.health.HealthCheckResponse;
-import org.eclipse.microprofile.health.Liveness;
-
-@Liveness
-@ApplicationScoped
-public class SimpleLivenessCheck implements HealthCheck {
-
- @Override
- public HealthCheckResponse call() {
- return HealthCheckResponse.up("Automation Service is live");
- }
-}
diff --git a/src/automation/src/main/java/eu/teraflow/automation/SimpleReadinessCheck.java b/src/automation/src/main/java/eu/teraflow/automation/SimpleReadinessCheck.java
deleted file mode 100644
index c9fd4855b7a2e9f5853b7cd9fbea5d896560723e..0000000000000000000000000000000000000000
--- a/src/automation/src/main/java/eu/teraflow/automation/SimpleReadinessCheck.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
-* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package eu.teraflow.automation;
-
-import javax.enterprise.context.ApplicationScoped;
-import org.eclipse.microprofile.health.HealthCheck;
-import org.eclipse.microprofile.health.HealthCheckResponse;
-import org.eclipse.microprofile.health.Readiness;
-
-@Readiness
-@ApplicationScoped
-public class SimpleReadinessCheck implements HealthCheck {
-
- @Override
- public HealthCheckResponse call() {
-
- return HealthCheckResponse.up("Automation Service is ready");
- }
-}
diff --git a/src/automation/src/main/java/eu/teraflow/automation/acl/AclAction.java b/src/automation/src/main/java/eu/teraflow/automation/acl/AclAction.java
deleted file mode 100644
index 29109f15bbb288697b837f69d85cf5d365c83319..0000000000000000000000000000000000000000
--- a/src/automation/src/main/java/eu/teraflow/automation/acl/AclAction.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
-* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package eu.teraflow.automation.acl;
-
-public class AclAction {
-
- private final AclForwardActionEnum aclForwardActionEnum;
- private final AclLogActionEnum aclLogActionEnum;
-
- public AclAction(AclForwardActionEnum aclForwardActionEnum, AclLogActionEnum aclLogActionEnum) {
- this.aclForwardActionEnum = aclForwardActionEnum;
- this.aclLogActionEnum = aclLogActionEnum;
- }
-
- public AclForwardActionEnum getAclForwardActionEnum() {
- return aclForwardActionEnum;
- }
-
- public AclLogActionEnum getAclLogActionEnum() {
- return aclLogActionEnum;
- }
-
- @Override
- public String toString() {
- return String.format(
- "%s:{aclForwardActionEnum:\"%s\", aclLogActionEnum:\"%s\"}",
- getClass().getSimpleName(), aclForwardActionEnum.toString(), aclLogActionEnum.toString());
- }
-}
diff --git a/src/automation/src/main/java/eu/teraflow/automation/acl/AclEntry.java b/src/automation/src/main/java/eu/teraflow/automation/acl/AclEntry.java
deleted file mode 100644
index 6cecdd553d811587e9126bf323ce8019b57fc071..0000000000000000000000000000000000000000
--- a/src/automation/src/main/java/eu/teraflow/automation/acl/AclEntry.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
-* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package eu.teraflow.automation.acl;
-
-public class AclEntry {
-
- private final int sequenceId;
- private final String description;
- private final AclMatch match;
- private final AclAction action;
-
- public AclEntry(int sequenceId, String description, AclMatch match, AclAction action) {
- this.sequenceId = sequenceId;
- this.description = description;
- this.match = match;
- this.action = action;
- }
-
- public int getSequenceId() {
- return sequenceId;
- }
-
- public String getDescription() {
- return description;
- }
-
- public AclMatch getMatch() {
- return match;
- }
-
- public AclAction getAction() {
- return action;
- }
-
- @Override
- public String toString() {
- return String.format(
- "%s:{sequenceId:\"%d\", description:\"%s\", %s, %s}",
- getClass().getSimpleName(), sequenceId, description, match, action);
- }
-}
diff --git a/src/automation/src/main/java/eu/teraflow/automation/acl/AclForwardActionEnum.java b/src/automation/src/main/java/eu/teraflow/automation/acl/AclForwardActionEnum.java
deleted file mode 100644
index e136a52fe259d67df2a5f9ee2c70a4e15f9d6034..0000000000000000000000000000000000000000
--- a/src/automation/src/main/java/eu/teraflow/automation/acl/AclForwardActionEnum.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
-* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package eu.teraflow.automation.acl;
-
-public enum AclForwardActionEnum {
- UNDEFINED,
- DROP,
- ACCEPT,
- REJECT,
-}
diff --git a/src/automation/src/main/java/eu/teraflow/automation/acl/AclLogActionEnum.java b/src/automation/src/main/java/eu/teraflow/automation/acl/AclLogActionEnum.java
deleted file mode 100644
index 1baf1c4a94a8fd806f5b05548fa0cd9fe4eaf3c5..0000000000000000000000000000000000000000
--- a/src/automation/src/main/java/eu/teraflow/automation/acl/AclLogActionEnum.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
-* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package eu.teraflow.automation.acl;
-
-public enum AclLogActionEnum {
- UNDEFINED,
- NO_LOG,
- SYSLOG
-}
diff --git a/src/automation/src/main/java/eu/teraflow/automation/acl/AclMatch.java b/src/automation/src/main/java/eu/teraflow/automation/acl/AclMatch.java
deleted file mode 100644
index fa9eecf9f46493587c7b5573cbaca71f2865da09..0000000000000000000000000000000000000000
--- a/src/automation/src/main/java/eu/teraflow/automation/acl/AclMatch.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
-* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package eu.teraflow.automation.acl;
-
-public class AclMatch {
-
- private final int dscp;
- private final int protocol;
- private final String srcAddress;
- private final String dstAddress;
- private final int srcPort;
- private final int dstPort;
- private final int startMplsLabel;
- private final int endMplsLabel;
-
- public AclMatch(
- int dscp,
- int protocol,
- String srcAddress,
- String dstAddress,
- int srcPort,
- int dstPort,
- int startMplsLabel,
- int endMplsLabel) {
- this.dscp = dscp;
- this.protocol = protocol;
- this.srcAddress = srcAddress;
- this.dstAddress = dstAddress;
- this.srcPort = srcPort;
- this.dstPort = dstPort;
- this.startMplsLabel = startMplsLabel;
- this.endMplsLabel = endMplsLabel;
- }
-
- public int getDscp() {
- return dscp;
- }
-
- public int getProtocol() {
- return protocol;
- }
-
- public String getSrcAddress() {
- return srcAddress;
- }
-
- public String getDstAddress() {
- return dstAddress;
- }
-
- public int getSrcPort() {
- return srcPort;
- }
-
- public int getDstPort() {
- return dstPort;
- }
-
- public int getStartMplsLabel() {
- return startMplsLabel;
- }
-
- public int getEndMplsLabel() {
- return endMplsLabel;
- }
-
- @Override
- public String toString() {
- return String.format(
- "%s:{dscp:\"%d\", protocol:\"%d\", srcAddress:\"%s\", dstAddress:\"%s\", srcPort:\"%d\", dstPort:\"%d\", startMplsLabel:\"%d\", endMplsLabel:\"%d\"}",
- getClass().getSimpleName(),
- dscp,
- protocol,
- srcAddress,
- dstAddress,
- srcPort,
- dstPort,
- startMplsLabel,
- endMplsLabel);
- }
-}
diff --git a/src/automation/src/main/java/eu/teraflow/automation/acl/AclRuleSet.java b/src/automation/src/main/java/eu/teraflow/automation/acl/AclRuleSet.java
deleted file mode 100644
index 9cf3a08f0d2fac9eb3033accbaa31ad14dc93598..0000000000000000000000000000000000000000
--- a/src/automation/src/main/java/eu/teraflow/automation/acl/AclRuleSet.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package eu.teraflow.automation.acl;
-
-import eu.teraflow.automation.common.Util;
-import java.util.List;
-
-public class AclRuleSet {
-
- private final String name;
- private final AclRuleTypeEnum type;
- private final String description;
- private final String userId;
- private final List entries;
-
- public AclRuleSet(
- String name,
- AclRuleTypeEnum type,
- String description,
- String userId,
- List entries) {
- this.name = name;
- this.type = type;
- this.description = description;
- this.userId = userId;
- this.entries = entries;
- }
-
- public String getName() {
- return name;
- }
-
- public AclRuleTypeEnum getType() {
- return type;
- }
-
- public String getDescription() {
- return description;
- }
-
- public String getUserId() {
- return userId;
- }
-
- public List getEntries() {
- return entries;
- }
-
- @Override
- public String toString() {
- return String.format(
- "%s:{name:\"%s\", type:\"%s\", description:\"%s\", userId:\"%s\", [%s]}",
- getClass().getSimpleName(),
- name,
- type.toString(),
- description,
- userId,
- Util.toString(entries));
- }
-}
diff --git a/src/automation/src/main/java/eu/teraflow/automation/acl/AclRuleTypeEnum.java b/src/automation/src/main/java/eu/teraflow/automation/acl/AclRuleTypeEnum.java
deleted file mode 100644
index f573721470e00dcba844961d65e4c79f83be4ffc..0000000000000000000000000000000000000000
--- a/src/automation/src/main/java/eu/teraflow/automation/acl/AclRuleTypeEnum.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
-* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package eu.teraflow.automation.acl;
-
-public enum AclRuleTypeEnum {
- UNDEFINED,
- IPV4,
- IPV6,
- L2,
- MPLS,
- MIXED
-}
diff --git a/src/automation/src/main/java/eu/teraflow/automation/common/Util.java b/src/automation/src/main/java/eu/teraflow/automation/common/Util.java
deleted file mode 100644
index aca4654578b6644d4e0566768255dbcc64b819af..0000000000000000000000000000000000000000
--- a/src/automation/src/main/java/eu/teraflow/automation/common/Util.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
-* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package eu.teraflow.automation.common;
-
-import java.util.List;
-import java.util.stream.Collectors;
-
-public class Util {
-
- private Util() {}
-
- public static String toString(List list) {
- return list.stream().map(T::toString).collect(Collectors.joining(", "));
- }
-}
diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/ContextGateway.java b/src/automation/src/main/java/eu/teraflow/automation/context/ContextGateway.java
deleted file mode 100644
index 8171b2225a6703e43b752c7306c2cb837628c8fc..0000000000000000000000000000000000000000
--- a/src/automation/src/main/java/eu/teraflow/automation/context/ContextGateway.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
-* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package eu.teraflow.automation.context;
-
-import eu.teraflow.automation.context.model.Device;
-import eu.teraflow.automation.context.model.DeviceEvent;
-import io.smallrye.mutiny.Multi;
-import io.smallrye.mutiny.Uni;
-
-public interface ContextGateway {
-
- Uni getDevice(String deviceId);
-
- Multi getDeviceEvents();
-}
diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/ContextGatewayImpl.java b/src/automation/src/main/java/eu/teraflow/automation/context/ContextGatewayImpl.java
deleted file mode 100644
index 6868f9175cc966d1c476c3cb5ad4f2e31d3d6516..0000000000000000000000000000000000000000
--- a/src/automation/src/main/java/eu/teraflow/automation/context/ContextGatewayImpl.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
-* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package eu.teraflow.automation.context;
-
-import context.ContextOuterClass;
-import context.MutinyContextServiceGrpc.MutinyContextServiceStub;
-import eu.teraflow.automation.Serializer;
-import eu.teraflow.automation.context.model.Device;
-import eu.teraflow.automation.context.model.DeviceEvent;
-import io.quarkus.grpc.GrpcClient;
-import io.smallrye.mutiny.Multi;
-import io.smallrye.mutiny.Uni;
-import javax.enterprise.context.ApplicationScoped;
-import javax.inject.Inject;
-
-@ApplicationScoped
-public class ContextGatewayImpl implements ContextGateway {
-
- @GrpcClient("context")
- MutinyContextServiceStub streamingDelegateContext;
-
- private final Serializer serializer;
-
- @Inject
- public ContextGatewayImpl(Serializer serializer) {
- this.serializer = serializer;
- }
-
- @Override
- public Multi getDeviceEvents() {
- final var serializedEmpty = ContextOuterClass.Empty.newBuilder().build();
-
- return streamingDelegateContext
- .getDeviceEvents(serializedEmpty)
- .onItem()
- .transform(serializer::deserialize);
- }
-
- @Override
- public Uni getDevice(String deviceId) {
- final var serializedDeviceId = serializer.serializeDeviceId(deviceId);
-
- return streamingDelegateContext
- .getDevice(serializedDeviceId)
- .onItem()
- .transform(serializer::deserialize);
- }
-}
diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/ContextService.java b/src/automation/src/main/java/eu/teraflow/automation/context/ContextService.java
deleted file mode 100644
index 8c3caf27a96c0efe875b5cb04839a7a6ef4f6ec1..0000000000000000000000000000000000000000
--- a/src/automation/src/main/java/eu/teraflow/automation/context/ContextService.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
-* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package eu.teraflow.automation.context;
-
-import eu.teraflow.automation.context.model.Device;
-import eu.teraflow.automation.context.model.DeviceEvent;
-import io.smallrye.mutiny.Multi;
-import io.smallrye.mutiny.Uni;
-
-public interface ContextService {
-
- Uni getDevice(String deviceId);
-
- Multi getDeviceEvents();
-}
diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/ContextServiceImpl.java b/src/automation/src/main/java/eu/teraflow/automation/context/ContextServiceImpl.java
deleted file mode 100644
index 4ec973ac75f752174036dd65df712ec28c52306a..0000000000000000000000000000000000000000
--- a/src/automation/src/main/java/eu/teraflow/automation/context/ContextServiceImpl.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
-* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package eu.teraflow.automation.context;
-
-import eu.teraflow.automation.context.model.Device;
-import eu.teraflow.automation.context.model.DeviceEvent;
-import io.smallrye.mutiny.Multi;
-import io.smallrye.mutiny.Uni;
-import javax.enterprise.context.ApplicationScoped;
-import javax.inject.Inject;
-
-@ApplicationScoped
-public class ContextServiceImpl implements ContextService {
-
- private final ContextGateway contextGateway;
-
- @Inject
- public ContextServiceImpl(ContextGateway contextGateway) {
- this.contextGateway = contextGateway;
- }
-
- @Override
- public Uni getDevice(String deviceId) {
- return contextGateway.getDevice(deviceId);
- }
-
- @Override
- public Multi getDeviceEvents() {
- return contextGateway.getDeviceEvents();
- }
-}
diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigActionEnum.java b/src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigActionEnum.java
deleted file mode 100644
index 7ec48e8896374e3d8daa918da9b4646adb6f3e41..0000000000000000000000000000000000000000
--- a/src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigActionEnum.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
-* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package eu.teraflow.automation.context.model;
-
-public enum ConfigActionEnum {
- UNDEFINED,
- SET,
- DELETE
-}
diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigRule.java b/src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigRule.java
deleted file mode 100644
index 5825bd4983ce9a8bf02b5db7eaa416245c7f4052..0000000000000000000000000000000000000000
--- a/src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigRule.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
-* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package eu.teraflow.automation.context.model;
-
-public class ConfigRule {
-
- private final ConfigActionEnum configActionEnum;
- private final ConfigRuleType> configRuleType;
-
- public ConfigRule(ConfigActionEnum configActionEnum, ConfigRuleType> configRuleType) {
- this.configActionEnum = configActionEnum;
- this.configRuleType = configRuleType;
- }
-
- public ConfigActionEnum getConfigActionEnum() {
- return configActionEnum;
- }
-
- public ConfigRuleType getConfigRuleType() {
- return configRuleType;
- }
-
- @Override
- public String toString() {
- return String.format(
- "%s:{configActionEnum:\"%s\", %s}",
- getClass().getSimpleName(), configActionEnum, configRuleType);
- }
-}
diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigRuleAcl.java b/src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigRuleAcl.java
deleted file mode 100644
index 774427abdb230bd3c6a99250a99d986a21ce3cc3..0000000000000000000000000000000000000000
--- a/src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigRuleAcl.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
-* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package eu.teraflow.automation.context.model;
-
-import eu.teraflow.automation.acl.AclRuleSet;
-
-public class ConfigRuleAcl {
-
- private final EndPointId endPointId;
- private final AclRuleSet ruleSet;
-
- public ConfigRuleAcl(EndPointId endPointId, AclRuleSet ruleSet) {
- this.endPointId = endPointId;
- this.ruleSet = ruleSet;
- }
-
- public EndPointId getEndPointId() {
- return endPointId;
- }
-
- public AclRuleSet getRuleSet() {
- return ruleSet;
- }
-
- @Override
- public String toString() {
- return String.format("%s:{%s, %s}", getClass().getSimpleName(), endPointId, ruleSet);
- }
-}
diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigRuleCustom.java b/src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigRuleCustom.java
deleted file mode 100644
index 316ebc74b72a83c93ab2c2fcf890b136043aa823..0000000000000000000000000000000000000000
--- a/src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigRuleCustom.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
-* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package eu.teraflow.automation.context.model;
-
-public class ConfigRuleCustom {
-
- private final String resourceKey;
- private final String resourceValue;
-
- public ConfigRuleCustom(String resourceKey, String resourceValue) {
- this.resourceKey = resourceKey;
- this.resourceValue = resourceValue;
- }
-
- public String getResourceKey() {
- return resourceKey;
- }
-
- public String getResourceValue() {
- return resourceValue;
- }
-
- @Override
- public String toString() {
- return String.format("%s:{%s, %s}", getClass().getSimpleName(), resourceKey, resourceValue);
- }
-}
diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigRuleType.java b/src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigRuleType.java
deleted file mode 100644
index 2554709251e70ba18ae4362e7aa44933510e587f..0000000000000000000000000000000000000000
--- a/src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigRuleType.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
-* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package eu.teraflow.automation.context.model;
-
-public interface ConfigRuleType {
-
- public T getConfigRuleType();
-}
diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigRuleTypeAcl.java b/src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigRuleTypeAcl.java
deleted file mode 100644
index f10d17bc8e54458023c1588c5015586308d3c55d..0000000000000000000000000000000000000000
--- a/src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigRuleTypeAcl.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
-* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package eu.teraflow.automation.context.model;
-
-public class ConfigRuleTypeAcl implements ConfigRuleType {
-
- private final ConfigRuleAcl configRuleAcl;
-
- public ConfigRuleTypeAcl(ConfigRuleAcl configRuleAcl) {
- this.configRuleAcl = configRuleAcl;
- }
-
- @Override
- public ConfigRuleAcl getConfigRuleType() {
- return this.configRuleAcl;
- }
-
- @Override
- public String toString() {
- return String.format("%s:%s}", getClass().getSimpleName(), configRuleAcl);
- }
-}
diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigRuleTypeCustom.java b/src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigRuleTypeCustom.java
deleted file mode 100644
index 759bb92c7fdc3ca861be34e63f8ade5bc385584a..0000000000000000000000000000000000000000
--- a/src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigRuleTypeCustom.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
-* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package eu.teraflow.automation.context.model;
-
-public class ConfigRuleTypeCustom implements ConfigRuleType {
-
- private final ConfigRuleCustom configRuleCustom;
-
- public ConfigRuleTypeCustom(ConfigRuleCustom configRuleCustom) {
- this.configRuleCustom = configRuleCustom;
- }
-
- @Override
- public ConfigRuleCustom getConfigRuleType() {
- return this.configRuleCustom;
- }
-
- @Override
- public String toString() {
- return String.format("%s:%s}", getClass().getSimpleName(), configRuleCustom);
- }
-}
diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/Device.java b/src/automation/src/main/java/eu/teraflow/automation/context/model/Device.java
deleted file mode 100644
index b3d1836e3c4f494900281ef8a4cb505fa7761dca..0000000000000000000000000000000000000000
--- a/src/automation/src/main/java/eu/teraflow/automation/context/model/Device.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
-* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package eu.teraflow.automation.context.model;
-
-import eu.teraflow.automation.common.Util;
-import java.util.List;
-
-public class Device {
-
- private final String deviceId;
- private final String deviceName;
- private final String deviceType;
- private DeviceConfig deviceConfig;
- private DeviceOperationalStatus deviceOperationalStatus;
- private List deviceDrivers;
- private List endPoints;
-
- public Device(
- String deviceId,
- String deviceName,
- String deviceType,
- DeviceConfig deviceConfig,
- DeviceOperationalStatus deviceOperationalStatus,
- List deviceDrivers,
- List endPoints) {
-
- this.deviceId = deviceId;
- this.deviceName = deviceName;
- this.deviceType = deviceType;
- this.deviceConfig = deviceConfig;
- this.deviceOperationalStatus = deviceOperationalStatus;
- this.deviceDrivers = deviceDrivers;
- this.endPoints = endPoints;
- }
-
- public Device(
- String deviceId,
- String deviceName,
- String deviceType,
- DeviceOperationalStatus deviceOperationalStatus,
- List deviceDrivers,
- List endPoints) {
- this.deviceId = deviceId;
- this.deviceName = deviceName;
- this.deviceType = deviceType;
- this.deviceOperationalStatus = deviceOperationalStatus;
- this.deviceDrivers = deviceDrivers;
- this.endPoints = endPoints;
- }
-
- public boolean isEnabled() {
- return deviceOperationalStatus == DeviceOperationalStatus.ENABLED;
- }
-
- public boolean isDisabled() {
- return deviceOperationalStatus == DeviceOperationalStatus.DISABLED;
- }
-
- public void enableDevice() {
- this.deviceOperationalStatus = DeviceOperationalStatus.ENABLED;
- }
-
- public void disableDevice() {
- this.deviceOperationalStatus = DeviceOperationalStatus.DISABLED;
- }
-
- public String getDeviceId() {
- return deviceId;
- }
-
- public String getDeviceName() {
- return deviceName;
- }
-
- public String getDeviceType() {
- return deviceType;
- }
-
- public DeviceConfig getDeviceConfig() {
- return deviceConfig;
- }
-
- public List getDeviceDrivers() {
- return deviceDrivers;
- }
-
- public List getEndPoints() {
- return endPoints;
- }
-
- public DeviceOperationalStatus getDeviceOperationalStatus() {
- return deviceOperationalStatus;
- }
-
- public void setDeviceConfiguration(DeviceConfig deviceConfig) {
- this.deviceConfig = deviceConfig;
- }
-
- @Override
- public String toString() {
- return String.format(
- "%s:{deviceId:\"%s\", deviceName:\"%s\", deviceType:\"%s\", %s, deviceOperationalStatus=\"%s\", [%s], [%s]}",
- getClass().getSimpleName(),
- deviceId,
- deviceName,
- deviceType,
- deviceConfig,
- deviceOperationalStatus.toString(),
- Util.toString(deviceDrivers),
- Util.toString(endPoints));
- }
-}
diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/DeviceConfig.java b/src/automation/src/main/java/eu/teraflow/automation/context/model/DeviceConfig.java
deleted file mode 100644
index 0341ab0720c3fe22257575b6151086b5c908c437..0000000000000000000000000000000000000000
--- a/src/automation/src/main/java/eu/teraflow/automation/context/model/DeviceConfig.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
-* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package eu.teraflow.automation.context.model;
-
-import java.util.List;
-import java.util.stream.Collectors;
-
-public class DeviceConfig {
-
- private final List configRules;
-
- public DeviceConfig(List configRules) {
-
- this.configRules = configRules;
- }
-
- public List getConfigRules() {
- return configRules;
- }
-
- @Override
- public String toString() {
- final var configRulesDescription =
- configRules.stream().map(ConfigRule::toString).collect(Collectors.joining(", "));
- return String.format("%s[%s]", getClass().getSimpleName(), configRulesDescription);
- }
-}
diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/DeviceDriverEnum.java b/src/automation/src/main/java/eu/teraflow/automation/context/model/DeviceDriverEnum.java
deleted file mode 100644
index 3a26937e79d0df2cfead305a10ccadf3c54eae89..0000000000000000000000000000000000000000
--- a/src/automation/src/main/java/eu/teraflow/automation/context/model/DeviceDriverEnum.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
-* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package eu.teraflow.automation.context.model;
-
-public enum DeviceDriverEnum {
- UNDEFINED,
- OPENCONFIG,
- TRANSPORT_API,
- P4,
- IETF_NETWORK_TOPOLOGY,
- ONF_TR_352,
- XR,
- IETF_L2VPN
-}
diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/DeviceOperationalStatus.java b/src/automation/src/main/java/eu/teraflow/automation/context/model/DeviceOperationalStatus.java
deleted file mode 100644
index 0a5afaf2455acf28fa5591feb6c23d5f3d33692c..0000000000000000000000000000000000000000
--- a/src/automation/src/main/java/eu/teraflow/automation/context/model/DeviceOperationalStatus.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
-* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package eu.teraflow.automation.context.model;
-
-public enum DeviceOperationalStatus {
- UNDEFINED,
- DISABLED,
- ENABLED
-}
diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/Empty.java b/src/automation/src/main/java/eu/teraflow/automation/context/model/Empty.java
deleted file mode 100644
index e503665e4146d5966b75979b9b0133b41d65e421..0000000000000000000000000000000000000000
--- a/src/automation/src/main/java/eu/teraflow/automation/context/model/Empty.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
-* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package eu.teraflow.automation.context.model;
-
-public class Empty {
-
- public Empty() {
- // Empty constructor to represent the Empty rpc message of context service
- }
-}
diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/EndPoint.java b/src/automation/src/main/java/eu/teraflow/automation/context/model/EndPoint.java
deleted file mode 100644
index c91f1d9c56967ea3a7b31e66193c0d0dbb9541d3..0000000000000000000000000000000000000000
--- a/src/automation/src/main/java/eu/teraflow/automation/context/model/EndPoint.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
-* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package eu.teraflow.automation.context.model;
-
-import eu.teraflow.automation.common.Util;
-import eu.teraflow.automation.kpi_sample_types.model.KpiSampleType;
-import java.util.List;
-
-public class EndPoint {
- private final EndPointId endPointId;
- private final String endPointType;
- private final List kpiSampleTypes;
- private final Location endPointLocation;
-
- EndPoint(EndPointBuilder builder) {
- this.endPointId = builder.endPointId;
- this.endPointType = builder.endPointType;
- this.kpiSampleTypes = builder.kpiSampleTypes;
- this.endPointLocation = builder.endPointLocation;
- }
-
- public EndPointId getEndPointId() {
- return endPointId;
- }
-
- public String getEndPointType() {
- return endPointType;
- }
-
- public List getKpiSampleTypes() {
- return kpiSampleTypes;
- }
-
- public Location getEndPointLocation() {
- return endPointLocation;
- }
-
- @Override
- public String toString() {
- return String.format(
- "%s:{%s, endPointType:\"%s\", [%s], %s}",
- getClass().getSimpleName(),
- endPointId,
- endPointType,
- Util.toString(kpiSampleTypes),
- endPointLocation);
- }
-
- public static class EndPointBuilder {
- private final EndPointId endPointId;
- private final String endPointType;
- private final List kpiSampleTypes;
- private Location endPointLocation;
-
- public EndPointBuilder(
- EndPointId endPointId, String endPointType, List kpiSampleTypes) {
- this.endPointId = endPointId;
- this.endPointType = endPointType;
- this.kpiSampleTypes = kpiSampleTypes;
- }
-
- public EndPointBuilder location(Location endPointLocation) {
- this.endPointLocation = endPointLocation;
- return this;
- }
-
- public EndPoint build() {
- EndPoint endPoint = new EndPoint(this);
- validateEndPointObject(endPoint);
- return endPoint;
- }
-
- private void validateEndPointObject(EndPoint endPoint) {
- final var validatedEndPointId = endPoint.getEndPointId();
- final var validatedEndPointType = endPoint.getEndPointType();
- final var validatedKpiSampleTypes = endPoint.getKpiSampleTypes();
-
- if (validatedEndPointId == null) {
- throw new IllegalStateException("EndPoint ID cannot be null");
- }
-
- if (validatedEndPointType == null) {
- throw new IllegalStateException("EndPoint type cannot be null");
- }
-
- if (validatedKpiSampleTypes == null) {
- throw new IllegalStateException("Kpi sample types cannot be null");
- }
- }
- }
-}
diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/EndPointId.java b/src/automation/src/main/java/eu/teraflow/automation/context/model/EndPointId.java
deleted file mode 100644
index 516c8289246565a86e2a59fe80dbe4b1505c5463..0000000000000000000000000000000000000000
--- a/src/automation/src/main/java/eu/teraflow/automation/context/model/EndPointId.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
-* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package eu.teraflow.automation.context.model;
-
-public class EndPointId {
-
- private final TopologyId topologyId;
- private final String deviceId;
- private final String id;
-
- public EndPointId(TopologyId topologyId, String deviceId, String id) {
- this.topologyId = topologyId;
- this.deviceId = deviceId;
- this.id = id;
- }
-
- public TopologyId getTopologyId() {
- return topologyId;
- }
-
- public String getDeviceId() {
- return deviceId;
- }
-
- public String getId() {
- return id;
- }
-
- @Override
- public String toString() {
- return String.format(
- "%s:{%s, deviceId:\"%s\", id:\"%s\"}",
- getClass().getSimpleName(), topologyId, deviceId, id);
- }
-}
diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/Event.java b/src/automation/src/main/java/eu/teraflow/automation/context/model/Event.java
deleted file mode 100644
index 9e4ca9abc0b1062c951aa7170dd83bc046bc8514..0000000000000000000000000000000000000000
--- a/src/automation/src/main/java/eu/teraflow/automation/context/model/Event.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
-* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package eu.teraflow.automation.context.model;
-
-public class Event {
-
- // TODO convert double to meaningful timestamp type
- private final double timestamp;
- private final EventTypeEnum eventType;
-
- public Event(double timestamp, EventTypeEnum eventType) {
- this.timestamp = timestamp;
- this.eventType = eventType;
- }
-
- public double getTimestamp() {
- return timestamp;
- }
-
- public EventTypeEnum getEventTypeEnum() {
- return eventType;
- }
-
- @Override
- public String toString() {
- return String.format(
- "%s{timestamp=\"%f\", eventType=\"%s\"}",
- getClass().getSimpleName(), timestamp, eventType.toString());
- }
-}
diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/EventTypeEnum.java b/src/automation/src/main/java/eu/teraflow/automation/context/model/EventTypeEnum.java
deleted file mode 100644
index c20f9dfd59de812096a1b85e7dc908e5059eb246..0000000000000000000000000000000000000000
--- a/src/automation/src/main/java/eu/teraflow/automation/context/model/EventTypeEnum.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
-* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package eu.teraflow.automation.context.model;
-
-public enum EventTypeEnum {
- UNDEFINED,
- CREATE,
- UPDATE,
- REMOVE
-}
diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/GpsPosition.java b/src/automation/src/main/java/eu/teraflow/automation/context/model/GpsPosition.java
deleted file mode 100644
index 38a111f89fc79e0d11f15eedf2a8ca5a0ba35e89..0000000000000000000000000000000000000000
--- a/src/automation/src/main/java/eu/teraflow/automation/context/model/GpsPosition.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
-* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package eu.teraflow.automation.context.model;
-
-public class GpsPosition {
-
- private final float latitude;
- private final float longitude;
-
- public GpsPosition(float latitude, float longitude) {
- this.latitude = latitude;
- this.longitude = longitude;
- }
-
- public float getLatitude() {
- return latitude;
- }
-
- public float getLongitude() {
- return longitude;
- }
-
- @Override
- public String toString() {
- return String.format(
- "%s:{latitude:\"%f\", longitude:\"%f\"}", getClass().getSimpleName(), latitude, longitude);
- }
-}
diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/Location.java b/src/automation/src/main/java/eu/teraflow/automation/context/model/Location.java
deleted file mode 100644
index a16715e13cbb2b70f3c729b03ec164f9f52142ce..0000000000000000000000000000000000000000
--- a/src/automation/src/main/java/eu/teraflow/automation/context/model/Location.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
-* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package eu.teraflow.automation.context.model;
-
-public class Location {
-
- private final LocationType> locationType;
-
- public Location(LocationType> locationType) {
- this.locationType = locationType;
- }
-
- public LocationType getLocationType() {
- return locationType;
- }
-
- @Override
- public String toString() {
- return String.format("%s:{%s}", getClass().getSimpleName(), locationType);
- }
-}
diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/LocationType.java b/src/automation/src/main/java/eu/teraflow/automation/context/model/LocationType.java
deleted file mode 100644
index a50594a511005c67ee206f84f9c840324cb2bac6..0000000000000000000000000000000000000000
--- a/src/automation/src/main/java/eu/teraflow/automation/context/model/LocationType.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
-* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package eu.teraflow.automation.context.model;
-
-public interface LocationType {
-
- public T getLocationType();
-}
diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/LocationTypeGpsPosition.java b/src/automation/src/main/java/eu/teraflow/automation/context/model/LocationTypeGpsPosition.java
deleted file mode 100644
index e512444aa7b7a4575936e3a00a2a9c4a8a051f1a..0000000000000000000000000000000000000000
--- a/src/automation/src/main/java/eu/teraflow/automation/context/model/LocationTypeGpsPosition.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
-* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package eu.teraflow.automation.context.model;
-
-public class LocationTypeGpsPosition implements LocationType {
- private final GpsPosition gpsPosition;
-
- public LocationTypeGpsPosition(GpsPosition gpsPosition) {
- this.gpsPosition = gpsPosition;
- }
-
- @Override
- public GpsPosition getLocationType() {
- return this.gpsPosition;
- }
-
- @Override
- public String toString() {
- return String.format("%s:{%s}", getClass().getSimpleName(), gpsPosition);
- }
-}
diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/LocationTypeRegion.java b/src/automation/src/main/java/eu/teraflow/automation/context/model/LocationTypeRegion.java
deleted file mode 100644
index 28b448ca3e8682f39a140e7d347e6dbe20f7db35..0000000000000000000000000000000000000000
--- a/src/automation/src/main/java/eu/teraflow/automation/context/model/LocationTypeRegion.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
-* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package eu.teraflow.automation.context.model;
-
-public class LocationTypeRegion implements LocationType {
- private final String region;
-
- public LocationTypeRegion(String region) {
- this.region = region;
- }
-
- @Override
- public String getLocationType() {
- return this.region;
- }
-
- @Override
- public String toString() {
- return String.format("%s:{region:\"%s\"}", getClass().getSimpleName(), region);
- }
-}
diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/TopologyId.java b/src/automation/src/main/java/eu/teraflow/automation/context/model/TopologyId.java
deleted file mode 100644
index 07e8daed7fce328b5ea31ab2f9f3cb17abbd9525..0000000000000000000000000000000000000000
--- a/src/automation/src/main/java/eu/teraflow/automation/context/model/TopologyId.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
-* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package eu.teraflow.automation.context.model;
-
-public class TopologyId {
-
- private final String contextId;
- private final String id;
-
- public TopologyId(String contextId, String id) {
-
- this.contextId = contextId;
- this.id = id;
- }
-
- public String getContextId() {
- return contextId;
- }
-
- public String getId() {
- return id;
- }
-
- @Override
- public String toString() {
- return String.format(
- "%s:{contextId:\"%s\", id:\"%s\"}", getClass().getSimpleName(), contextId, id);
- }
-}
diff --git a/src/automation/src/main/java/eu/teraflow/automation/device/DeviceGateway.java b/src/automation/src/main/java/eu/teraflow/automation/device/DeviceGateway.java
deleted file mode 100644
index c25c96c97ca5bb31b0125b9df3210a181a2ea0fb..0000000000000000000000000000000000000000
--- a/src/automation/src/main/java/eu/teraflow/automation/device/DeviceGateway.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
-* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package eu.teraflow.automation.device;
-
-import eu.teraflow.automation.context.model.Device;
-import eu.teraflow.automation.context.model.DeviceConfig;
-import eu.teraflow.automation.context.model.Empty;
-import io.smallrye.mutiny.Uni;
-
-public interface DeviceGateway {
- Uni getInitialConfiguration(String deviceId);
-
- Uni configureDevice(Device device);
-
- Uni deleteDevice(String deviceId);
-}
diff --git a/src/automation/src/main/java/eu/teraflow/automation/device/DeviceGatewayImpl.java b/src/automation/src/main/java/eu/teraflow/automation/device/DeviceGatewayImpl.java
deleted file mode 100644
index 5e3d63f86477c11dbc6bbaa314172912b9b31da3..0000000000000000000000000000000000000000
--- a/src/automation/src/main/java/eu/teraflow/automation/device/DeviceGatewayImpl.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
-* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package eu.teraflow.automation.device;
-
-import device.DeviceService;
-import eu.teraflow.automation.Serializer;
-import eu.teraflow.automation.context.model.Device;
-import eu.teraflow.automation.context.model.DeviceConfig;
-import eu.teraflow.automation.context.model.Empty;
-import io.quarkus.grpc.GrpcClient;
-import io.smallrye.mutiny.Uni;
-import javax.enterprise.context.ApplicationScoped;
-import javax.inject.Inject;
-
-@ApplicationScoped
-public class DeviceGatewayImpl implements DeviceGateway {
-
- @GrpcClient("device")
- DeviceService deviceDelegate;
-
- private final Serializer serializer;
-
- @Inject
- public DeviceGatewayImpl(Serializer serializer) {
- this.serializer = serializer;
- }
-
- @Override
- public Uni getInitialConfiguration(String deviceId) {
- final var serializedDeviceId = serializer.serializeDeviceId(deviceId);
-
- return deviceDelegate
- .getInitialConfig(serializedDeviceId)
- .onItem()
- .transform(serializer::deserialize);
- }
-
- @Override
- public Uni configureDevice(Device device) {
- final var serializedDevice = serializer.serialize(device);
-
- return deviceDelegate
- .configureDevice(serializedDevice)
- .onItem()
- .transform(serializer::deserialize);
- }
-
- @Override
- public Uni deleteDevice(String deviceId) {
- final var serializedDeviceId = serializer.serializeDeviceId(deviceId);
-
- return deviceDelegate
- .deleteDevice(serializedDeviceId)
- .onItem()
- .transform(serializer::deserializeEmpty);
- }
-}
diff --git a/src/automation/src/main/java/eu/teraflow/automation/device/DeviceService.java b/src/automation/src/main/java/eu/teraflow/automation/device/DeviceService.java
deleted file mode 100644
index b41257d4a360f47f9a037a462726b31eba11f127..0000000000000000000000000000000000000000
--- a/src/automation/src/main/java/eu/teraflow/automation/device/DeviceService.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
-* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package eu.teraflow.automation.device;
-
-import eu.teraflow.automation.context.model.Device;
-import eu.teraflow.automation.context.model.DeviceConfig;
-import eu.teraflow.automation.context.model.Empty;
-import io.smallrye.mutiny.Uni;
-
-public interface DeviceService {
-
- Uni getInitialConfiguration(String deviceId);
-
- Uni configureDevice(Device device);
-
- Uni deleteDevice(String deviceId);
-}
diff --git a/src/automation/src/main/java/eu/teraflow/automation/device/DeviceServiceImpl.java b/src/automation/src/main/java/eu/teraflow/automation/device/DeviceServiceImpl.java
deleted file mode 100644
index 97b142427988d08ff56025e29b6e7ec6c17cd7b7..0000000000000000000000000000000000000000
--- a/src/automation/src/main/java/eu/teraflow/automation/device/DeviceServiceImpl.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
-* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package eu.teraflow.automation.device;
-
-import eu.teraflow.automation.context.model.Device;
-import eu.teraflow.automation.context.model.DeviceConfig;
-import eu.teraflow.automation.context.model.Empty;
-import io.smallrye.mutiny.Uni;
-import javax.enterprise.context.ApplicationScoped;
-import javax.inject.Inject;
-
-@ApplicationScoped
-public class DeviceServiceImpl implements DeviceService {
-
- private final DeviceGateway deviceGateway;
-
- @Inject
- public DeviceServiceImpl(DeviceGateway deviceGateway) {
- this.deviceGateway = deviceGateway;
- }
-
- @Override
- public Uni getInitialConfiguration(String deviceId) {
-
- return deviceGateway.getInitialConfiguration(deviceId);
- }
-
- @Override
- public Uni configureDevice(Device device) {
-
- return deviceGateway.configureDevice(device);
- }
-
- @Override
- public Uni deleteDevice(String deviceId) {
- return deviceGateway.deleteDevice(deviceId);
- }
-}
diff --git a/src/automation/src/main/java/eu/teraflow/automation/kpi_sample_types/model/KpiSampleType.java b/src/automation/src/main/java/eu/teraflow/automation/kpi_sample_types/model/KpiSampleType.java
deleted file mode 100644
index 49c7e0559b4b34635c347002417a7f19e43d91b7..0000000000000000000000000000000000000000
--- a/src/automation/src/main/java/eu/teraflow/automation/kpi_sample_types/model/KpiSampleType.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
-* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package eu.teraflow.automation.kpi_sample_types.model;
-
-public enum KpiSampleType {
- UNKNOWN,
- PACKETS_TRANSMITTED,
- PACKETS_RECEIVED,
- BYTES_TRANSMITTED,
- BYTES_RECEIVED
-}
diff --git a/src/automation/src/main/proto/automation.proto b/src/automation/src/main/proto/automation.proto
deleted file mode 120000
index afef7a8e47ec5688ec46498c2197bc345e6c5e92..0000000000000000000000000000000000000000
--- a/src/automation/src/main/proto/automation.proto
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../proto/automation.proto
\ No newline at end of file
diff --git a/src/automation/src/main/resources/teraflow-automation-banner.txt b/src/automation/src/main/resources/teraflow-automation-banner.txt
deleted file mode 100644
index 3792524170f5b74de9add7340ab32940d7f65a64..0000000000000000000000000000000000000000
--- a/src/automation/src/main/resources/teraflow-automation-banner.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-
- _______ ______ _ _ _ _
- |__ __| | ____| | /\ | | | | (_)
- | | ___ _ __ __ _| |__ | | _____ __ / \ _ _| |_ ___ _ __ ___ __ _| |_ _ ___ _ __
- | |/ _ \ '__/ _` | __| | |/ _ \ \ /\ / / / /\ \| | | | __/ _ \| '_ ` _ \ / _` | __| |/ _ \| '_ \
- | | __/ | | (_| | | | | (_) \ V V / / ____ \ |_| | || (_) | | | | | | (_| | |_| | (_) | | | |
- |_|\___|_| \__,_|_| |_|\___/ \_/\_/ /_/ \_\__,_|\__\___/|_| |_| |_|\__,_|\__|_|\___/|_| |_|
-
-
diff --git a/src/automation/src/test/java/eu/teraflow/automation/AutomationFunctionalServiceTest.java b/src/automation/src/test/java/eu/teraflow/automation/AutomationFunctionalServiceTest.java
deleted file mode 100644
index d7e3917fc84537ebd2256262e148e1762ef0c96c..0000000000000000000000000000000000000000
--- a/src/automation/src/test/java/eu/teraflow/automation/AutomationFunctionalServiceTest.java
+++ /dev/null
@@ -1,393 +0,0 @@
-/*
-* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package eu.teraflow.automation;
-
-import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
-
-import automation.Automation;
-import context.ContextOuterClass;
-import eu.teraflow.automation.context.ContextGateway;
-import eu.teraflow.automation.context.model.ConfigActionEnum;
-import eu.teraflow.automation.context.model.ConfigRule;
-import eu.teraflow.automation.context.model.ConfigRuleCustom;
-import eu.teraflow.automation.context.model.ConfigRuleTypeCustom;
-import eu.teraflow.automation.context.model.Device;
-import eu.teraflow.automation.context.model.DeviceConfig;
-import eu.teraflow.automation.context.model.DeviceDriverEnum;
-import eu.teraflow.automation.context.model.DeviceOperationalStatus;
-import eu.teraflow.automation.context.model.EndPoint.EndPointBuilder;
-import eu.teraflow.automation.context.model.EndPointId;
-import eu.teraflow.automation.context.model.Location;
-import eu.teraflow.automation.context.model.LocationTypeRegion;
-import eu.teraflow.automation.context.model.TopologyId;
-import eu.teraflow.automation.device.DeviceGateway;
-import eu.teraflow.automation.kpi_sample_types.model.KpiSampleType;
-import io.quarkus.test.junit.QuarkusTest;
-import io.quarkus.test.junit.mockito.InjectMock;
-import io.smallrye.mutiny.Uni;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.UUID;
-import javax.inject.Inject;
-import org.assertj.core.api.Assertions;
-import org.jboss.logging.Logger;
-import org.junit.jupiter.api.Test;
-import org.mockito.Mockito;
-
-@QuarkusTest
-class AutomationFunctionalServiceTest {
- private static final Logger LOGGER = Logger.getLogger(AutomationFunctionalServiceTest.class);
-
- @Inject AutomationService automationService;
-
- @InjectMock DeviceGateway deviceGateway;
- @InjectMock ContextGateway contextGateway;
-
- @Test
- void shouldConfigureDevice() {
- final var uuidForDeviceRoleId =
- ContextOuterClass.Uuid.newBuilder()
- .setUuid(UUID.fromString("0f14d0ab-9608-7862-a9e4-5ed26688389b").toString())
- .build();
-
- final var uuidForDeviceId =
- ContextOuterClass.Uuid.newBuilder()
- .setUuid(UUID.fromString("9f14d0ab-9608-7862-a9e4-5ed26688389c").toString())
- .build();
-
- final var outDeviceId =
- ContextOuterClass.DeviceId.newBuilder().setDeviceUuid(uuidForDeviceId).build();
-
- final var outDeviceRoleId =
- Automation.DeviceRoleId.newBuilder()
- .setDevRoleId(uuidForDeviceRoleId)
- .setDevId(outDeviceId)
- .build();
-
- String deviceId = outDeviceRoleId.getDevRoleId().toString();
- String deviceName = "deviceName";
- String deviceType = "cisco";
-
- final var configRuleCustomA = new ConfigRuleCustom("resourceKeyA", "resourceValueA");
- final var configRuleTypeA = new ConfigRuleTypeCustom(configRuleCustomA);
- ConfigRule configRule1 = new ConfigRule(ConfigActionEnum.UNDEFINED, configRuleTypeA);
-
- final var configRuleCustomB = new ConfigRuleCustom("resourceKeyB", "resourceValueB");
- final var configRuleTypeB = new ConfigRuleTypeCustom(configRuleCustomB);
- ConfigRule configRule2 = new ConfigRule(ConfigActionEnum.SET, configRuleTypeB);
-
- List configRuleList = new ArrayList<>();
- configRuleList.add(configRule1);
- configRuleList.add(configRule2);
-
- DeviceConfig expectedDeviceConfig = new DeviceConfig(configRuleList);
- Uni expectedDeviceConfigUni = Uni.createFrom().item(expectedDeviceConfig);
- Uni expectedDeviceId = Uni.createFrom().item(deviceId);
-
- final var deviceDrivers = List.of(DeviceDriverEnum.IETF_NETWORK_TOPOLOGY, DeviceDriverEnum.P4);
-
- final var topologyIdA = new TopologyId("contextIdA", "idA");
- final var deviceIdA = "deviceIdA";
- final var idA = "idA";
- final var endPointIdA = new EndPointId(topologyIdA, deviceIdA, idA);
-
- final var endPointTypeA = "endPointTypeA";
- final var kpiSampleTypesA =
- List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED);
- final var locationTypeRegionA = new LocationTypeRegion("ATH");
- final var locationA = new Location(locationTypeRegionA);
- final var endPointA =
- new EndPointBuilder(endPointIdA, endPointTypeA, kpiSampleTypesA)
- .location(locationA)
- .build();
-
- final var topologyIdB = new TopologyId("contextIdB", "idB");
- final var deviceIdB = "deviceIdB";
- final var idB = "idB";
- final var endPointIdB = new EndPointId(topologyIdB, deviceIdB, idB);
- final var endPointTypeB = "endPointTypeB";
- final var kpiSampleTypesB =
- List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED);
- final var locationTypeRegionB = new LocationTypeRegion("ATH");
- final var locationB = new Location(locationTypeRegionB);
- final var endPointB =
- new EndPointBuilder(endPointIdB, endPointTypeB, kpiSampleTypesB)
- .location(locationB)
- .build();
-
- final var endPoints = List.of(endPointA, endPointB);
-
- Device device =
- new Device(
- deviceId,
- deviceName,
- deviceType,
- DeviceOperationalStatus.DISABLED,
- deviceDrivers,
- endPoints);
- Uni deviceUni = Uni.createFrom().item(device);
-
- Mockito.when(contextGateway.getDevice(Mockito.any())).thenReturn(deviceUni);
- Mockito.when(deviceGateway.getInitialConfiguration(Mockito.any()))
- .thenReturn(expectedDeviceConfigUni);
- Mockito.when(deviceGateway.configureDevice(Mockito.any())).thenReturn(expectedDeviceId);
-
- final var currentDevice = automationService.addDevice(deviceId);
-
- Assertions.assertThat(currentDevice).isNotNull();
- currentDevice
- .subscribe()
- .with(
- deviceConfig -> {
- LOGGER.infof("Received response %s", deviceConfig);
-
- assertThat(deviceConfig).hasToString(device.getDeviceOperationalStatus().toString());
-
- assertThat(deviceConfig.getDeviceConfig().toString()).isNotNull();
-
- final var rulesList = deviceConfig.getDeviceConfig().getConfigRules();
-
- for (int i = 0; i < rulesList.size(); i++) {
-
- if (rulesList.get(i).getConfigRuleType().getConfigRuleType()
- instanceof ConfigRuleCustom) {
- assertThat(
- ((ConfigRuleCustom)
- rulesList.get(i).getConfigRuleType().getConfigRuleType())
- .getResourceKey())
- .isEqualTo(String.valueOf(i + 1));
- assertThat(
- ((ConfigRuleCustom)
- rulesList.get(i).getConfigRuleType().getConfigRuleType())
- .getResourceValue())
- .isEqualTo(String.valueOf(i + 1));
- }
- }
- assertThat(deviceConfig.getDeviceType()).isEqualTo("cisco");
- assertThat(deviceConfig.getDeviceId()).isEqualTo(deviceId);
- });
- }
-
- @Test
- void shouldNotConfigureDevice() {
-
- final var uuidForDeviceRoleId =
- ContextOuterClass.Uuid.newBuilder()
- .setUuid(UUID.fromString("2f14d0ab-9608-7862-a9e4-5ed26688389f").toString())
- .build();
-
- final var uuidForDeviceId =
- ContextOuterClass.Uuid.newBuilder()
- .setUuid(UUID.fromString("3f14d0ab-9608-7862-a9e4-5ed26688389d").toString())
- .build();
-
- final var outDeviceId =
- ContextOuterClass.DeviceId.newBuilder().setDeviceUuid(uuidForDeviceId).build();
-
- final var outDeviceRoleId =
- Automation.DeviceRoleId.newBuilder()
- .setDevRoleId(uuidForDeviceRoleId)
- .setDevId(outDeviceId)
- .build();
-
- String deviceId = outDeviceRoleId.getDevId().toString();
- String deviceName = "deviceName";
- String deviceType = "ztp";
-
- List configRuleList = new ArrayList<>();
-
- final var configRuleCustom = new ConfigRuleCustom("resourceKey", "resourceValue");
- final var configRuleType = new ConfigRuleTypeCustom(configRuleCustom);
-
- ConfigRule expectedConfigRule = new ConfigRule(ConfigActionEnum.UNDEFINED, configRuleType);
- configRuleList.add(expectedConfigRule);
-
- DeviceConfig expectedDeviceConfig = new DeviceConfig(configRuleList);
-
- final var deviceDrivers = List.of(DeviceDriverEnum.IETF_NETWORK_TOPOLOGY, DeviceDriverEnum.P4);
-
- final var topologyIdA = new TopologyId("contextIdA", "idA");
- final var deviceIdA = "deviceIdA";
- final var idA = "idA";
- final var endPointIdA = new EndPointId(topologyIdA, deviceIdA, idA);
-
- final var endPointTypeA = "endPointTypeA";
- final var kpiSampleTypesA =
- List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED);
- final var locationTypeRegionA = new LocationTypeRegion("ATH");
- final var locationA = new Location(locationTypeRegionA);
- final var endPointA =
- new EndPointBuilder(endPointIdA, endPointTypeA, kpiSampleTypesA)
- .location(locationA)
- .build();
-
- final var topologyIdB = new TopologyId("contextIdB", "idB");
- final var deviceIdB = "deviceIdB";
- final var idB = "idB";
- final var endPointIdB = new EndPointId(topologyIdB, deviceIdB, idB);
- final var endPointTypeB = "endPointTypeB";
- final var kpiSampleTypesB =
- List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED);
- final var locationTypeRegionB = new LocationTypeRegion("ATH");
- final var locationB = new Location(locationTypeRegionB);
- final var endPointB =
- new EndPointBuilder(endPointIdB, endPointTypeB, kpiSampleTypesB)
- .location(locationB)
- .build();
-
- final var endPoints = List.of(endPointA, endPointB);
-
- Device device =
- new Device(
- deviceId,
- deviceName,
- deviceType,
- expectedDeviceConfig,
- DeviceOperationalStatus.ENABLED,
- deviceDrivers,
- endPoints);
-
- Uni deviceUni = Uni.createFrom().item(device);
-
- Mockito.when(contextGateway.getDevice(Mockito.any())).thenReturn(deviceUni);
-
- final var currentDevice = automationService.addDevice(deviceId);
-
- Assertions.assertThat(currentDevice).isNotNull();
-
- currentDevice
- .subscribe()
- .with(
- deviceConfig -> {
- LOGGER.infof("Received response %s", deviceConfig);
-
- assertThat(deviceConfig).hasToString(device.getDeviceOperationalStatus().toString());
-
- assertThat(deviceConfig.getDeviceConfig().toString()).isNotNull();
-
- final var rulesList = deviceConfig.getDeviceConfig().getConfigRules();
-
- for (ConfigRule configRule : rulesList) {
- if (configRule.getConfigRuleType().getConfigRuleType()
- instanceof ConfigRuleCustom) {
-
- if (expectedConfigRule.getConfigRuleType().getConfigRuleType()
- instanceof ConfigRuleCustom) {
- assertThat(
- ((ConfigRuleCustom) configRule.getConfigRuleType().getConfigRuleType())
- .getResourceKey())
- .isEqualTo(
- ((ConfigRuleCustom)
- expectedConfigRule.getConfigRuleType().getConfigRuleType())
- .getResourceKey());
- assertThat(
- ((ConfigRuleCustom) configRule.getConfigRuleType().getConfigRuleType())
- .getResourceValue())
- .isEqualTo(
- ((ConfigRuleCustom)
- expectedConfigRule.getConfigRuleType().getConfigRuleType())
- .getResourceValue());
- }
- }
- }
- assertThat(deviceConfig.getDeviceType()).isEqualTo("ztp");
- assertThat(deviceConfig.getDeviceId()).isEqualTo(deviceId);
- });
- }
-
- @Test
- void shouldDeleteDevice() {
- final var uuidForDeviceRoleId =
- ContextOuterClass.Uuid.newBuilder()
- .setUuid(UUID.fromString("0f14d0ab-9608-7862-a9e4-5ed26688389b").toString())
- .build();
-
- final var uuidForDeviceId =
- ContextOuterClass.Uuid.newBuilder()
- .setUuid(UUID.fromString("9f14d0ab-9608-7862-a9e4-5ed26688389c").toString())
- .build();
-
- final var outDeviceId =
- ContextOuterClass.DeviceId.newBuilder().setDeviceUuid(uuidForDeviceId).build();
-
- final var outDeviceRoleId =
- Automation.DeviceRoleId.newBuilder()
- .setDevRoleId(uuidForDeviceRoleId)
- .setDevId(outDeviceId)
- .build();
-
- String deviceId = outDeviceRoleId.getDevRoleId().toString();
- String deviceName = "deviceName";
- String deviceType = "cisco";
-
- final var deviceDrivers = List.of(DeviceDriverEnum.IETF_NETWORK_TOPOLOGY, DeviceDriverEnum.P4);
-
- final var topologyIdA = new TopologyId("contextIdA", "idA");
- final var deviceIdA = "deviceIdA";
- final var idA = "idA";
- final var endPointIdA = new EndPointId(topologyIdA, deviceIdA, idA);
-
- final var endPointTypeA = "endPointTypeA";
- final var kpiSampleTypesA =
- List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED);
- final var locationTypeRegionA = new LocationTypeRegion("ATH");
- final var locationA = new Location(locationTypeRegionA);
- final var endPointA =
- new EndPointBuilder(endPointIdA, endPointTypeA, kpiSampleTypesA)
- .location(locationA)
- .build();
-
- final var topologyIdB = new TopologyId("contextIdB", "idB");
- final var deviceIdB = "deviceIdB";
- final var idB = "idB";
- final var endPointIdB = new EndPointId(topologyIdB, deviceIdB, idB);
- final var endPointTypeB = "endPointTypeB";
- final var kpiSampleTypesB =
- List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED);
- final var locationTypeRegionB = new LocationTypeRegion("ATH");
- final var locationB = new Location(locationTypeRegionB);
- final var endPointB =
- new EndPointBuilder(endPointIdB, endPointTypeB, kpiSampleTypesB)
- .location(locationB)
- .build();
-
- final var endPoints = List.of(endPointA, endPointB);
-
- Device device =
- new Device(
- deviceId,
- deviceName,
- deviceType,
- DeviceOperationalStatus.DISABLED,
- deviceDrivers,
- endPoints);
- Uni deviceUni = Uni.createFrom().item(device);
-
- Mockito.when(contextGateway.getDevice(Mockito.any())).thenReturn(deviceUni);
-
- final var deletedDevice = automationService.deleteDevice(deviceId);
-
- Assertions.assertThat(deletedDevice).isNotNull();
-
- deletedDevice
- .subscribe()
- .with(
- removedDevice -> {
- assertThat(removedDevice).isEqualTo(deletedDevice);
- });
- }
-}
diff --git a/src/automation/src/test/java/eu/teraflow/automation/AutomationServiceTest.java b/src/automation/src/test/java/eu/teraflow/automation/AutomationServiceTest.java
deleted file mode 100644
index 7cdca9aed92baaeadfd01a499863d52912dde6c0..0000000000000000000000000000000000000000
--- a/src/automation/src/test/java/eu/teraflow/automation/AutomationServiceTest.java
+++ /dev/null
@@ -1,364 +0,0 @@
-/*
-* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package eu.teraflow.automation;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-import automation.Automation;
-import automation.AutomationService;
-import context.ContextOuterClass;
-import eu.teraflow.automation.context.ContextGateway;
-import eu.teraflow.automation.context.model.ConfigActionEnum;
-import eu.teraflow.automation.context.model.ConfigRule;
-import eu.teraflow.automation.context.model.ConfigRuleCustom;
-import eu.teraflow.automation.context.model.ConfigRuleTypeCustom;
-import eu.teraflow.automation.context.model.Device;
-import eu.teraflow.automation.context.model.DeviceConfig;
-import eu.teraflow.automation.context.model.DeviceDriverEnum;
-import eu.teraflow.automation.context.model.DeviceOperationalStatus;
-import eu.teraflow.automation.context.model.EndPoint.EndPointBuilder;
-import eu.teraflow.automation.context.model.EndPointId;
-import eu.teraflow.automation.context.model.Location;
-import eu.teraflow.automation.context.model.LocationTypeRegion;
-import eu.teraflow.automation.context.model.TopologyId;
-import eu.teraflow.automation.device.DeviceGateway;
-import eu.teraflow.automation.kpi_sample_types.model.KpiSampleType;
-import eu.teraflow.automation.model.DeviceRole;
-import eu.teraflow.automation.model.DeviceRoleConfig;
-import eu.teraflow.automation.model.DeviceRoleId;
-import eu.teraflow.automation.model.DeviceRoleType;
-import io.quarkus.grpc.GrpcClient;
-import io.quarkus.test.junit.QuarkusTest;
-import io.quarkus.test.junit.mockito.InjectMock;
-import io.smallrye.mutiny.Uni;
-import java.util.List;
-import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
-import javax.inject.Inject;
-import org.jboss.logging.Logger;
-import org.junit.jupiter.api.Test;
-import org.mockito.Mockito;
-
-@QuarkusTest
-class AutomationServiceTest {
- private static final Logger LOGGER = Logger.getLogger(AutomationServiceTest.class);
-
- @GrpcClient AutomationService client;
- private final Serializer serializer;
-
- @InjectMock DeviceGateway deviceGateway;
- @InjectMock ContextGateway contextGateway;
-
- @Inject
- AutomationServiceTest(Serializer serializer) {
- this.serializer = serializer;
- }
-
- @Test
- void shouldAddDeviceRole() throws ExecutionException, InterruptedException, TimeoutException {
- final var message = new CompletableFuture<>();
- final var DEVICE_ID = "0f14d0ab-9608-7862-a9e4-5ed26688389b";
- final var DEVICE_ROLE_ID = "0f14d0ab-9608-7862-a9e4-5ed26688389a";
- final var DEVICE_NAME = "deviceNameA";
- final var DEVICE_TYPE = "ztp";
-
- final var deviceDrivers = List.of(DeviceDriverEnum.IETF_NETWORK_TOPOLOGY, DeviceDriverEnum.P4);
-
- final var topologyIdA = new TopologyId("contextIdA", "idA");
- final var deviceIdA = "deviceIdA";
- final var idA = "idA";
- final var endPointIdA = new EndPointId(topologyIdA, deviceIdA, idA);
-
- final var endPointTypeA = "endPointTypeA";
- final var kpiSampleTypesA =
- List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED);
- final var locationTypeRegionA = new LocationTypeRegion("ATH");
- final var locationA = new Location(locationTypeRegionA);
- final var endPointA =
- new EndPointBuilder(endPointIdA, endPointTypeA, kpiSampleTypesA)
- .location(locationA)
- .build();
-
- final var topologyIdB = new TopologyId("contextIdB", "idB");
- final var deviceIdB = "deviceIdB";
- final var idB = "idB";
- final var endPointIdB = new EndPointId(topologyIdB, deviceIdB, idB);
- final var endPointTypeB = "endPointTypeB";
- final var kpiSampleTypesB =
- List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED);
- final var locationTypeRegionB = new LocationTypeRegion("ATH");
- final var locationB = new Location(locationTypeRegionB);
- final var endPointB =
- new EndPointBuilder(endPointIdB, endPointTypeB, kpiSampleTypesB)
- .location(locationB)
- .build();
-
- final var endPoints = List.of(endPointA, endPointB);
-
- final var emptyDeviceConfig = new DeviceConfig(List.of());
- final var disabledDevice =
- new Device(
- DEVICE_ID,
- DEVICE_NAME,
- DEVICE_TYPE,
- emptyDeviceConfig,
- DeviceOperationalStatus.DISABLED,
- deviceDrivers,
- endPoints);
- Mockito.when(contextGateway.getDevice(Mockito.any()))
- .thenReturn(Uni.createFrom().item(disabledDevice));
-
- final var configRuleCustom = new ConfigRuleCustom("resourceKey", "resourceValue");
- final var configRuleType = new ConfigRuleTypeCustom(configRuleCustom);
- final var configRule = new ConfigRule(ConfigActionEnum.SET, configRuleType);
- final var initialDeviceConfig = new DeviceConfig(List.of(configRule));
- Mockito.when(deviceGateway.getInitialConfiguration(Mockito.any()))
- .thenReturn(Uni.createFrom().item(initialDeviceConfig));
-
- Mockito.when(deviceGateway.configureDevice(Mockito.any()))
- .thenReturn(Uni.createFrom().item(DEVICE_ID));
-
- final var deviceRoleId = new DeviceRoleId(DEVICE_ROLE_ID, DEVICE_ID);
- final var deviceRoleType = DeviceRoleType.DEV_OPS;
- final var deviceRole = new DeviceRole(deviceRoleId, deviceRoleType);
- final var serializedDeviceRole = serializer.serialize(deviceRole);
-
- client
- .ztpAdd(serializedDeviceRole)
- .subscribe()
- .with(
- deviceRoleState -> {
- LOGGER.infof("Received %s", deviceRoleState);
- final var devRoleId = deviceRoleState.getDevRoleId();
-
- final var deviceRoleIdUuid = serializer.deserialize(devRoleId);
-
- assertThat(deviceRoleIdUuid.getId()).isEqualTo(DEVICE_ROLE_ID);
-
- final var deviceId = serializer.deserialize(devRoleId.getDevId());
- assertThat(deviceId).isEqualTo(DEVICE_ID);
-
- final var devRoleUuid = serializer.deserialize(devRoleId.getDevRoleId());
- message.complete(devRoleUuid);
- });
- assertThat(message.get(5, TimeUnit.SECONDS)).isEqualTo(DEVICE_ROLE_ID);
- }
-
- @Test
- void shouldUpdateDeviceRole() throws ExecutionException, InterruptedException, TimeoutException {
- CompletableFuture message = new CompletableFuture<>();
-
- final var DEVICE_ID = "0f14d0ab-9608-7862-a9e4-5ed26688389b";
- final var DEVICE_ROLE_ID = "0f14d0ab-9608-7862-a9e4-5ed26688389a";
- final var DEVICE_NAME = "deviceNameA";
- final var DEVICE_TYPE = "ztp";
-
- final var deviceDrivers = List.of(DeviceDriverEnum.IETF_NETWORK_TOPOLOGY, DeviceDriverEnum.P4);
-
- final var topologyIdA = new TopologyId("contextIdA", "idA");
- final var deviceIdA = "deviceIdA";
- final var idA = "idA";
- final var endPointIdA = new EndPointId(topologyIdA, deviceIdA, idA);
-
- final var endPointTypeA = "endPointTypeA";
- final var kpiSampleTypesA =
- List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED);
- final var locationTypeRegionA = new LocationTypeRegion("ATH");
- final var locationA = new Location(locationTypeRegionA);
- final var endPointA =
- new EndPointBuilder(endPointIdA, endPointTypeA, kpiSampleTypesA)
- .location(locationA)
- .build();
-
- final var topologyIdB = new TopologyId("contextIdB", "idB");
- final var deviceIdB = "deviceIdB";
- final var idB = "idB";
- final var endPointIdB = new EndPointId(topologyIdB, deviceIdB, idB);
- final var endPointTypeB = "endPointTypeB";
- final var kpiSampleTypesB =
- List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED);
- final var locationTypeRegionB = new LocationTypeRegion("ATH");
- final var locationB = new Location(locationTypeRegionB);
- final var endPointB =
- new EndPointBuilder(endPointIdB, endPointTypeB, kpiSampleTypesB)
- .location(locationB)
- .build();
-
- final var endPoints = List.of(endPointA, endPointB);
-
- final var emptyDeviceConfig = new DeviceConfig(List.of());
- final var device =
- new Device(
- DEVICE_ID,
- DEVICE_NAME,
- DEVICE_TYPE,
- emptyDeviceConfig,
- DeviceOperationalStatus.ENABLED,
- deviceDrivers,
- endPoints);
- Mockito.when(contextGateway.getDevice(Mockito.any())).thenReturn(Uni.createFrom().item(device));
-
- final var deviceRoleId = new DeviceRoleId(DEVICE_ROLE_ID, DEVICE_ID);
- final var deviceRole = new DeviceRole(deviceRoleId, DeviceRoleType.DEV_OPS);
-
- final var configRuleCustomA = new ConfigRuleCustom("resourceKeyA", "resourceValueA");
- final var configRuleTypeA = new ConfigRuleTypeCustom(configRuleCustomA);
- final var deviceConfig =
- new DeviceConfig(List.of(new ConfigRule(ConfigActionEnum.SET, configRuleTypeA)));
-
- final var deviceRoleConfig = new DeviceRoleConfig(deviceRole, deviceConfig);
- final var serializedDeviceRoleConfig = serializer.serialize(deviceRoleConfig);
-
- client
- .ztpUpdate(serializedDeviceRoleConfig)
- .subscribe()
- .with(
- deviceRoleState -> {
- LOGGER.infof("Received response %s", deviceRoleState);
- message.complete(deviceRoleState.getDevRoleId().toString());
- });
- assertThat(message.get(5, TimeUnit.SECONDS)).contains(DEVICE_ID);
- }
-
- @Test
- void shouldGetDeviceRole() throws ExecutionException, InterruptedException, TimeoutException {
- CompletableFuture message = new CompletableFuture<>();
- final var DEVICE_ID = "0f14d0ab-9608-7862-a9e4-5ed26688389b";
- final var DEVICE_ROLE_ID = "0f14d0ab-9608-7862-a9e4-5ed26688389a";
-
- final var deviceRoleId = new DeviceRoleId(DEVICE_ROLE_ID, DEVICE_ID);
- final var serializeDeviceRoleId = serializer.serialize(deviceRoleId);
-
- client
- .ztpGetDeviceRole(serializeDeviceRoleId)
- .subscribe()
- .with(
- deviceRole -> {
- LOGGER.infof("Received response %s", deviceRole);
- assertThat(deviceRole.getDevRoleId().getDevId().getDeviceUuid().getUuid())
- .isEqualTo(DEVICE_ID);
- message.complete(deviceRole.getDevRoleId().toString());
- });
- assertThat(message.get(5, TimeUnit.SECONDS)).contains(DEVICE_ROLE_ID);
- }
-
- @Test
- void shouldGetAllDeviceRolesByDeviceId()
- throws ExecutionException, InterruptedException, TimeoutException {
- CompletableFuture message = new CompletableFuture<>();
-
- final var deviceId = serializer.serializeDeviceId("0f14d0ab-9605-7862-a9e4-5ed26688389b");
-
- client
- .ztpGetDeviceRolesByDeviceId(deviceId)
- .subscribe()
- .with(
- deviceRoleList -> {
- LOGGER.infof("Received response %s", deviceRoleList);
- message.complete(deviceRoleList.toString());
- });
- assertThat(message.get(5, TimeUnit.SECONDS)).isEmpty();
- }
-
- @Test
- void shouldDeleteDeviceRole() throws ExecutionException, InterruptedException, TimeoutException {
- CompletableFuture message = new CompletableFuture<>();
- final var UUID_VALUE = "0f14d0ab-9605-7862-a9e4-5ed26688389b";
-
- final var uuid = serializer.serializeUuid(UUID_VALUE);
- final var deviceRoleId = Automation.DeviceRoleId.newBuilder().setDevRoleId(uuid).build();
- final var deviceRole = Automation.DeviceRole.newBuilder().setDevRoleId(deviceRoleId).build();
- final var DEVICE_ID = "0f14d0ab-9608-7862-a9e4-5ed26688389b";
- final var DEVICE_ROLE_ID = "0f14d0ab-9608-7862-a9e4-5ed26688389a";
- final var DEVICE_NAME = "deviceNameA";
- final var DEVICE_TYPE = "ztp";
-
- final var deviceDrivers = List.of(DeviceDriverEnum.IETF_NETWORK_TOPOLOGY, DeviceDriverEnum.P4);
-
- final var topologyIdA = new TopologyId("contextIdA", "idA");
- final var deviceIdA = "deviceIdA";
- final var idA = "idA";
- final var endPointIdA = new EndPointId(topologyIdA, deviceIdA, idA);
-
- final var endPointTypeA = "endPointTypeA";
- final var kpiSampleTypesA =
- List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED);
- final var locationTypeRegionA = new LocationTypeRegion("ATH");
- final var locationA = new Location(locationTypeRegionA);
- final var endPointA =
- new EndPointBuilder(endPointIdA, endPointTypeA, kpiSampleTypesA)
- .location(locationA)
- .build();
-
- final var topologyIdB = new TopologyId("contextIdB", "idB");
- final var deviceIdB = "deviceIdB";
- final var idB = "idB";
- final var endPointIdB = new EndPointId(topologyIdB, deviceIdB, idB);
- final var endPointTypeB = "endPointTypeB";
- final var kpiSampleTypesB =
- List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED);
- final var locationTypeRegionB = new LocationTypeRegion("ATH");
- final var locationB = new Location(locationTypeRegionB);
- final var endPointB =
- new EndPointBuilder(endPointIdB, endPointTypeB, kpiSampleTypesB)
- .location(locationB)
- .build();
-
- final var endPoints = List.of(endPointA, endPointB);
-
- final var emptyDeviceConfig = new DeviceConfig(List.of());
- final var device =
- new Device(
- DEVICE_ID,
- DEVICE_NAME,
- DEVICE_TYPE,
- emptyDeviceConfig,
- DeviceOperationalStatus.ENABLED,
- deviceDrivers,
- endPoints);
- Mockito.when(contextGateway.getDevice(Mockito.any())).thenReturn(Uni.createFrom().item(device));
-
- client
- .ztpDelete(deviceRole)
- .subscribe()
- .with(
- deviceRoleState -> {
- LOGGER.infof("Received response %s", deviceRoleState);
- message.complete(deviceRoleState.getDevRoleId().toString());
- });
- assertThat(message.get(5, TimeUnit.SECONDS)).contains(UUID_VALUE);
- }
-
- @Test
- void shouldDeleteAllDevicesRolesByDeviceId()
- throws ExecutionException, InterruptedException, TimeoutException {
- CompletableFuture message = new CompletableFuture<>();
- final var empty = ContextOuterClass.Empty.newBuilder().build();
-
- client
- .ztpDeleteAll(empty)
- .subscribe()
- .with(
- deletionResult -> {
- LOGGER.infof("Received response %s", deletionResult);
- message.complete(deletionResult.toString());
- });
- assertThat(message.get(5, TimeUnit.SECONDS)).isEmpty();
- }
-}
diff --git a/src/automation/src/test/java/eu/teraflow/automation/ConfigRuleTypeTest.java b/src/automation/src/test/java/eu/teraflow/automation/ConfigRuleTypeTest.java
deleted file mode 100644
index 67d4b204499fd93324bba07895149dba890b77c1..0000000000000000000000000000000000000000
--- a/src/automation/src/test/java/eu/teraflow/automation/ConfigRuleTypeTest.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
-* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package eu.teraflow.automation;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-import eu.teraflow.automation.acl.AclAction;
-import eu.teraflow.automation.acl.AclEntry;
-import eu.teraflow.automation.acl.AclForwardActionEnum;
-import eu.teraflow.automation.acl.AclLogActionEnum;
-import eu.teraflow.automation.acl.AclMatch;
-import eu.teraflow.automation.acl.AclRuleSet;
-import eu.teraflow.automation.acl.AclRuleTypeEnum;
-import eu.teraflow.automation.context.model.ConfigRuleAcl;
-import eu.teraflow.automation.context.model.ConfigRuleCustom;
-import eu.teraflow.automation.context.model.ConfigRuleTypeAcl;
-import eu.teraflow.automation.context.model.ConfigRuleTypeCustom;
-import eu.teraflow.automation.context.model.EndPointId;
-import eu.teraflow.automation.context.model.TopologyId;
-import io.quarkus.test.junit.QuarkusTest;
-import java.util.List;
-import org.junit.jupiter.api.Test;
-
-@QuarkusTest
-class ConfigRuleTypeTest {
-
- private AclMatch createAclMatch() {
-
- return new AclMatch(1, 2, "192.168.3.52", "192.168.4.192", 3224, 3845, 5, 10);
- }
-
- private AclAction createAclAction() {
-
- return new AclAction(AclForwardActionEnum.ACCEPT, AclLogActionEnum.SYSLOG);
- }
-
- private AclEntry createAclEntry(AclMatch aclMatch, AclAction aclAction) {
-
- return new AclEntry(1, "aclEntryDescription", aclMatch, aclAction);
- }
-
- @Test
- void shouldExtractConfigRuleCustomFromConfigRuleTypeCustom() {
- final var resourceKey = "resourceKey";
- final var resourceValue = "resourceValue";
-
- final var expectedConfigRuleCustom = new ConfigRuleCustom(resourceKey, resourceValue);
- final var configRuleTypeCustom = new ConfigRuleTypeCustom(expectedConfigRuleCustom);
-
- assertThat(configRuleTypeCustom.getConfigRuleType()).isEqualTo(expectedConfigRuleCustom);
- }
-
- @Test
- void shouldExtractConfigRuleAclFromConfigRuleTypeAcl() {
- final var contextIdUuid = "contextId";
- final var topologyIdUuid = "topologyUuid";
- final var deviceIdUuid = "deviceIdUuid";
- final var endpointIdUuid = "endpointIdUuid";
-
- final var topologyId = new TopologyId(contextIdUuid, topologyIdUuid);
- final var endPointId = new EndPointId(topologyId, deviceIdUuid, endpointIdUuid);
-
- final var aclMatch = createAclMatch();
- final var aclAction = createAclAction();
- final var aclEntry = createAclEntry(aclMatch, aclAction);
-
- final var aclRuleSet =
- new AclRuleSet(
- "aclRuleName", AclRuleTypeEnum.IPV4, "AclRuleDescription", "userId", List.of(aclEntry));
-
- final var expectedConfigRuleAcl = new ConfigRuleAcl(endPointId, aclRuleSet);
- final var configRuleTypeAcl = new ConfigRuleTypeAcl(expectedConfigRuleAcl);
-
- assertThat(configRuleTypeAcl.getConfigRuleType()).isEqualTo(expectedConfigRuleAcl);
- }
-}
diff --git a/src/automation/src/test/java/eu/teraflow/automation/EndPointCreationTest.java b/src/automation/src/test/java/eu/teraflow/automation/EndPointCreationTest.java
deleted file mode 100644
index 7f3d749d1aae851bf2cb446e1309384242b031d7..0000000000000000000000000000000000000000
--- a/src/automation/src/test/java/eu/teraflow/automation/EndPointCreationTest.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
-* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package eu.teraflow.automation;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
-
-import eu.teraflow.automation.context.model.EndPoint;
-import eu.teraflow.automation.context.model.EndPointId;
-import eu.teraflow.automation.context.model.Location;
-import eu.teraflow.automation.context.model.LocationTypeRegion;
-import eu.teraflow.automation.context.model.TopologyId;
-import eu.teraflow.automation.kpi_sample_types.model.KpiSampleType;
-import io.quarkus.test.junit.QuarkusTest;
-import java.util.List;
-import org.junit.jupiter.api.Test;
-
-@QuarkusTest
-class EndPointCreationTest {
-
- @Test
- void shouldCreateEndPointObjectGivenAllAvailableFields() {
- final var expectedTopologyId = new TopologyId("contextId", "id");
- final var expectedDeviceId = "expectedDeviceId";
- final var expectedId = "expectedId";
-
- final var expectedEndPointId = new EndPointId(expectedTopologyId, expectedDeviceId, expectedId);
- final var expectedEndPointType = "expectedEndPointType";
- final var expectedKpiSampleTypes =
- List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED);
-
- final var expectedLocationType = new LocationTypeRegion("ATH");
- final var expectedEndPointLocation = new Location(expectedLocationType);
-
- final var expectedEndPoint =
- new EndPoint.EndPointBuilder(
- expectedEndPointId, expectedEndPointType, expectedKpiSampleTypes)
- .location(expectedEndPointLocation)
- .build();
-
- assertThat(expectedEndPoint.getEndPointId()).isEqualTo(expectedEndPointId);
- assertThat(expectedEndPoint.getEndPointType()).isEqualTo(expectedEndPointType);
- assertThat(expectedEndPoint.getKpiSampleTypes()).isEqualTo(expectedKpiSampleTypes);
- assertThat(expectedEndPoint.getEndPointLocation()).isEqualTo(expectedEndPointLocation);
- }
-
- @Test
- void shouldCreateEndPointObjectGivenAllFieldsExceptFromLocation() {
- final var expectedTopologyId = new TopologyId("contextId", "id");
- final var expectedDeviceId = "expectedDeviceId";
- final var expectedId = "expectedId";
-
- final var expectedEndPointId = new EndPointId(expectedTopologyId, expectedDeviceId, expectedId);
- final var expectedEndPointType = "expectedEndPointType";
- final var expectedKpiSampleTypes =
- List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED);
-
- final var expectedEndPoint =
- new EndPoint.EndPointBuilder(
- expectedEndPointId, expectedEndPointType, expectedKpiSampleTypes)
- .build();
-
- assertThat(expectedEndPoint.getEndPointId()).isEqualTo(expectedEndPointId);
- assertThat(expectedEndPoint.getEndPointType()).isEqualTo(expectedEndPointType);
- assertThat(expectedEndPoint.getKpiSampleTypes()).isEqualTo(expectedKpiSampleTypes);
- }
-
- @Test
- void shouldThrowIllegalStateExceptionDuringCreationOfEndPointObjectUponMissingEndPointId() {
- final var expectedEndPointType = "expectedEndPointType";
- final var expectedKpiSampleTypes =
- List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED);
-
- final var endPoint =
- new EndPoint.EndPointBuilder(null, expectedEndPointType, expectedKpiSampleTypes);
-
- assertThatExceptionOfType(IllegalStateException.class).isThrownBy(endPoint::build);
- }
-
- @Test
- void shouldThrowIllegalStateExceptionDuringCreationOfEndPointObjectUponMissingEndPointType() {
- final var expectedTopologyId = new TopologyId("contextId", "id");
- final var expectedDeviceId = "expectedDeviceId";
- final var expectedId = "expectedId";
-
- final var expectedEndPointId = new EndPointId(expectedTopologyId, expectedDeviceId, expectedId);
- final var expectedKpiSampleTypes =
- List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED);
-
- final var endPoint =
- new EndPoint.EndPointBuilder(expectedEndPointId, null, expectedKpiSampleTypes);
-
- assertThatExceptionOfType(IllegalStateException.class).isThrownBy(endPoint::build);
- }
-
- @Test
- void shouldThrowIllegalStateExceptionDuringCreationOfEndPointObjectUponMissingKpiSampleTypes() {
- final var expectedTopologyId = new TopologyId("contextId", "id");
- final var expectedDeviceId = "expectedDeviceId";
- final var expectedId = "expectedId";
-
- final var expectedEndPointId = new EndPointId(expectedTopologyId, expectedDeviceId, expectedId);
- final var expectedEndPointType = "expectedEndPointType";
-
- final var endPoint =
- new EndPoint.EndPointBuilder(expectedEndPointId, expectedEndPointType, null);
-
- assertThatExceptionOfType(IllegalStateException.class).isThrownBy(endPoint::build);
- }
-}
diff --git a/src/automation/src/test/java/eu/teraflow/automation/LocationTypeTest.java b/src/automation/src/test/java/eu/teraflow/automation/LocationTypeTest.java
deleted file mode 100644
index 8cc2c06126f5cf0e92fd59680390719ff425f411..0000000000000000000000000000000000000000
--- a/src/automation/src/test/java/eu/teraflow/automation/LocationTypeTest.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
-* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package eu.teraflow.automation;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-import eu.teraflow.automation.context.model.GpsPosition;
-import eu.teraflow.automation.context.model.LocationTypeGpsPosition;
-import eu.teraflow.automation.context.model.LocationTypeRegion;
-import io.quarkus.test.junit.QuarkusTest;
-import org.junit.jupiter.api.Test;
-
-@QuarkusTest
-class LocationTypeTest {
-
- @Test
- void shouldExtractRegionFromLocationTypeRegion() {
- final var expectedRegion = "ATH";
-
- final var locationTypeRegion = new LocationTypeRegion(expectedRegion);
-
- assertThat(locationTypeRegion.getLocationType()).isEqualTo(expectedRegion);
- }
-
- @Test
- void shouldExtractLocationGpsPositionFromLocationTypeGpsPosition() {
- final var latitude = 3.99f;
- final var longitude = 77.32f;
-
- final var expectedLocationGpsPosition = new GpsPosition(latitude, longitude);
- final var locationTypeGpsPosition = new LocationTypeGpsPosition(expectedLocationGpsPosition);
-
- assertThat(locationTypeGpsPosition.getLocationType()).isEqualTo(expectedLocationGpsPosition);
- }
-}
diff --git a/src/automation/src/test/java/eu/teraflow/automation/MockAutomationConfiguration.java b/src/automation/src/test/java/eu/teraflow/automation/MockAutomationConfiguration.java
deleted file mode 100644
index 94110ebbcd8826b6fd73f451c799f3d8d79521f7..0000000000000000000000000000000000000000
--- a/src/automation/src/test/java/eu/teraflow/automation/MockAutomationConfiguration.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
-* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package eu.teraflow.automation;
-
-import io.smallrye.config.SmallRyeConfig;
-import javax.enterprise.context.ApplicationScoped;
-import javax.inject.Inject;
-import javax.ws.rs.Produces;
-import org.eclipse.microprofile.config.Config;
-
-public class MockAutomationConfiguration {
- @Inject Config config;
-
- @Produces
- @ApplicationScoped
- @io.quarkus.test.Mock
- AutomationConfiguration automationConfiguration() {
- return config.unwrap(SmallRyeConfig.class).getConfigMapping(AutomationConfiguration.class);
- }
-}
diff --git a/src/automation/src/test/java/eu/teraflow/automation/SerializerTest.java b/src/automation/src/test/java/eu/teraflow/automation/SerializerTest.java
deleted file mode 100644
index d2257d1b34e4753aff620e9bbc15d941f99ae3ba..0000000000000000000000000000000000000000
--- a/src/automation/src/test/java/eu/teraflow/automation/SerializerTest.java
+++ /dev/null
@@ -1,1804 +0,0 @@
-/*
-* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package eu.teraflow.automation;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
-
-import acl.Acl;
-import automation.Automation;
-import automation.Automation.ZtpDeviceState;
-import context.ContextOuterClass;
-import context.ContextOuterClass.DeviceId;
-import context.ContextOuterClass.DeviceOperationalStatusEnum;
-import context.ContextOuterClass.Uuid;
-import eu.teraflow.automation.acl.AclAction;
-import eu.teraflow.automation.acl.AclEntry;
-import eu.teraflow.automation.acl.AclForwardActionEnum;
-import eu.teraflow.automation.acl.AclLogActionEnum;
-import eu.teraflow.automation.acl.AclMatch;
-import eu.teraflow.automation.acl.AclRuleSet;
-import eu.teraflow.automation.acl.AclRuleTypeEnum;
-import eu.teraflow.automation.context.model.ConfigActionEnum;
-import eu.teraflow.automation.context.model.ConfigRule;
-import eu.teraflow.automation.context.model.ConfigRuleAcl;
-import eu.teraflow.automation.context.model.ConfigRuleCustom;
-import eu.teraflow.automation.context.model.ConfigRuleTypeAcl;
-import eu.teraflow.automation.context.model.ConfigRuleTypeCustom;
-import eu.teraflow.automation.context.model.Device;
-import eu.teraflow.automation.context.model.DeviceConfig;
-import eu.teraflow.automation.context.model.DeviceDriverEnum;
-import eu.teraflow.automation.context.model.DeviceEvent;
-import eu.teraflow.automation.context.model.DeviceOperationalStatus;
-import eu.teraflow.automation.context.model.Empty;
-import eu.teraflow.automation.context.model.EndPoint.EndPointBuilder;
-import eu.teraflow.automation.context.model.EndPointId;
-import eu.teraflow.automation.context.model.Event;
-import eu.teraflow.automation.context.model.EventTypeEnum;
-import eu.teraflow.automation.context.model.GpsPosition;
-import eu.teraflow.automation.context.model.Location;
-import eu.teraflow.automation.context.model.LocationTypeGpsPosition;
-import eu.teraflow.automation.context.model.LocationTypeRegion;
-import eu.teraflow.automation.context.model.TopologyId;
-import eu.teraflow.automation.kpi_sample_types.model.KpiSampleType;
-import eu.teraflow.automation.model.DeviceRole;
-import eu.teraflow.automation.model.DeviceRoleConfig;
-import eu.teraflow.automation.model.DeviceRoleId;
-import eu.teraflow.automation.model.DeviceRoleType;
-import eu.teraflow.automation.model.DeviceState;
-import io.quarkus.test.junit.QuarkusTest;
-import java.util.List;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-import javax.inject.Inject;
-import kpi_sample_types.KpiSampleTypes;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.params.ParameterizedTest;
-import org.junit.jupiter.params.provider.Arguments;
-import org.junit.jupiter.params.provider.MethodSource;
-
-@QuarkusTest
-class SerializerTest {
-
- @Inject Serializer serializer;
-
- private AclMatch createAclMatch(
- int dscp,
- int protocol,
- String srcAddress,
- String dstAddress,
- int srcPort,
- int dstPort,
- int startMplsLabel,
- int endMplsLabel) {
- return new AclMatch(
- dscp, protocol, srcAddress, dstAddress, srcPort, dstPort, startMplsLabel, endMplsLabel);
- }
-
- private AclAction createAclAction(
- AclForwardActionEnum forwardActionEnum, AclLogActionEnum logActionEnum) {
-
- return new AclAction(forwardActionEnum, logActionEnum);
- }
-
- private AclEntry createAclEntry(
- int sequenceId, String description, AclMatch aclMatch, AclAction aclAction) {
-
- return new AclEntry(sequenceId, description, aclMatch, aclAction);
- }
-
- @Test
- void shouldSerializeDeviceId() {
- final var expectedDeviceId = "expectedDeviceId";
-
- final var deviceIdUuid = serializer.serializeUuid(expectedDeviceId);
- final var deviceId =
- ContextOuterClass.DeviceId.newBuilder().setDeviceUuid(deviceIdUuid).build();
-
- final var serializedDeviceId = serializer.serializeDeviceId(expectedDeviceId);
-
- assertThat(serializedDeviceId).usingRecursiveComparison().isEqualTo(deviceId);
- }
-
- @Test
- void shouldDeserializeDeviceId() {
- final var expectedDeviceId = "expectedDeviceId";
-
- final var serializedDeviceIdUuid = serializer.serializeUuid("expectedDeviceId");
- final var serializedDeviceId =
- DeviceId.newBuilder().setDeviceUuid(serializedDeviceIdUuid).build();
-
- final var deviceId = serializer.deserialize(serializedDeviceId);
-
- assertThat(deviceId).isEqualTo(expectedDeviceId);
- }
-
- @Test
- void shouldSerializeDeviceRoleId() {
- final var expectedDevRoleId = "expectedDevRoleId";
- final var expectedDeviceId = "expectedDeviceId";
-
- final var deviceRoleId = new DeviceRoleId(expectedDevRoleId, expectedDeviceId);
- final var serializedDeviceRoleIdUuid = serializer.serializeUuid(expectedDevRoleId);
- final var serializedDeviceRoleDeviceIdUuid = serializer.serializeUuid(expectedDeviceId);
- final var serializedDeviceRoleDeviceId =
- ContextOuterClass.DeviceId.newBuilder()
- .setDeviceUuid(serializedDeviceRoleDeviceIdUuid)
- .build();
-
- final var expectedDeviceRoleId =
- Automation.DeviceRoleId.newBuilder()
- .setDevRoleId(serializedDeviceRoleIdUuid)
- .setDevId(serializedDeviceRoleDeviceId)
- .build();
-
- final var serializedDevRoleId = serializer.serialize(deviceRoleId);
-
- assertThat(serializedDevRoleId).usingRecursiveComparison().isEqualTo(expectedDeviceRoleId);
- }
-
- @Test
- void shouldDeserializeDeviceRoleId() {
- final var expectedDevRoleId = "expectedDevRoleId";
- final var expectedDeviceId = "expectedDeviceId";
-
- final var expectedDeviceRoleId = new DeviceRoleId(expectedDevRoleId, expectedDeviceId);
-
- final var serializedDeviceRoleId = serializer.serialize(expectedDeviceRoleId);
- final var deviceRoleId = serializer.deserialize(serializedDeviceRoleId);
-
- assertThat(deviceRoleId).usingRecursiveComparison().isEqualTo(expectedDeviceRoleId);
- }
-
- private static Stream provideDeviceRoleType() {
- return Stream.of(
- Arguments.of(DeviceRoleType.DEV_OPS, Automation.DeviceRoleType.DEV_OPS),
- Arguments.of(DeviceRoleType.DEV_CONF, Automation.DeviceRoleType.DEV_CONF),
- Arguments.of(DeviceRoleType.NONE, Automation.DeviceRoleType.NONE),
- Arguments.of(DeviceRoleType.PIPELINE_CONF, Automation.DeviceRoleType.PIPELINE_CONF));
- }
-
- @ParameterizedTest
- @MethodSource("provideDeviceRoleType")
- void shouldSerializeDeviceRoleType(
- DeviceRoleType deviceRoleType, Automation.DeviceRoleType expectedSerializedType) {
- final var serializedType = serializer.serialize(deviceRoleType);
- assertThat(serializedType.getNumber()).isEqualTo(expectedSerializedType.getNumber());
- }
-
- @ParameterizedTest
- @MethodSource("provideDeviceRoleType")
- void shouldDeserializeDeviceRoleType(
- DeviceRoleType expectedDeviceRoleType,
- Automation.DeviceRoleType serializedDeviceRoleTypeType) {
-
- final var deviceRoleType = serializer.deserialize(serializedDeviceRoleTypeType);
-
- assertThat(deviceRoleType).isEqualTo(expectedDeviceRoleType);
- }
-
- @Test
- void shouldSerializeDeviceRole() {
- final var expectedDevRoleId = "expectedDevRoleId";
- final var expectedDeviceId = "expectedDeviceId";
-
- final var serializedDeviceRoleDevRoleIdUuid = serializer.serializeUuid(expectedDevRoleId);
- final var serializedDeviceRoleDeviceId = serializer.serializeDeviceId(expectedDeviceId);
-
- final var expectedDeviceRoleId =
- Automation.DeviceRoleId.newBuilder()
- .setDevRoleId(serializedDeviceRoleDevRoleIdUuid)
- .setDevId(serializedDeviceRoleDeviceId)
- .build();
-
- final var expectedDeviceRoleType = Automation.DeviceRoleType.PIPELINE_CONF;
-
- final var expectedDeviceRole =
- Automation.DeviceRole.newBuilder()
- .setDevRoleId(expectedDeviceRoleId)
- .setDevRoleType(expectedDeviceRoleType)
- .build();
-
- final var deviceRoleId = new DeviceRoleId(expectedDevRoleId, expectedDeviceId);
- final var deviceRoleType = DeviceRoleType.PIPELINE_CONF;
-
- final var deviceRole = new DeviceRole(deviceRoleId, deviceRoleType);
- final var serializedDeviceRole = serializer.serialize(deviceRole);
-
- assertThat(serializedDeviceRole).usingRecursiveComparison().isEqualTo(expectedDeviceRole);
- }
-
- @Test
- void shouldDeserializeDeviceRole() {
- final var expectedDevRoleId = "expectedDevRoleId";
- final var expectedDeviceId = "expectedDeviceId";
-
- final var expectedDeviceRoleId = new DeviceRoleId(expectedDevRoleId, expectedDeviceId);
- final var expectedDeviceRoleType = DeviceRoleType.NONE;
-
- final var expectedDeviceRole = new DeviceRole(expectedDeviceRoleId, expectedDeviceRoleType);
-
- final var serializedDeviceRoleId = serializer.serialize(expectedDeviceRoleId);
- final var serializedDeviceRoleType = serializer.serialize(expectedDeviceRoleType);
-
- final var serializedDeviceRole =
- Automation.DeviceRole.newBuilder()
- .setDevRoleId(serializedDeviceRoleId)
- .setDevRoleType(serializedDeviceRoleType)
- .build();
-
- final var deviceRole = serializer.deserialize(serializedDeviceRole);
-
- assertThat(deviceRole).usingRecursiveComparison().isEqualTo(expectedDeviceRole);
- }
-
- @Test
- void shouldSerializeDeviceRoleConfig() {
- final var expectedDevRoleId = new DeviceRoleId("expectedDevRoleId", "expectedDeviceId");
- final var expectedDevRoleType = DeviceRoleType.DEV_OPS;
-
- final var deviceRole = new DeviceRole(expectedDevRoleId, expectedDevRoleType);
- final var serializedDeviceRole = serializer.serialize(deviceRole);
-
- final var configRuleCustomA = new ConfigRuleCustom("resourceKeyA", "resourceValueA");
- final var configRuleTypeA = new ConfigRuleTypeCustom(configRuleCustomA);
- final var deviceConfig =
- new DeviceConfig(List.of(new ConfigRule(ConfigActionEnum.SET, configRuleTypeA)));
- final var serializedDeviceConfig = serializer.serialize(deviceConfig);
-
- final var expectedDeviceRoleConfig =
- Automation.DeviceRoleConfig.newBuilder()
- .setDevRole(serializedDeviceRole)
- .setDevConfig(serializedDeviceConfig)
- .build();
-
- final var deviceRoleConfig = new DeviceRoleConfig(deviceRole, deviceConfig);
- final var serializedDeviceRoleConfig = serializer.serialize(deviceRoleConfig);
-
- assertThat(serializedDeviceRoleConfig)
- .usingRecursiveComparison()
- .isEqualTo(expectedDeviceRoleConfig);
- }
-
- @Test
- void shouldDeserializeDeviceRoleConfig() {
- final var expectedDevRoleId = new DeviceRoleId("expectedDevRoleId", "expectedDeviceId");
- final var expectedDevRoleType = DeviceRoleType.DEV_OPS;
-
- final var deviceRole = new DeviceRole(expectedDevRoleId, expectedDevRoleType);
- final var serializedDeviceRole = serializer.serialize(deviceRole);
-
- final var configRuleCustomA = new ConfigRuleCustom("resourceKeyA", "resourceValueA");
- final var configRuleTypeA = new ConfigRuleTypeCustom(configRuleCustomA);
- final var deviceConfig =
- new DeviceConfig(List.of(new ConfigRule(ConfigActionEnum.SET, configRuleTypeA)));
- final var serializedDeviceConfig = serializer.serialize(deviceConfig);
-
- final var expectedDeviceRoleConfig = new DeviceRoleConfig(deviceRole, deviceConfig);
-
- final var serializedDeviceRoleConfig =
- Automation.DeviceRoleConfig.newBuilder()
- .setDevRole(serializedDeviceRole)
- .setDevConfig(serializedDeviceConfig)
- .build();
-
- final var deviceRoleConfig = serializer.deserialize(serializedDeviceRoleConfig);
-
- assertThat(deviceRoleConfig).usingRecursiveComparison().isEqualTo(expectedDeviceRoleConfig);
- }
-
- private static Stream provideEventTypeEnum() {
- return Stream.of(
- Arguments.of(EventTypeEnum.CREATE, ContextOuterClass.EventTypeEnum.EVENTTYPE_CREATE),
- Arguments.of(EventTypeEnum.REMOVE, ContextOuterClass.EventTypeEnum.EVENTTYPE_REMOVE),
- Arguments.of(EventTypeEnum.UNDEFINED, ContextOuterClass.EventTypeEnum.EVENTTYPE_UNDEFINED),
- Arguments.of(EventTypeEnum.UPDATE, ContextOuterClass.EventTypeEnum.EVENTTYPE_UPDATE));
- }
-
- @ParameterizedTest
- @MethodSource("provideEventTypeEnum")
- void shouldSerializeEventType(
- EventTypeEnum eventType, ContextOuterClass.EventTypeEnum expectedSerializedType) {
- final var serializedType = serializer.serialize(eventType);
- assertThat(serializedType.getNumber()).isEqualTo(expectedSerializedType.getNumber());
- }
-
- @ParameterizedTest
- @MethodSource("provideEventTypeEnum")
- void shouldDeserializeEventType(
- EventTypeEnum expectedEventType, ContextOuterClass.EventTypeEnum serializedEventType) {
- final var eventType = serializer.deserialize(serializedEventType);
- assertThat(eventType).isEqualTo(expectedEventType);
- }
-
- private static Stream provideDeviceState() {
- return Stream.of(
- Arguments.of(DeviceState.CREATED, ZtpDeviceState.ZTP_DEV_STATE_CREATED),
- Arguments.of(DeviceState.UPDATED, ZtpDeviceState.ZTP_DEV_STATE_UPDATED),
- Arguments.of(DeviceState.DELETED, ZtpDeviceState.ZTP_DEV_STATE_DELETED),
- Arguments.of(DeviceState.UNDEFINED, ZtpDeviceState.ZTP_DEV_STATE_UNDEFINED));
- }
-
- @ParameterizedTest
- @MethodSource("provideDeviceState")
- void shouldSerializeDeviceState(
- DeviceState deviceState, ZtpDeviceState expectedSerializedDeviceState) {
- final var serializedDeviceState = serializer.serialize(deviceState);
- assertThat(serializedDeviceState.getNumber())
- .isEqualTo(expectedSerializedDeviceState.getNumber());
- }
-
- @ParameterizedTest
- @MethodSource("provideDeviceState")
- void shouldDeserializeDeviceState(
- DeviceState expectedDeviceState, ZtpDeviceState serializedDeviceState) {
- final var deviceState = serializer.deserialize(serializedDeviceState);
- assertThat(deviceState).isEqualTo(expectedDeviceState);
- }
-
- @Test
- void shouldSerializeEvent() {
- final var timestamp = ContextOuterClass.Timestamp.newBuilder().setTimestamp(1).build();
-
- final var expectedEvent =
- ContextOuterClass.Event.newBuilder()
- .setTimestamp(timestamp)
- .setEventType(ContextOuterClass.EventTypeEnum.EVENTTYPE_CREATE)
- .build();
-
- final var event = new Event(1, EventTypeEnum.CREATE);
- final var serializedEvent = serializer.serialize(event);
-
- assertThat(serializedEvent).usingRecursiveComparison().isEqualTo(expectedEvent);
- }
-
- @Test
- void shouldDeserializeEvent() {
- final var expectedEvent = new Event(1, EventTypeEnum.CREATE);
- final var timestamp = ContextOuterClass.Timestamp.newBuilder().setTimestamp(1).build();
-
- final var serializedEvent =
- ContextOuterClass.Event.newBuilder()
- .setTimestamp(timestamp)
- .setEventType(ContextOuterClass.EventTypeEnum.EVENTTYPE_CREATE)
- .build();
- final var event = serializer.deserialize(serializedEvent);
-
- assertThat(event).usingRecursiveComparison().isEqualTo(expectedEvent);
- }
-
- @Test
- void shouldSerializeDeviceEvent() {
- final var expectedUuid = Uuid.newBuilder().setUuid("deviceId");
- final var expectedDeviceId = DeviceId.newBuilder().setDeviceUuid(expectedUuid).build();
- final var expectedTimestamp = ContextOuterClass.Timestamp.newBuilder().setTimestamp(1).build();
-
- final var expectedEvent =
- ContextOuterClass.Event.newBuilder()
- .setTimestamp(expectedTimestamp)
- .setEventType(ContextOuterClass.EventTypeEnum.EVENTTYPE_CREATE)
- .build();
-
- final var expectedConfigRuleCustomA =
- ContextOuterClass.ConfigRule_Custom.newBuilder()
- .setResourceKey("resourceKeyA")
- .setResourceValue("resourceValueA")
- .build();
-
- final var expectedConfigRuleCustomB =
- ContextOuterClass.ConfigRule_Custom.newBuilder()
- .setResourceKey("resourceKeyB")
- .setResourceValue("resourceValueB")
- .build();
-
- final var expectedConfigRuleA =
- ContextOuterClass.ConfigRule.newBuilder()
- .setAction(ContextOuterClass.ConfigActionEnum.CONFIGACTION_SET)
- .setCustom(expectedConfigRuleCustomA)
- .build();
- final var expectedConfigRuleB =
- ContextOuterClass.ConfigRule.newBuilder()
- .setAction(ContextOuterClass.ConfigActionEnum.CONFIGACTION_DELETE)
- .setCustom(expectedConfigRuleCustomB)
- .build();
-
- final var expectedDeviceConfig =
- ContextOuterClass.DeviceConfig.newBuilder()
- .addAllConfigRules(List.of(expectedConfigRuleA, expectedConfigRuleB))
- .build();
-
- final var expectedDeviceEvent =
- ContextOuterClass.DeviceEvent.newBuilder()
- .setDeviceId(expectedDeviceId)
- .setEvent(expectedEvent)
- .setDeviceConfig(expectedDeviceConfig)
- .build();
-
- final var creationEvent = new Event(1, EventTypeEnum.CREATE);
- final var configRuleCustomA = new ConfigRuleCustom("resourceKeyA", "resourceValueA");
- final var configRuleCustomB = new ConfigRuleCustom("resourceKeyB", "resourceValueB");
- final var configRuleTypeA = new ConfigRuleTypeCustom(configRuleCustomA);
- final var configRuleTypeB = new ConfigRuleTypeCustom(configRuleCustomB);
- final var configRuleA = new ConfigRule(ConfigActionEnum.SET, configRuleTypeA);
- final var configRuleB = new ConfigRule(ConfigActionEnum.DELETE, configRuleTypeB);
- final var deviceConfig = new DeviceConfig(List.of(configRuleA, configRuleB));
- final var deviceEvent = new DeviceEvent("deviceId", creationEvent, deviceConfig);
- final var serializedDeviceEvent = serializer.serialize(deviceEvent);
-
- assertThat(serializedDeviceEvent).usingRecursiveComparison().isEqualTo(expectedDeviceEvent);
- }
-
- @Test
- void shouldDeserializeDeviceEvent() {
- final var dummyDeviceId = "deviceId";
- final var expectedEventType = EventTypeEnum.REMOVE;
- final var expectedTimestamp = ContextOuterClass.Timestamp.newBuilder().setTimestamp(1).build();
-
- final var creationEvent = new Event(1, expectedEventType);
-
- final var expectedConfigRuleCustomA = new ConfigRuleCustom("resourceKeyA", "resourceValueA");
- final var expectedConfigRuleCustomB = new ConfigRuleCustom("resourceKeyB", "resourceValueB");
-
- final var expectedConfigRuleTypeA = new ConfigRuleTypeCustom(expectedConfigRuleCustomA);
- final var expectedConfigRuleTypeB = new ConfigRuleTypeCustom(expectedConfigRuleCustomB);
-
- final var expectedConfigRuleA = new ConfigRule(ConfigActionEnum.SET, expectedConfigRuleTypeA);
- final var expectedConfigRuleB =
- new ConfigRule(ConfigActionEnum.DELETE, expectedConfigRuleTypeB);
-
- final var expectedDeviceConfig =
- new DeviceConfig(List.of(expectedConfigRuleA, expectedConfigRuleB));
-
- final var expectedDeviceEvent =
- new DeviceEvent(dummyDeviceId, creationEvent, expectedDeviceConfig);
-
- final var deviceUuid = Uuid.newBuilder().setUuid("deviceId");
- final var deviceId = DeviceId.newBuilder().setDeviceUuid(deviceUuid).build();
- final var event =
- ContextOuterClass.Event.newBuilder()
- .setTimestamp(expectedTimestamp)
- .setEventType(ContextOuterClass.EventTypeEnum.EVENTTYPE_REMOVE)
- .build();
-
- final var configRuleCustomA =
- ContextOuterClass.ConfigRule_Custom.newBuilder()
- .setResourceKey("resourceKeyA")
- .setResourceValue("resourceValueA")
- .build();
- final var configRuleCustomB =
- ContextOuterClass.ConfigRule_Custom.newBuilder()
- .setResourceKey("resourceKeyB")
- .setResourceValue("resourceValueB")
- .build();
- final var configRuleA =
- ContextOuterClass.ConfigRule.newBuilder()
- .setAction(ContextOuterClass.ConfigActionEnum.CONFIGACTION_SET)
- .setCustom(configRuleCustomA)
- .build();
- final var configRuleB =
- ContextOuterClass.ConfigRule.newBuilder()
- .setAction(ContextOuterClass.ConfigActionEnum.CONFIGACTION_DELETE)
- .setCustom(configRuleCustomB)
- .build();
- final var deviceConfig =
- ContextOuterClass.DeviceConfig.newBuilder()
- .addAllConfigRules(List.of(configRuleA, configRuleB))
- .build();
-
- final var serializedDeviceEvent =
- ContextOuterClass.DeviceEvent.newBuilder()
- .setDeviceId(deviceId)
- .setEvent(event)
- .setDeviceConfig(deviceConfig)
- .build();
- final var deviceEvent = serializer.deserialize(serializedDeviceEvent);
-
- assertThat(deviceEvent).usingRecursiveComparison().isEqualTo(expectedDeviceEvent);
- }
-
- private static Stream provideConfigActionEnum() {
- return Stream.of(
- Arguments.of(ConfigActionEnum.SET, ContextOuterClass.ConfigActionEnum.CONFIGACTION_SET),
- Arguments.of(
- ConfigActionEnum.DELETE, ContextOuterClass.ConfigActionEnum.CONFIGACTION_DELETE),
- Arguments.of(
- ConfigActionEnum.UNDEFINED, ContextOuterClass.ConfigActionEnum.CONFIGACTION_UNDEFINED));
- }
-
- @ParameterizedTest
- @MethodSource("provideConfigActionEnum")
- void shouldSerializeConfigActionEnum(
- ConfigActionEnum configAction, ContextOuterClass.ConfigActionEnum expectedConfigAction) {
- final var serializedConfigAction = serializer.serialize(configAction);
- assertThat(serializedConfigAction.getNumber()).isEqualTo(expectedConfigAction.getNumber());
- }
-
- @ParameterizedTest
- @MethodSource("provideConfigActionEnum")
- void shouldDeserializeConfigActionEnum(
- ConfigActionEnum expectedConfigAction,
- ContextOuterClass.ConfigActionEnum serializedConfigAction) {
- final var configAction = serializer.deserialize(serializedConfigAction);
- assertThat(configAction).isEqualTo(expectedConfigAction);
- }
-
- private static Stream provideAclRuleTypeEnum() {
- return Stream.of(
- Arguments.of(AclRuleTypeEnum.IPV4, Acl.AclRuleTypeEnum.ACLRULETYPE_IPV4),
- Arguments.of(AclRuleTypeEnum.IPV6, Acl.AclRuleTypeEnum.ACLRULETYPE_IPV6),
- Arguments.of(AclRuleTypeEnum.L2, Acl.AclRuleTypeEnum.ACLRULETYPE_L2),
- Arguments.of(AclRuleTypeEnum.MPLS, Acl.AclRuleTypeEnum.ACLRULETYPE_MPLS),
- Arguments.of(AclRuleTypeEnum.MIXED, Acl.AclRuleTypeEnum.ACLRULETYPE_MIXED),
- Arguments.of(AclRuleTypeEnum.UNDEFINED, Acl.AclRuleTypeEnum.ACLRULETYPE_UNDEFINED));
- }
-
- @ParameterizedTest
- @MethodSource("provideAclRuleTypeEnum")
- void shouldSerializeAclRuleTypeEnum(
- AclRuleTypeEnum aclRuleTypeEnum, Acl.AclRuleTypeEnum expectedAclRuleTypeEnum) {
- final var serializedAclRuleTypeEnum = serializer.serialize(aclRuleTypeEnum);
- assertThat(serializedAclRuleTypeEnum.getNumber())
- .isEqualTo(expectedAclRuleTypeEnum.getNumber());
- }
-
- @ParameterizedTest
- @MethodSource("provideAclRuleTypeEnum")
- void shouldDeserializeAclRuleTypeEnum(
- AclRuleTypeEnum expectedAclRuleTypeEnum, Acl.AclRuleTypeEnum serializedAclRuleTypeEnum) {
- final var aclRuleTypeEnum = serializer.deserialize(serializedAclRuleTypeEnum);
- assertThat(aclRuleTypeEnum).isEqualTo(expectedAclRuleTypeEnum);
- }
-
- private static Stream provideAclForwardActionEnum() {
- return Stream.of(
- Arguments.of(AclForwardActionEnum.DROP, Acl.AclForwardActionEnum.ACLFORWARDINGACTION_DROP),
- Arguments.of(
- AclForwardActionEnum.ACCEPT, Acl.AclForwardActionEnum.ACLFORWARDINGACTION_ACCEPT),
- Arguments.of(
- AclForwardActionEnum.REJECT, Acl.AclForwardActionEnum.ACLFORWARDINGACTION_REJECT),
- Arguments.of(
- AclForwardActionEnum.UNDEFINED,
- Acl.AclForwardActionEnum.ACLFORWARDINGACTION_UNDEFINED));
- }
-
- @ParameterizedTest
- @MethodSource("provideAclForwardActionEnum")
- void shouldSerializeAclForwardActionEnum(
- AclForwardActionEnum aclForwardActionEnum,
- Acl.AclForwardActionEnum expectedAclForwardActionEnum) {
- final var serializedAclForwardActionEnum = serializer.serialize(aclForwardActionEnum);
- assertThat(serializedAclForwardActionEnum.getNumber())
- .isEqualTo(expectedAclForwardActionEnum.getNumber());
- }
-
- @ParameterizedTest
- @MethodSource("provideAclForwardActionEnum")
- void shouldDeserializeAclForwardActionEnum(
- AclForwardActionEnum expectedAclForwardActionEnum,
- Acl.AclForwardActionEnum serializedAclForwardActionEnum) {
- final var aclForwardActionEnum = serializer.deserialize(serializedAclForwardActionEnum);
- assertThat(aclForwardActionEnum).isEqualTo(expectedAclForwardActionEnum);
- }
-
- private static Stream provideAclLogActionEnum() {
- return Stream.of(
- Arguments.of(AclLogActionEnum.NO_LOG, Acl.AclLogActionEnum.ACLLOGACTION_NOLOG),
- Arguments.of(AclLogActionEnum.SYSLOG, Acl.AclLogActionEnum.ACLLOGACTION_SYSLOG),
- Arguments.of(AclLogActionEnum.UNDEFINED, Acl.AclLogActionEnum.ACLLOGACTION_UNDEFINED));
- }
-
- @ParameterizedTest
- @MethodSource("provideAclLogActionEnum")
- void shouldSerializeAclLogActionEnum(
- AclLogActionEnum aclLogActionEnum, Acl.AclLogActionEnum expectedAclLogActionEnum) {
- final var serializedAclLogActionEnum = serializer.serialize(aclLogActionEnum);
- assertThat(serializedAclLogActionEnum.getNumber())
- .isEqualTo(expectedAclLogActionEnum.getNumber());
- }
-
- @Test
- void shouldSerializeAclAction() {
- final var aclAction = createAclAction(AclForwardActionEnum.ACCEPT, AclLogActionEnum.SYSLOG);
-
- final var expectedAclAction =
- Acl.AclAction.newBuilder()
- .setForwardAction(Acl.AclForwardActionEnum.ACLFORWARDINGACTION_ACCEPT)
- .setLogAction(Acl.AclLogActionEnum.ACLLOGACTION_SYSLOG)
- .build();
-
- final var serializedAclAction = serializer.serialize(aclAction);
-
- assertThat(serializedAclAction).usingRecursiveComparison().isEqualTo(expectedAclAction);
- }
-
- @Test
- void shouldDeserializeAclAction() {
- final var expectedAclAction =
- createAclAction(AclForwardActionEnum.ACCEPT, AclLogActionEnum.SYSLOG);
-
- final var serializedAclAction = serializer.serialize(expectedAclAction);
- final var aclAction = serializer.deserialize(serializedAclAction);
-
- assertThat(aclAction).usingRecursiveComparison().isEqualTo(expectedAclAction);
- }
-
- @Test
- void shouldSerializeAclMatch() {
- final var aclMatch = createAclMatch(1, 1, "127.0.0.1", "127.0.0.2", 5601, 5602, 1, 2);
-
- final var expectedAclMatch =
- Acl.AclMatch.newBuilder()
- .setDscp(1)
- .setProtocol(1)
- .setSrcAddress("127.0.0.1")
- .setDstAddress("127.0.0.2")
- .setSrcPort(5601)
- .setDstPort(5602)
- .setStartMplsLabel(1)
- .setEndMplsLabel(2)
- .build();
-
- final var serializedAclMatch = serializer.serialize(aclMatch);
-
- assertThat(serializedAclMatch).usingRecursiveComparison().isEqualTo(expectedAclMatch);
- }
-
- @Test
- void shouldDeserializeAclMatch() {
- final var expectedAclMatch = createAclMatch(1, 2, "127.0.0.1", "127.0.0.2", 5601, 5602, 5, 10);
-
- final var serializedAclMatch = serializer.serialize(expectedAclMatch);
- final var aclMatch = serializer.deserialize(serializedAclMatch);
-
- assertThat(aclMatch).usingRecursiveComparison().isEqualTo(expectedAclMatch);
- }
-
- @Test
- void shouldSerializeAclEntry() {
- final var sequenceId = 1;
- final var description = "aclEntryDescription";
-
- final var aclMatch = createAclMatch(1, 2, "127.0.0.1", "127.0.0.2", 5601, 5602, 5, 10);
- final var aclAction = createAclAction(AclForwardActionEnum.ACCEPT, AclLogActionEnum.SYSLOG);
- final var aclEntry = createAclEntry(sequenceId, description, aclMatch, aclAction);
-
- final var serializedAclMatch = serializer.serialize(aclMatch);
- final var serializedAclAction = serializer.serialize(aclAction);
-
- final var expectedAclEntry =
- Acl.AclEntry.newBuilder()
- .setSequenceId(sequenceId)
- .setDescription(description)
- .setMatch(serializedAclMatch)
- .setAction(serializedAclAction)
- .build();
-
- final var serializedAclEntry = serializer.serialize(aclEntry);
-
- assertThat(serializedAclEntry).usingRecursiveComparison().isEqualTo(expectedAclEntry);
- }
-
- @Test
- void shouldDeserializeAclEntry() {
- final var sequenceId = 1;
- final var description = "aclEntryDescription";
-
- final var aclMatch = createAclMatch(1, 2, "127.0.0.1", "127.0.0.2", 5601, 5602, 5, 10);
- final var aclAction = createAclAction(AclForwardActionEnum.ACCEPT, AclLogActionEnum.SYSLOG);
- final var expectedAclEntry = createAclEntry(sequenceId, description, aclMatch, aclAction);
-
- final var serializedAclEntry = serializer.serialize(expectedAclEntry);
- final var aclEntry = serializer.deserialize(serializedAclEntry);
-
- assertThat(aclEntry).usingRecursiveComparison().isEqualTo(expectedAclEntry);
- }
-
- @Test
- void shouldSerializeAclRuleSet() {
- final var sequenceId = 1;
- final var aclEntryDescription = "aclEntryDescription";
-
- final var aclRuleSetName = "aclRuleSetName";
- final var aclRuleSetDescription = "aclRuleSetDescription";
- final var aclRuleSetUserId = "aclRuleSetUserId";
-
- final var aclMatch = createAclMatch(1, 2, "127.0.0.1", "127.0.0.2", 5601, 5602, 5, 10);
- final var aclAction = createAclAction(AclForwardActionEnum.ACCEPT, AclLogActionEnum.SYSLOG);
- final var aclEntry = createAclEntry(sequenceId, aclEntryDescription, aclMatch, aclAction);
- final var aclRuleSet =
- new AclRuleSet(
- aclRuleSetName,
- AclRuleTypeEnum.MIXED,
- aclRuleSetDescription,
- aclRuleSetUserId,
- List.of(aclEntry));
-
- final var serializedAclEntry = serializer.serialize(aclEntry);
- final var serializedAclEntries = List.of(serializedAclEntry);
-
- final var expectedAclRuleSet =
- Acl.AclRuleSet.newBuilder()
- .setName(aclRuleSetName)
- .setType(Acl.AclRuleTypeEnum.ACLRULETYPE_MIXED)
- .setDescription(aclRuleSetDescription)
- .setUserId(aclRuleSetUserId)
- .addAllEntries(serializedAclEntries)
- .build();
-
- final var serializedAclRuleset = serializer.serialize(aclRuleSet);
-
- assertThat(serializedAclRuleset).usingRecursiveComparison().isEqualTo(expectedAclRuleSet);
- }
-
- @Test
- void shouldDeserializeAclRuleSet() {
- final var sequenceId = 1;
- final var aclEntryDescription = "aclEntryDescription";
-
- final var aclRuleSetName = "aclRuleSetName";
- final var aclRuleSetDescription = "aclRuleSetDescription";
- final var aclRuleSetUserId = "aclRuleSetUserId";
-
- final var aclMatch = createAclMatch(1, 2, "127.0.0.1", "127.0.0.2", 5601, 5602, 5, 10);
- final var aclAction = createAclAction(AclForwardActionEnum.ACCEPT, AclLogActionEnum.SYSLOG);
- final var aclEntry = createAclEntry(sequenceId, aclEntryDescription, aclMatch, aclAction);
- final var expectedAclRuleSet =
- new AclRuleSet(
- aclRuleSetName,
- AclRuleTypeEnum.MIXED,
- aclRuleSetDescription,
- aclRuleSetUserId,
- List.of(aclEntry));
-
- final var serializedAclRuleSet = serializer.serialize(expectedAclRuleSet);
- final var aclRuleSet = serializer.deserialize(serializedAclRuleSet);
-
- assertThat(aclRuleSet).usingRecursiveComparison().isEqualTo(expectedAclRuleSet);
- }
-
- @ParameterizedTest
- @MethodSource("provideAclLogActionEnum")
- void shouldDeserializeAclLogActionEnum(
- AclLogActionEnum expectedAclLogActionEnum, Acl.AclLogActionEnum serializedAclLogActionEnum) {
- final var aclLogActionEnum = serializer.deserialize(serializedAclLogActionEnum);
- assertThat(aclLogActionEnum).isEqualTo(expectedAclLogActionEnum);
- }
-
- @Test
- void shouldSerializeTopologyId() {
- final var expectedContextId = "expectedContextId";
- final var expectedId = "expectedId";
- final var topologyId = new TopologyId(expectedContextId, expectedId);
-
- final var serializedContextId = serializer.serializeContextId(expectedContextId);
- final var serializedIdUuid = serializer.serializeUuid(expectedId);
-
- final var expectedTopologyId =
- ContextOuterClass.TopologyId.newBuilder()
- .setContextId(serializedContextId)
- .setTopologyUuid(serializedIdUuid)
- .build();
-
- final var serializedTopologyId = serializer.serialize(topologyId);
-
- assertThat(serializedTopologyId).usingRecursiveComparison().isEqualTo(expectedTopologyId);
- }
-
- @Test
- void shouldDeserializeTopologyId() {
- final var expectedContextId = "expectedContextId";
- final var expectedId = "expectedId";
-
- final var expectedTopologyId = new TopologyId(expectedContextId, expectedId);
-
- final var serializedTopologyId = serializer.serialize(expectedTopologyId);
- final var topologyId = serializer.deserialize(serializedTopologyId);
-
- assertThat(topologyId).usingRecursiveComparison().isEqualTo(expectedTopologyId);
- }
-
- @Test
- void shouldSerializeEndPointId() {
- final var expectedTopologyId = new TopologyId("contextId", "id");
- final var expectedDeviceId = "expectedDeviceId";
- final var expectedId = "expectedId";
-
- final var endPointId = new EndPointId(expectedTopologyId, expectedDeviceId, expectedId);
-
- final var serializedTopologyId = serializer.serialize(expectedTopologyId);
- final var serializedDeviceId = serializer.serializeDeviceId(expectedDeviceId);
- final var serializedEndPointUuid = serializer.serializeUuid(expectedId);
-
- final var expectedEndPointId =
- ContextOuterClass.EndPointId.newBuilder()
- .setTopologyId(serializedTopologyId)
- .setDeviceId(serializedDeviceId)
- .setEndpointUuid(serializedEndPointUuid)
- .build();
-
- final var serializedEndPointId = serializer.serialize(endPointId);
-
- assertThat(serializedEndPointId).usingRecursiveComparison().isEqualTo(expectedEndPointId);
- }
-
- @Test
- void shouldDeserializeEndPointId() {
- final var expectedTopologyId = new TopologyId("contextId", "id");
- final var expectedDeviceId = "expectedDeviceId";
- final var expectedId = "expectedId";
-
- final var expectedEndPointId = new EndPointId(expectedTopologyId, expectedDeviceId, expectedId);
-
- final var serializedEndPointId = serializer.serialize(expectedEndPointId);
- final var endPointId = serializer.deserialize(serializedEndPointId);
-
- assertThat(endPointId).usingRecursiveComparison().isEqualTo(expectedEndPointId);
- }
-
- @Test
- void shouldSerializeConfigRuleAcl() {
- final var expectedTopologyId = new TopologyId("contextId", "id");
- final var expectedDeviceId = "expectedDeviceId";
- final var expectedId = "expectedId";
-
- final var sequenceId = 1;
- final var aclEntryDescription = "aclEntryDescription";
-
- final var aclRuleSetName = "aclRuleSetName";
- final var aclRuleSetDescription = "aclRuleSetDescription";
- final var aclRuleSetUserId = "aclRuleSetUserId";
-
- final var endPointId = new EndPointId(expectedTopologyId, expectedDeviceId, expectedId);
-
- final var aclMatch = createAclMatch(1, 2, "127.0.0.1", "127.0.0.2", 5601, 5602, 5, 10);
- final var aclAction = createAclAction(AclForwardActionEnum.ACCEPT, AclLogActionEnum.SYSLOG);
- final var aclEntry = createAclEntry(sequenceId, aclEntryDescription, aclMatch, aclAction);
- final var aclRuleSet =
- new AclRuleSet(
- aclRuleSetName,
- AclRuleTypeEnum.MIXED,
- aclRuleSetDescription,
- aclRuleSetUserId,
- List.of(aclEntry));
-
- final var configRuleAcl = new ConfigRuleAcl(endPointId, aclRuleSet);
-
- final var serializedEndPointId = serializer.serialize(endPointId);
- final var serializedAclRuleSet = serializer.serialize(aclRuleSet);
-
- final var expectedConfigRuleAcl =
- ContextOuterClass.ConfigRule_ACL.newBuilder()
- .setEndpointId(serializedEndPointId)
- .setRuleSet(serializedAclRuleSet)
- .build();
-
- final var serializedConfigRuleAcl = serializer.serialize(configRuleAcl);
-
- assertThat(serializedConfigRuleAcl).usingRecursiveComparison().isEqualTo(expectedConfigRuleAcl);
- }
-
- @Test
- void shouldDeserializeConfigRuleAcl() {
- final var expectedTopologyId = new TopologyId("contextId", "id");
- final var expectedDeviceId = "expectedDeviceId";
- final var expectedId = "expectedId";
-
- final var sequenceId = 1;
- final var aclEntryDescription = "aclEntryDescription";
-
- final var aclRuleSetName = "aclRuleSetName";
- final var aclRuleSetDescription = "aclRuleSetDescription";
- final var aclRuleSetUserId = "aclRuleSetUserId";
-
- final var endPointId = new EndPointId(expectedTopologyId, expectedDeviceId, expectedId);
-
- final var aclMatch = createAclMatch(1, 2, "127.0.0.1", "127.0.0.2", 5601, 5602, 5, 10);
- final var aclAction = createAclAction(AclForwardActionEnum.ACCEPT, AclLogActionEnum.SYSLOG);
- final var aclEntry = createAclEntry(sequenceId, aclEntryDescription, aclMatch, aclAction);
- final var aclRuleSet =
- new AclRuleSet(
- aclRuleSetName,
- AclRuleTypeEnum.MIXED,
- aclRuleSetDescription,
- aclRuleSetUserId,
- List.of(aclEntry));
-
- final var expectedConfigRuleAcl = new ConfigRuleAcl(endPointId, aclRuleSet);
-
- final var serializedConfigRuleAcl = serializer.serialize(expectedConfigRuleAcl);
- final var configRuleAcl = serializer.deserialize(serializedConfigRuleAcl);
-
- assertThat(configRuleAcl).usingRecursiveComparison().isEqualTo(expectedConfigRuleAcl);
- }
-
- @Test
- void shouldSerializeConfigRuleCustom() {
- final var resourceKey = "resourceKey";
- final var resourceValue = "resourceValue";
-
- final var configRuleCustom = new ConfigRuleCustom(resourceKey, resourceValue);
-
- final var expectedConfigRuleCustom =
- ContextOuterClass.ConfigRule_Custom.newBuilder()
- .setResourceKey(resourceKey)
- .setResourceValue(resourceValue)
- .build();
-
- final var serializedConfigRuleCustom = serializer.serialize(configRuleCustom);
-
- assertThat(serializedConfigRuleCustom)
- .usingRecursiveComparison()
- .isEqualTo(expectedConfigRuleCustom);
- }
-
- @Test
- void shouldDeserializeConfigRuleCustom() {
- final var resourceKey = "resourceKey";
- final var resourceValue = "resourceValue";
-
- final var expectedConfigRuleCustom = new ConfigRuleCustom(resourceKey, resourceValue);
-
- final var serializedConfigRuleCustom = serializer.serialize(expectedConfigRuleCustom);
- final var configRuleCustom = serializer.deserialize(serializedConfigRuleCustom);
-
- assertThat(configRuleCustom).usingRecursiveComparison().isEqualTo(expectedConfigRuleCustom);
- }
-
- @Test
- void shouldSerializeConfigRule() {
- final var contextIdUuid = "contextId";
- final var topologyIdUuid = "topologyUuid";
- final var deviceIdUuid = "deviceIdUuid";
- final var endpointIdUuid = "endpointIdUuid";
-
- final var expectedSerializedContextId = serializer.serializeContextId(contextIdUuid);
- final var expectedSerializedTopologyIdUuid = serializer.serializeUuid(topologyIdUuid);
- final var expectedSerializedDeviceId = serializer.serializeDeviceId(deviceIdUuid);
- final var expectedSerializedEndPointIdUuid = serializer.serializeUuid(endpointIdUuid);
-
- final var expectedSerializedTopologyId =
- ContextOuterClass.TopologyId.newBuilder()
- .setContextId(expectedSerializedContextId)
- .setTopologyUuid(expectedSerializedTopologyIdUuid)
- .build();
-
- final var topologyId = new TopologyId(contextIdUuid, topologyIdUuid);
-
- final var expectedSerializedEndPointId =
- ContextOuterClass.EndPointId.newBuilder()
- .setTopologyId(expectedSerializedTopologyId)
- .setDeviceId(expectedSerializedDeviceId)
- .setEndpointUuid(expectedSerializedEndPointIdUuid)
- .build();
-
- final var endPointId = new EndPointId(topologyId, deviceIdUuid, endpointIdUuid);
-
- final var expectedSerializedAclMatch =
- Acl.AclMatch.newBuilder()
- .setDscp(1)
- .setProtocol(1)
- .setSrcAddress("127.0.0.1")
- .setDstAddress("127.0.0.2")
- .setSrcPort(5601)
- .setDstPort(5602)
- .setStartMplsLabel(1)
- .setEndMplsLabel(2)
- .build();
-
- final var aclMatch = createAclMatch(1, 1, "127.0.0.1", "127.0.0.2", 5601, 5602, 1, 2);
-
- final var expectedSerializedAclAction =
- Acl.AclAction.newBuilder()
- .setForwardAction(Acl.AclForwardActionEnum.ACLFORWARDINGACTION_ACCEPT)
- .setLogAction(Acl.AclLogActionEnum.ACLLOGACTION_SYSLOG)
- .build();
-
- final var aclAction = createAclAction(AclForwardActionEnum.ACCEPT, AclLogActionEnum.SYSLOG);
-
- final var expectedSerializedAclEntry =
- Acl.AclEntry.newBuilder()
- .setSequenceId(1)
- .setDescription("aclEntryDescription")
- .setMatch(expectedSerializedAclMatch)
- .setAction(expectedSerializedAclAction)
- .build();
-
- final var aclEntry = createAclEntry(1, "aclEntryDescription", aclMatch, aclAction);
-
- final var expectedSerializedAclRuleSet =
- Acl.AclRuleSet.newBuilder()
- .setName("aclRuleName")
- .setType(Acl.AclRuleTypeEnum.ACLRULETYPE_IPV4)
- .setDescription("AclRuleDescription")
- .setUserId("userId")
- .addEntries(expectedSerializedAclEntry)
- .build();
-
- final var aclRuleSet =
- new AclRuleSet(
- "aclRuleName",
- eu.teraflow.automation.acl.AclRuleTypeEnum.IPV4,
- "AclRuleDescription",
- "userId",
- List.of(aclEntry));
-
- final var expectedSerializedConfigRuleAcl =
- ContextOuterClass.ConfigRule_ACL.newBuilder()
- .setEndpointId(expectedSerializedEndPointId)
- .setRuleSet(expectedSerializedAclRuleSet)
- .build();
-
- final var configRuleAcl = new ConfigRuleAcl(endPointId, aclRuleSet);
-
- final var expectedConfigRule =
- ContextOuterClass.ConfigRule.newBuilder()
- .setAction(ContextOuterClass.ConfigActionEnum.CONFIGACTION_SET)
- .setAcl(expectedSerializedConfigRuleAcl)
- .build();
-
- final var configRuleTypeAcl = new ConfigRuleTypeAcl(configRuleAcl);
- final var configRule = new ConfigRule(ConfigActionEnum.SET, configRuleTypeAcl);
- final var serializedConfigRule = serializer.serialize(configRule);
-
- assertThat(serializedConfigRule).isEqualTo(expectedConfigRule);
- }
-
- @Test
- void shouldDeserializeConfigRule() {
- final var contextIdUuid = "contextId";
- final var topologyIdUuid = "topologyUuid";
- final var deviceIdUuid = "deviceIdUuid";
- final var endpointIdUuid = "endpointIdUuid";
-
- final var serializedContextId = serializer.serializeContextId(contextIdUuid);
- final var serializedTopologyIdUuid = serializer.serializeUuid(topologyIdUuid);
- final var serializedDeviceId = serializer.serializeDeviceId(deviceIdUuid);
- final var serializedEndPointIdUuid = serializer.serializeUuid(endpointIdUuid);
-
- final var topologyId = new TopologyId(contextIdUuid, topologyIdUuid);
- final var serializedTopologyId =
- ContextOuterClass.TopologyId.newBuilder()
- .setContextId(serializedContextId)
- .setTopologyUuid(serializedTopologyIdUuid)
- .build();
-
- final var endPointId = new EndPointId(topologyId, deviceIdUuid, endpointIdUuid);
- final var serializedEndPointId =
- ContextOuterClass.EndPointId.newBuilder()
- .setTopologyId(serializedTopologyId)
- .setDeviceId(serializedDeviceId)
- .setEndpointUuid(serializedEndPointIdUuid)
- .build();
-
- final var aclMatch = createAclMatch(1, 2, "127.0.0.1", "127.0.0.2", 5601, 5602, 5, 10);
- final var serializedAclMatch =
- Acl.AclMatch.newBuilder()
- .setDscp(1)
- .setProtocol(2)
- .setSrcAddress("127.0.0.1")
- .setDstAddress("127.0.0.2")
- .setSrcPort(5601)
- .setDstPort(5602)
- .setStartMplsLabel(5)
- .setEndMplsLabel(10)
- .build();
-
- final var aclAction = createAclAction(AclForwardActionEnum.ACCEPT, AclLogActionEnum.SYSLOG);
- final var serializedAclAction =
- Acl.AclAction.newBuilder()
- .setForwardAction(Acl.AclForwardActionEnum.ACLFORWARDINGACTION_ACCEPT)
- .setLogAction(Acl.AclLogActionEnum.ACLLOGACTION_SYSLOG)
- .build();
-
- final var aclEntry = createAclEntry(1, "aclEntryDescription", aclMatch, aclAction);
-
- final var serializedAclEntry =
- Acl.AclEntry.newBuilder()
- .setSequenceId(1)
- .setDescription("aclEntryDescription")
- .setMatch(serializedAclMatch)
- .setAction(serializedAclAction)
- .build();
-
- final var aclRuleSet =
- new AclRuleSet(
- "aclRuleName",
- eu.teraflow.automation.acl.AclRuleTypeEnum.IPV4,
- "AclRuleDescription",
- "userId",
- List.of(aclEntry));
-
- final var serializedAclRuleSet =
- Acl.AclRuleSet.newBuilder()
- .setName("aclRuleName")
- .setType(Acl.AclRuleTypeEnum.ACLRULETYPE_IPV4)
- .setDescription("AclRuleDescription")
- .setUserId("userId")
- .addEntries(serializedAclEntry)
- .build();
-
- final var configRuleAcl = new ConfigRuleAcl(endPointId, aclRuleSet);
- final var configRuleTypeAcl = new ConfigRuleTypeAcl(configRuleAcl);
-
- final var expectedConfigRule = new ConfigRule(ConfigActionEnum.DELETE, configRuleTypeAcl);
-
- final var serializedConfigRuleAcl =
- ContextOuterClass.ConfigRule_ACL.newBuilder()
- .setEndpointId(serializedEndPointId)
- .setRuleSet(serializedAclRuleSet)
- .build();
-
- final var serializedConfigRule =
- ContextOuterClass.ConfigRule.newBuilder()
- .setAction(ContextOuterClass.ConfigActionEnum.CONFIGACTION_DELETE)
- .setAcl(serializedConfigRuleAcl)
- .build();
-
- final var configRule = serializer.deserialize(serializedConfigRule);
-
- assertThat(configRule).usingRecursiveComparison().isEqualTo(expectedConfigRule);
- }
-
- @Test
- void shouldThrowIllegalStateExceptionDuringDeserializationOfNonSpecifiedConfigRule() {
- final var serializedConfigRule =
- ContextOuterClass.ConfigRule.newBuilder()
- .setAction(ContextOuterClass.ConfigActionEnum.CONFIGACTION_SET)
- .build();
-
- assertThatExceptionOfType(IllegalStateException.class)
- .isThrownBy(() -> serializer.deserialize(serializedConfigRule));
- }
-
- private static Stream provideKpiSampleType() {
- return Stream.of(
- Arguments.of(
- KpiSampleType.PACKETS_TRANSMITTED,
- KpiSampleTypes.KpiSampleType.KPISAMPLETYPE_PACKETS_TRANSMITTED),
- Arguments.of(
- KpiSampleType.PACKETS_RECEIVED,
- KpiSampleTypes.KpiSampleType.KPISAMPLETYPE_PACKETS_RECEIVED),
- Arguments.of(
- KpiSampleType.BYTES_TRANSMITTED,
- KpiSampleTypes.KpiSampleType.KPISAMPLETYPE_BYTES_TRANSMITTED),
- Arguments.of(
- KpiSampleType.BYTES_RECEIVED,
- KpiSampleTypes.KpiSampleType.KPISAMPLETYPE_BYTES_RECEIVED),
- Arguments.of(KpiSampleType.UNKNOWN, KpiSampleTypes.KpiSampleType.KPISAMPLETYPE_UNKNOWN));
- }
-
- @ParameterizedTest
- @MethodSource("provideKpiSampleType")
- void shouldSerializeKpiSampleType(
- KpiSampleType kpiSampleType, KpiSampleTypes.KpiSampleType expectedSerializedType) {
- final var serializedKpiSampleType = serializer.serialize(kpiSampleType);
-
- assertThat(serializedKpiSampleType.getNumber()).isEqualTo(expectedSerializedType.getNumber());
- }
-
- @ParameterizedTest
- @MethodSource("provideKpiSampleType")
- void shouldDeserializeKpiSampleType(
- KpiSampleType expectedKpiSampleType, KpiSampleTypes.KpiSampleType serializedKpiSampleType) {
- final var kpiSampleType = serializer.deserialize(serializedKpiSampleType);
-
- assertThat(kpiSampleType).isEqualTo(expectedKpiSampleType);
- }
-
- private static Stream provideDeviceDriverEnum() {
- return Stream.of(
- Arguments.of(
- DeviceDriverEnum.OPENCONFIG,
- ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_OPENCONFIG),
- Arguments.of(
- DeviceDriverEnum.TRANSPORT_API,
- ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_TRANSPORT_API),
- Arguments.of(DeviceDriverEnum.P4, ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_P4),
- Arguments.of(
- DeviceDriverEnum.IETF_NETWORK_TOPOLOGY,
- ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_IETF_NETWORK_TOPOLOGY),
- Arguments.of(
- DeviceDriverEnum.ONF_TR_352,
- ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_ONF_TR_352),
- Arguments.of(DeviceDriverEnum.XR, ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_XR),
- Arguments.of(
- DeviceDriverEnum.IETF_L2VPN,
- ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_IETF_L2VPN),
- Arguments.of(
- DeviceDriverEnum.UNDEFINED, ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_UNDEFINED));
- }
-
- @ParameterizedTest
- @MethodSource("provideDeviceDriverEnum")
- void shouldSerializeDeviceDriverEnum(
- DeviceDriverEnum deviceDriverEnum,
- ContextOuterClass.DeviceDriverEnum expectedDeviceDriverEnum) {
- final var serializedDeviceDriverEnum = serializer.serialize(deviceDriverEnum);
-
- assertThat(serializedDeviceDriverEnum.getNumber())
- .isEqualTo(expectedDeviceDriverEnum.getNumber());
- }
-
- @ParameterizedTest
- @MethodSource("provideDeviceDriverEnum")
- void shouldDeserializeDeviceDriverEnum(
- DeviceDriverEnum expectedDeviceDriverEnum,
- ContextOuterClass.DeviceDriverEnum serializedDeviceDriverEnum) {
- final var deviceDriverEnum = serializer.deserialize(serializedDeviceDriverEnum);
-
- assertThat(deviceDriverEnum).isEqualTo(expectedDeviceDriverEnum);
- }
-
- @Test
- void shouldSerializeDeviceConfig() {
- final var expectedConfigRuleCustomA =
- ContextOuterClass.ConfigRule_Custom.newBuilder()
- .setResourceKey("resourceKeyA")
- .setResourceValue("resourceValueA")
- .build();
-
- final var configRuleCustomA = new ConfigRuleCustom("resourceKeyA", "resourceValueA");
-
- final var expectedConfigRuleCustomB =
- ContextOuterClass.ConfigRule_Custom.newBuilder()
- .setResourceKey("resourceKeyB")
- .setResourceValue("resourceValueB")
- .build();
-
- final var configRuleCustomB = new ConfigRuleCustom("resourceKeyB", "resourceValueB");
-
- final var expectedConfigRuleA =
- ContextOuterClass.ConfigRule.newBuilder()
- .setAction(ContextOuterClass.ConfigActionEnum.CONFIGACTION_SET)
- .setCustom(expectedConfigRuleCustomA)
- .build();
- final var expectedConfigRuleB =
- ContextOuterClass.ConfigRule.newBuilder()
- .setAction(ContextOuterClass.ConfigActionEnum.CONFIGACTION_DELETE)
- .setCustom(expectedConfigRuleCustomB)
- .build();
-
- final var expectedDeviceConfig =
- ContextOuterClass.DeviceConfig.newBuilder()
- .addAllConfigRules(List.of(expectedConfigRuleA, expectedConfigRuleB))
- .build();
-
- final var configRuleTypeA = new ConfigRuleTypeCustom(configRuleCustomA);
- final var configRuleTypeB = new ConfigRuleTypeCustom(configRuleCustomB);
-
- final var configRuleA = new ConfigRule(ConfigActionEnum.SET, configRuleTypeA);
- final var configRuleB = new ConfigRule(ConfigActionEnum.DELETE, configRuleTypeB);
-
- final var deviceConfig = new DeviceConfig(List.of(configRuleA, configRuleB));
- final var serializedDeviceConfig = serializer.serialize(deviceConfig);
-
- assertThat(serializedDeviceConfig).isEqualTo(expectedDeviceConfig);
- }
-
- @Test
- void shouldDeserializeDeviceConfig() {
- final var expectedConfigRuleCustomA = new ConfigRuleCustom("resourceKeyA", "resourceValueA");
- final var expectedConfigRuleCustomB = new ConfigRuleCustom("resourceKeyB", "resourceValueB");
-
- final var expectedConfigRuleTypeA = new ConfigRuleTypeCustom(expectedConfigRuleCustomA);
- final var expectedConfigRuleTypeB = new ConfigRuleTypeCustom(expectedConfigRuleCustomB);
-
- final var expectedConfigRuleA = new ConfigRule(ConfigActionEnum.SET, expectedConfigRuleTypeA);
- final var expectedConfigRuleB =
- new ConfigRule(ConfigActionEnum.DELETE, expectedConfigRuleTypeB);
-
- final var expectedDeviceConfig =
- new DeviceConfig(List.of(expectedConfigRuleA, expectedConfigRuleB));
-
- final var configRuleCustomA =
- ContextOuterClass.ConfigRule_Custom.newBuilder()
- .setResourceKey("resourceKeyA")
- .setResourceValue("resourceValueA")
- .build();
-
- final var configRuleCustomB =
- ContextOuterClass.ConfigRule_Custom.newBuilder()
- .setResourceKey("resourceKeyB")
- .setResourceValue("resourceValueB")
- .build();
-
- final var configRuleA =
- ContextOuterClass.ConfigRule.newBuilder()
- .setAction(ContextOuterClass.ConfigActionEnum.CONFIGACTION_SET)
- .setCustom(configRuleCustomA)
- .build();
- final var configRuleB =
- ContextOuterClass.ConfigRule.newBuilder()
- .setAction(ContextOuterClass.ConfigActionEnum.CONFIGACTION_DELETE)
- .setCustom(configRuleCustomB)
- .build();
- final var serializedDeviceConfig =
- ContextOuterClass.DeviceConfig.newBuilder()
- .addAllConfigRules(List.of(configRuleA, configRuleB))
- .build();
- final var deviceConfig = serializer.deserialize(serializedDeviceConfig);
-
- assertThat(deviceConfig).usingRecursiveComparison().isEqualTo(expectedDeviceConfig);
- }
-
- private static Stream provideOperationalStatusEnum() {
- return Stream.of(
- Arguments.of(
- DeviceOperationalStatus.ENABLED,
- DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_ENABLED),
- Arguments.of(
- DeviceOperationalStatus.DISABLED,
- DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_DISABLED),
- Arguments.of(
- DeviceOperationalStatus.UNDEFINED,
- DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_UNDEFINED));
- }
-
- @ParameterizedTest
- @MethodSource("provideOperationalStatusEnum")
- void shouldSerializeOperationalStatusEnum(
- DeviceOperationalStatus opStatus,
- ContextOuterClass.DeviceOperationalStatusEnum expectedOpStatus) {
- final var serializedOpStatus = serializer.serialize(opStatus);
- assertThat(serializedOpStatus.getNumber()).isEqualTo(expectedOpStatus.getNumber());
- }
-
- @ParameterizedTest
- @MethodSource("provideOperationalStatusEnum")
- void shouldDeserializeOperationalStatusEnum(
- DeviceOperationalStatus expectedOpStatus,
- ContextOuterClass.DeviceOperationalStatusEnum serializedOpStatus) {
- final var operationalStatus = serializer.deserialize(serializedOpStatus);
- assertThat(operationalStatus).isEqualTo(expectedOpStatus);
- }
-
- @Test
- void shouldSerializeLocationOfTypeRegion() {
- final var region = "Tokyo";
-
- final var locationTypeRegion = new LocationTypeRegion(region);
- final var location = new Location(locationTypeRegion);
-
- final var expectedLocation = ContextOuterClass.Location.newBuilder().setRegion(region).build();
-
- final var serializedLocation = serializer.serialize(location);
-
- assertThat(serializedLocation).isEqualTo(expectedLocation);
- }
-
- @Test
- void shouldDeserializeLocationOfTypeRegion() {
- final var region = "Tokyo";
-
- final var locationTypeRegion = new LocationTypeRegion(region);
- final var expectedLocation = new Location(locationTypeRegion);
-
- final var serializedLocation =
- ContextOuterClass.Location.newBuilder().setRegion(region).build();
-
- final var location = serializer.deserialize(serializedLocation);
-
- assertThat(location).usingRecursiveComparison().isEqualTo(expectedLocation);
- }
-
- @Test
- void shouldSerializeLocationOfTypeGpsPosition() {
- final var latitude = 33.3f;
- final var longitude = 86.4f;
-
- final var gpsPosition = new GpsPosition(latitude, longitude);
- final var locationTypeGpsPosition = new LocationTypeGpsPosition(gpsPosition);
- final var location = new Location(locationTypeGpsPosition);
-
- final var serializedGpsPosition =
- ContextOuterClass.GPS_Position.newBuilder()
- .setLatitude(latitude)
- .setLongitude(longitude)
- .build();
-
- final var expectedLocation =
- ContextOuterClass.Location.newBuilder().setGpsPosition(serializedGpsPosition).build();
-
- final var serializedLocation = serializer.serialize(location);
-
- assertThat(serializedLocation).isEqualTo(expectedLocation);
- }
-
- @Test
- void shouldDeserializeLocationOfTypeGpsPosition() {
- final var latitude = 33.3f;
- final var longitude = 86.4f;
-
- final var gpsPosition = new GpsPosition(latitude, longitude);
- final var locationTypeGpsPosition = new LocationTypeGpsPosition(gpsPosition);
- final var expectedLocation = new Location(locationTypeGpsPosition);
-
- final var serializedGpsPosition =
- ContextOuterClass.GPS_Position.newBuilder()
- .setLatitude(latitude)
- .setLongitude(longitude)
- .build();
-
- final var serializedLocation =
- ContextOuterClass.Location.newBuilder().setGpsPosition(serializedGpsPosition).build();
-
- final var location = serializer.deserialize(serializedLocation);
-
- assertThat(location).usingRecursiveComparison().isEqualTo(expectedLocation);
- }
-
- @Test
- void shouldThrowIllegalStateExceptionDuringDeserializationOfNonSpecifiedLocation() {
- final var serializedLocation = ContextOuterClass.Location.newBuilder().build();
-
- assertThatExceptionOfType(IllegalStateException.class)
- .isThrownBy(() -> serializer.deserialize(serializedLocation));
- }
-
- @Test
- void shouldSerializeEndPointWithAllAvailableFields() {
- final var expectedTopologyId = new TopologyId("contextId", "id");
- final var expectedDeviceId = "expectedDeviceId";
- final var expectedId = "expectedId";
- final var endPointId = new EndPointId(expectedTopologyId, expectedDeviceId, expectedId);
-
- final var endPointType = "endPointType";
- final var kpiSampleTypes =
- List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED);
- final var locationTypeRegion = new LocationTypeRegion("ATH");
- final var location = new Location(locationTypeRegion);
-
- final var endPoint =
- new EndPointBuilder(endPointId, endPointType, kpiSampleTypes).location(location).build();
-
- final var serializedEndPointId = serializer.serialize(endPointId);
- final var serializedKpiSampleTypes =
- kpiSampleTypes.stream().map(serializer::serialize).collect(Collectors.toList());
- final var serializedEndPointLocation = serializer.serialize(location);
-
- final var expectedEndPoint =
- ContextOuterClass.EndPoint.newBuilder()
- .setEndpointId(serializedEndPointId)
- .setEndpointType(endPointType)
- .addAllKpiSampleTypes(serializedKpiSampleTypes)
- .setEndpointLocation(serializedEndPointLocation)
- .build();
-
- final var serializedEndPoint = serializer.serialize(endPoint);
-
- assertThat(serializedEndPoint).isEqualTo(expectedEndPoint);
- }
-
- @Test
- void shouldDeserializeEndPointWithAllAvailableFields() {
- final var expectedTopologyId = new TopologyId("contextId", "id");
- final var expectedDeviceId = "expectedDeviceId";
- final var expectedId = "expectedId";
- final var endPointId = new EndPointId(expectedTopologyId, expectedDeviceId, expectedId);
-
- final var endPointType = "endPointType";
- final var kpiSampleTypes =
- List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED);
- final var locationTypeRegion = new LocationTypeRegion("ATH");
- final var location = new Location(locationTypeRegion);
-
- final var expectedEndPoint =
- new EndPointBuilder(endPointId, endPointType, kpiSampleTypes).location(location).build();
-
- final var serializedEndPointId = serializer.serialize(endPointId);
- final var serializedKpiSampleTypes =
- kpiSampleTypes.stream().map(serializer::serialize).collect(Collectors.toList());
- final var serializedEndPointLocation = serializer.serialize(location);
-
- final var serializedEndPoint =
- ContextOuterClass.EndPoint.newBuilder()
- .setEndpointId(serializedEndPointId)
- .setEndpointType(endPointType)
- .addAllKpiSampleTypes(serializedKpiSampleTypes)
- .setEndpointLocation(serializedEndPointLocation)
- .build();
-
- final var endPoint = serializer.deserialize(serializedEndPoint);
-
- assertThat(endPoint).usingRecursiveComparison().isEqualTo(expectedEndPoint);
- }
-
- @Test
- void shouldSerializeEndPointWithAllAvailableFieldsMissingLocation() {
- final var expectedTopologyId = new TopologyId("contextId", "id");
- final var expectedDeviceId = "expectedDeviceId";
- final var expectedId = "expectedId";
- final var endPointId = new EndPointId(expectedTopologyId, expectedDeviceId, expectedId);
-
- final var endPointType = "endPointType";
- final var kpiSampleTypes =
- List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED);
-
- final var endPoint = new EndPointBuilder(endPointId, endPointType, kpiSampleTypes).build();
-
- final var serializedEndPointId = serializer.serialize(endPointId);
- final var serializedKpiSampleTypes =
- kpiSampleTypes.stream().map(serializer::serialize).collect(Collectors.toList());
-
- final var expectedEndPoint =
- ContextOuterClass.EndPoint.newBuilder()
- .setEndpointId(serializedEndPointId)
- .setEndpointType(endPointType)
- .addAllKpiSampleTypes(serializedKpiSampleTypes)
- .build();
-
- final var serializedEndPoint = serializer.serialize(endPoint);
-
- assertThat(serializedEndPoint).isEqualTo(expectedEndPoint);
- }
-
- @Test
- void shouldDeserializeEndPointWithAllAvailableFieldsMissingLocation() {
- final var expectedTopologyId = new TopologyId("contextId", "id");
- final var expectedDeviceId = "expectedDeviceId";
- final var expectedId = "expectedId";
- final var endPointId = new EndPointId(expectedTopologyId, expectedDeviceId, expectedId);
-
- final var endPointType = "endPointType";
- final var kpiSampleTypes =
- List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED);
-
- final var expectedEndPoint =
- new EndPointBuilder(endPointId, endPointType, kpiSampleTypes).build();
-
- final var serializedEndPointId = serializer.serialize(endPointId);
- final var serializedKpiSampleTypes =
- kpiSampleTypes.stream().map(serializer::serialize).collect(Collectors.toList());
-
- final var serializedEndPoint =
- ContextOuterClass.EndPoint.newBuilder()
- .setEndpointId(serializedEndPointId)
- .setEndpointType(endPointType)
- .addAllKpiSampleTypes(serializedKpiSampleTypes)
- .build();
-
- final var endPoint = serializer.deserialize(serializedEndPoint);
-
- assertThat(endPoint).usingRecursiveComparison().isEqualTo(expectedEndPoint);
- }
-
- @Test
- void shouldSerializeDevice() {
- final var expectedConfigRuleCustomA =
- ContextOuterClass.ConfigRule_Custom.newBuilder()
- .setResourceKey("resourceKeyA")
- .setResourceValue("resourceValueA")
- .build();
- final var configRuleCustomA = new ConfigRuleCustom("resourceKeyA", "resourceValueA");
-
- final var expectedConfigRule =
- ContextOuterClass.ConfigRule.newBuilder()
- .setAction(ContextOuterClass.ConfigActionEnum.CONFIGACTION_SET)
- .setCustom(expectedConfigRuleCustomA)
- .build();
-
- final var configRuleTypeA = new ConfigRuleTypeCustom(configRuleCustomA);
- final var deviceConfig =
- new DeviceConfig(List.of(new ConfigRule(ConfigActionEnum.SET, configRuleTypeA)));
-
- final var deviceDrivers = List.of(DeviceDriverEnum.IETF_NETWORK_TOPOLOGY, DeviceDriverEnum.P4);
-
- final var expectedTopologyIdA = new TopologyId("contextIdA", "idA");
- final var expectedDeviceIdA = "expectedDeviceIdA";
- final var expectedIdA = "expectedIdA";
- final var endPointIdA = new EndPointId(expectedTopologyIdA, expectedDeviceIdA, expectedIdA);
-
- final var endPointTypeA = "endPointTypeA";
- final var kpiSampleTypesA =
- List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED);
- final var locationTypeRegionA = new LocationTypeRegion("ATH");
- final var locationA = new Location(locationTypeRegionA);
- final var endPointA =
- new EndPointBuilder(endPointIdA, endPointTypeA, kpiSampleTypesA)
- .location(locationA)
- .build();
-
- final var expectedTopologyIdB = new TopologyId("contextIdB", "idB");
- final var expectedDeviceIdB = "expectedDeviceIdB";
- final var expectedIdB = "expectedIdB";
- final var endPointIdB = new EndPointId(expectedTopologyIdB, expectedDeviceIdB, expectedIdB);
-
- final var endPointTypeB = "endPointTypeB";
- final var kpiSampleTypesB =
- List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED);
- final var locationTypeRegionB = new LocationTypeRegion("ATH");
- final var locationB = new Location(locationTypeRegionB);
- final var endPointB =
- new EndPointBuilder(endPointIdB, endPointTypeB, kpiSampleTypesB)
- .location(locationB)
- .build();
-
- final var endPoints = List.of(endPointA, endPointB);
-
- final var expectedDeviceConfig =
- ContextOuterClass.DeviceConfig.newBuilder().addConfigRules(expectedConfigRule).build();
-
- final var serializedDeviceId = serializer.serializeDeviceId("deviceId");
- final var serializedDrivers =
- deviceDrivers.stream()
- .map(deviceDriverEnum -> serializer.serialize(deviceDriverEnum))
- .collect(Collectors.toList());
-
- final var serializedEndPoints =
- endPoints.stream()
- .map(endPoint -> serializer.serialize(endPoint))
- .collect(Collectors.toList());
-
- final var deviceBuilder = ContextOuterClass.Device.newBuilder();
-
- deviceBuilder.setDeviceId(serializedDeviceId);
- deviceBuilder.setName("deviceName");
- deviceBuilder.setDeviceType("deviceType");
- deviceBuilder.setDeviceConfig(expectedDeviceConfig);
- deviceBuilder.setDeviceOperationalStatus(serializer.serialize(DeviceOperationalStatus.ENABLED));
- deviceBuilder.addAllDeviceDrivers(serializedDrivers);
- deviceBuilder.addAllDeviceEndpoints(serializedEndPoints);
-
- final var expectedDevice = deviceBuilder.build();
-
- final var device =
- new Device(
- "deviceId",
- "deviceName",
- "deviceType",
- deviceConfig,
- DeviceOperationalStatus.ENABLED,
- deviceDrivers,
- endPoints);
- final var serializedDevice = serializer.serialize(device);
-
- assertThat(serializedDevice).isEqualTo(expectedDevice);
- }
-
- @Test
- void shouldDeserializeDevice() {
- final var configRuleCustom = new ConfigRuleCustom("resourceKeyA", "resourceValueA");
- final var expectedConfigRuleCustom =
- ContextOuterClass.ConfigRule_Custom.newBuilder()
- .setResourceKey("resourceKeyA")
- .setResourceValue("resourceValueA")
- .build();
- final var configRuleType = new ConfigRuleTypeCustom(configRuleCustom);
-
- final var expectedConfig =
- new DeviceConfig(List.of(new ConfigRule(ConfigActionEnum.DELETE, configRuleType)));
-
- final var deviceDrivers = List.of(DeviceDriverEnum.IETF_NETWORK_TOPOLOGY, DeviceDriverEnum.P4);
-
- final var expectedTopologyIdA = new TopologyId("contextIdA", "idA");
- final var expectedDeviceIdA = "expectedDeviceIdA";
- final var expectedIdA = "expectedIdA";
- final var endPointIdA = new EndPointId(expectedTopologyIdA, expectedDeviceIdA, expectedIdA);
-
- final var endPointTypeA = "endPointTypeA";
- final var kpiSampleTypesA =
- List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED);
- final var locationTypeRegionA = new LocationTypeRegion("ATH");
- final var locationA = new Location(locationTypeRegionA);
- final var endPointA =
- new EndPointBuilder(endPointIdA, endPointTypeA, kpiSampleTypesA)
- .location(locationA)
- .build();
-
- final var expectedTopologyIdB = new TopologyId("contextIdB", "idB");
- final var expectedDeviceIdB = "expectedDeviceIdB";
- final var expectedIdB = "expectedIdB";
- final var endPointIdB = new EndPointId(expectedTopologyIdB, expectedDeviceIdB, expectedIdB);
-
- final var endPointTypeB = "endPointTypeB";
- final var kpiSampleTypesB =
- List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED);
- final var locationTypeRegionB = new LocationTypeRegion("ATH");
- final var locationB = new Location(locationTypeRegionB);
- final var endPointB =
- new EndPointBuilder(endPointIdB, endPointTypeB, kpiSampleTypesB)
- .location(locationB)
- .build();
-
- final var endPoints = List.of(endPointA, endPointB);
-
- final var expectedDevice =
- new Device(
- "deviceId",
- "deviceName",
- "deviceType",
- expectedConfig,
- DeviceOperationalStatus.ENABLED,
- deviceDrivers,
- endPoints);
-
- final var configRule =
- ContextOuterClass.ConfigRule.newBuilder()
- .setAction(ContextOuterClass.ConfigActionEnum.CONFIGACTION_DELETE)
- .setCustom(expectedConfigRuleCustom)
- .build();
- final var deviceConfig =
- ContextOuterClass.DeviceConfig.newBuilder().addConfigRules(configRule).build();
-
- final var serializedDeviceId = serializer.serializeDeviceId("deviceId");
- final var serializedDeviceOperationalStatus =
- serializer.serialize(DeviceOperationalStatus.ENABLED);
-
- final var serializedDrivers =
- deviceDrivers.stream()
- .map(deviceDriverEnum -> serializer.serialize(deviceDriverEnum))
- .collect(Collectors.toList());
-
- final var serializedEndPoints =
- endPoints.stream()
- .map(endPoint -> serializer.serialize(endPoint))
- .collect(Collectors.toList());
-
- final var deviceBuilder = ContextOuterClass.Device.newBuilder();
- deviceBuilder.setDeviceId(serializedDeviceId);
- deviceBuilder.setName("deviceName");
- deviceBuilder.setDeviceType("deviceType");
- deviceBuilder.setDeviceConfig(deviceConfig);
- deviceBuilder.setDeviceOperationalStatus(serializedDeviceOperationalStatus);
- deviceBuilder.addAllDeviceDrivers(serializedDrivers);
- deviceBuilder.addAllDeviceEndpoints(serializedEndPoints);
-
- final var serializedDevice = deviceBuilder.build();
- final var device = serializer.deserialize(serializedDevice);
-
- assertThat(device).usingRecursiveComparison().isEqualTo(expectedDevice);
- }
-
- @Test
- void shouldSerializeEmpty() {
- final var empty = new Empty();
- final var expectedEmpty = ContextOuterClass.Empty.newBuilder().build();
-
- final var serializeEmpty = serializer.serializeEmpty(empty);
-
- assertThat(serializeEmpty).isEqualTo(expectedEmpty);
- }
-
- @Test
- void shouldDeserializeEmpty() {
- final var expectedEmpty = new Empty();
-
- final var serializedEmpty = serializer.serializeEmpty(expectedEmpty);
-
- final var empty = serializer.deserializeEmpty(serializedEmpty);
-
- assertThat(empty).usingRecursiveComparison().isEqualTo(expectedEmpty);
- }
-
- @Test
- void shouldSerializeUuid() {
- final var expectedUuid = "uuid";
-
- final var serializeUuid = serializer.serializeUuid("uuid");
-
- assertThat(serializeUuid.getUuid()).isEqualTo(expectedUuid);
- }
-
- @Test
- void shouldDeserializeUuid() {
- final var expectedUuid = "uuid";
-
- final var uuid = serializer.deserialize(Uuid.newBuilder().setUuid("uuid").build());
-
- assertThat(uuid).isEqualTo(expectedUuid);
- }
-}
diff --git a/src/automation/target/generated-sources/grpc/acl/Acl.java b/src/automation/target/generated-sources/grpc/acl/Acl.java
deleted file mode 100644
index 521294eefdec36b373b99aaca5281be28e01d2db..0000000000000000000000000000000000000000
--- a/src/automation/target/generated-sources/grpc/acl/Acl.java
+++ /dev/null
@@ -1,4654 +0,0 @@
-// Generated by the protocol buffer compiler. DO NOT EDIT!
-// source: acl.proto
-
-package acl;
-
-public final class Acl {
- private Acl() {}
- public static void registerAllExtensions(
- com.google.protobuf.ExtensionRegistryLite registry) {
- }
-
- public static void registerAllExtensions(
- com.google.protobuf.ExtensionRegistry registry) {
- registerAllExtensions(
- (com.google.protobuf.ExtensionRegistryLite) registry);
- }
- /**
- * Protobuf enum {@code acl.AclRuleTypeEnum}
- */
- public enum AclRuleTypeEnum
- implements com.google.protobuf.ProtocolMessageEnum {
- /**
- * ACLRULETYPE_UNDEFINED = 0;
- */
- ACLRULETYPE_UNDEFINED(0),
- /**
- * ACLRULETYPE_IPV4 = 1;
- */
- ACLRULETYPE_IPV4(1),
- /**
- * ACLRULETYPE_IPV6 = 2;
- */
- ACLRULETYPE_IPV6(2),
- /**
- * ACLRULETYPE_L2 = 3;
- */
- ACLRULETYPE_L2(3),
- /**
- * ACLRULETYPE_MPLS = 4;
- */
- ACLRULETYPE_MPLS(4),
- /**
- * ACLRULETYPE_MIXED = 5;
- */
- ACLRULETYPE_MIXED(5),
- UNRECOGNIZED(-1),
- ;
-
- /**
- * ACLRULETYPE_UNDEFINED = 0;
- */
- public static final int ACLRULETYPE_UNDEFINED_VALUE = 0;
- /**
- * ACLRULETYPE_IPV4 = 1;
- */
- public static final int ACLRULETYPE_IPV4_VALUE = 1;
- /**
- * ACLRULETYPE_IPV6 = 2;
- */
- public static final int ACLRULETYPE_IPV6_VALUE = 2;
- /**
- * ACLRULETYPE_L2 = 3;
- */
- public static final int ACLRULETYPE_L2_VALUE = 3;
- /**
- * ACLRULETYPE_MPLS = 4;
- */
- public static final int ACLRULETYPE_MPLS_VALUE = 4;
- /**
- * ACLRULETYPE_MIXED = 5;
- */
- public static final int ACLRULETYPE_MIXED_VALUE = 5;
-
-
- public final int getNumber() {
- if (this == UNRECOGNIZED) {
- throw new java.lang.IllegalArgumentException(
- "Can't get the number of an unknown enum value.");
- }
- return value;
- }
-
- /**
- * @param value The numeric wire value of the corresponding enum entry.
- * @return The enum associated with the given numeric wire value.
- * @deprecated Use {@link #forNumber(int)} instead.
- */
- @java.lang.Deprecated
- public static AclRuleTypeEnum valueOf(int value) {
- return forNumber(value);
- }
-
- /**
- * @param value The numeric wire value of the corresponding enum entry.
- * @return The enum associated with the given numeric wire value.
- */
- public static AclRuleTypeEnum forNumber(int value) {
- switch (value) {
- case 0: return ACLRULETYPE_UNDEFINED;
- case 1: return ACLRULETYPE_IPV4;
- case 2: return ACLRULETYPE_IPV6;
- case 3: return ACLRULETYPE_L2;
- case 4: return ACLRULETYPE_MPLS;
- case 5: return ACLRULETYPE_MIXED;
- default: return null;
- }
- }
-
- public static com.google.protobuf.Internal.EnumLiteMap
- internalGetValueMap() {
- return internalValueMap;
- }
- private static final com.google.protobuf.Internal.EnumLiteMap<
- AclRuleTypeEnum> internalValueMap =
- new com.google.protobuf.Internal.EnumLiteMap() {
- public AclRuleTypeEnum findValueByNumber(int number) {
- return AclRuleTypeEnum.forNumber(number);
- }
- };
-
- public final com.google.protobuf.Descriptors.EnumValueDescriptor
- getValueDescriptor() {
- if (this == UNRECOGNIZED) {
- throw new java.lang.IllegalStateException(
- "Can't get the descriptor of an unrecognized enum value.");
- }
- return getDescriptor().getValues().get(ordinal());
- }
- public final com.google.protobuf.Descriptors.EnumDescriptor
- getDescriptorForType() {
- return getDescriptor();
- }
- public static final com.google.protobuf.Descriptors.EnumDescriptor
- getDescriptor() {
- return acl.Acl.getDescriptor().getEnumTypes().get(0);
- }
-
- private static final AclRuleTypeEnum[] VALUES = values();
-
- public static AclRuleTypeEnum valueOf(
- com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
- if (desc.getType() != getDescriptor()) {
- throw new java.lang.IllegalArgumentException(
- "EnumValueDescriptor is not for this type.");
- }
- if (desc.getIndex() == -1) {
- return UNRECOGNIZED;
- }
- return VALUES[desc.getIndex()];
- }
-
- private final int value;
-
- private AclRuleTypeEnum(int value) {
- this.value = value;
- }
-
- // @@protoc_insertion_point(enum_scope:acl.AclRuleTypeEnum)
- }
-
- /**
- * Protobuf enum {@code acl.AclForwardActionEnum}
- */
- public enum AclForwardActionEnum
- implements com.google.protobuf.ProtocolMessageEnum {
- /**
- * ACLFORWARDINGACTION_UNDEFINED = 0;
- */
- ACLFORWARDINGACTION_UNDEFINED(0),
- /**
- * ACLFORWARDINGACTION_DROP = 1;
- */
- ACLFORWARDINGACTION_DROP(1),
- /**
- * ACLFORWARDINGACTION_ACCEPT = 2;
- */
- ACLFORWARDINGACTION_ACCEPT(2),
- /**
- * ACLFORWARDINGACTION_REJECT = 3;
- */
- ACLFORWARDINGACTION_REJECT(3),
- UNRECOGNIZED(-1),
- ;
-
- /**
- * ACLFORWARDINGACTION_UNDEFINED = 0;
- */
- public static final int ACLFORWARDINGACTION_UNDEFINED_VALUE = 0;
- /**
- * ACLFORWARDINGACTION_DROP = 1;
- */
- public static final int ACLFORWARDINGACTION_DROP_VALUE = 1;
- /**
- * ACLFORWARDINGACTION_ACCEPT = 2;
- */
- public static final int ACLFORWARDINGACTION_ACCEPT_VALUE = 2;
- /**
- * ACLFORWARDINGACTION_REJECT = 3;
- */
- public static final int ACLFORWARDINGACTION_REJECT_VALUE = 3;
-
-
- public final int getNumber() {
- if (this == UNRECOGNIZED) {
- throw new java.lang.IllegalArgumentException(
- "Can't get the number of an unknown enum value.");
- }
- return value;
- }
-
- /**
- * @param value The numeric wire value of the corresponding enum entry.
- * @return The enum associated with the given numeric wire value.
- * @deprecated Use {@link #forNumber(int)} instead.
- */
- @java.lang.Deprecated
- public static AclForwardActionEnum valueOf(int value) {
- return forNumber(value);
- }
-
- /**
- * @param value The numeric wire value of the corresponding enum entry.
- * @return The enum associated with the given numeric wire value.
- */
- public static AclForwardActionEnum forNumber(int value) {
- switch (value) {
- case 0: return ACLFORWARDINGACTION_UNDEFINED;
- case 1: return ACLFORWARDINGACTION_DROP;
- case 2: return ACLFORWARDINGACTION_ACCEPT;
- case 3: return ACLFORWARDINGACTION_REJECT;
- default: return null;
- }
- }
-
- public static com.google.protobuf.Internal.EnumLiteMap
- internalGetValueMap() {
- return internalValueMap;
- }
- private static final com.google.protobuf.Internal.EnumLiteMap<
- AclForwardActionEnum> internalValueMap =
- new com.google.protobuf.Internal.EnumLiteMap() {
- public AclForwardActionEnum findValueByNumber(int number) {
- return AclForwardActionEnum.forNumber(number);
- }
- };
-
- public final com.google.protobuf.Descriptors.EnumValueDescriptor
- getValueDescriptor() {
- if (this == UNRECOGNIZED) {
- throw new java.lang.IllegalStateException(
- "Can't get the descriptor of an unrecognized enum value.");
- }
- return getDescriptor().getValues().get(ordinal());
- }
- public final com.google.protobuf.Descriptors.EnumDescriptor
- getDescriptorForType() {
- return getDescriptor();
- }
- public static final com.google.protobuf.Descriptors.EnumDescriptor
- getDescriptor() {
- return acl.Acl.getDescriptor().getEnumTypes().get(1);
- }
-
- private static final AclForwardActionEnum[] VALUES = values();
-
- public static AclForwardActionEnum valueOf(
- com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
- if (desc.getType() != getDescriptor()) {
- throw new java.lang.IllegalArgumentException(
- "EnumValueDescriptor is not for this type.");
- }
- if (desc.getIndex() == -1) {
- return UNRECOGNIZED;
- }
- return VALUES[desc.getIndex()];
- }
-
- private final int value;
-
- private AclForwardActionEnum(int value) {
- this.value = value;
- }
-
- // @@protoc_insertion_point(enum_scope:acl.AclForwardActionEnum)
- }
-
- /**
- * Protobuf enum {@code acl.AclLogActionEnum}
- */
- public enum AclLogActionEnum
- implements com.google.protobuf.ProtocolMessageEnum {
- /**
- * ACLLOGACTION_UNDEFINED = 0;
- */
- ACLLOGACTION_UNDEFINED(0),
- /**
- * ACLLOGACTION_NOLOG = 1;
- */
- ACLLOGACTION_NOLOG(1),
- /**
- * ACLLOGACTION_SYSLOG = 2;
- */
- ACLLOGACTION_SYSLOG(2),
- UNRECOGNIZED(-1),
- ;
-
- /**
- * ACLLOGACTION_UNDEFINED = 0;
- */
- public static final int ACLLOGACTION_UNDEFINED_VALUE = 0;
- /**
- * ACLLOGACTION_NOLOG = 1;
- */
- public static final int ACLLOGACTION_NOLOG_VALUE = 1;
- /**
- * ACLLOGACTION_SYSLOG = 2;
- */
- public static final int ACLLOGACTION_SYSLOG_VALUE = 2;
-
-
- public final int getNumber() {
- if (this == UNRECOGNIZED) {
- throw new java.lang.IllegalArgumentException(
- "Can't get the number of an unknown enum value.");
- }
- return value;
- }
-
- /**
- * @param value The numeric wire value of the corresponding enum entry.
- * @return The enum associated with the given numeric wire value.
- * @deprecated Use {@link #forNumber(int)} instead.
- */
- @java.lang.Deprecated
- public static AclLogActionEnum valueOf(int value) {
- return forNumber(value);
- }
-
- /**
- * @param value The numeric wire value of the corresponding enum entry.
- * @return The enum associated with the given numeric wire value.
- */
- public static AclLogActionEnum forNumber(int value) {
- switch (value) {
- case 0: return ACLLOGACTION_UNDEFINED;
- case 1: return ACLLOGACTION_NOLOG;
- case 2: return ACLLOGACTION_SYSLOG;
- default: return null;
- }
- }
-
- public static com.google.protobuf.Internal.EnumLiteMap
- internalGetValueMap() {
- return internalValueMap;
- }
- private static final com.google.protobuf.Internal.EnumLiteMap<
- AclLogActionEnum> internalValueMap =
- new com.google.protobuf.Internal.EnumLiteMap() {
- public AclLogActionEnum findValueByNumber(int number) {
- return AclLogActionEnum.forNumber(number);
- }
- };
-
- public final com.google.protobuf.Descriptors.EnumValueDescriptor
- getValueDescriptor() {
- if (this == UNRECOGNIZED) {
- throw new java.lang.IllegalStateException(
- "Can't get the descriptor of an unrecognized enum value.");
- }
- return getDescriptor().getValues().get(ordinal());
- }
- public final com.google.protobuf.Descriptors.EnumDescriptor
- getDescriptorForType() {
- return getDescriptor();
- }
- public static final com.google.protobuf.Descriptors.EnumDescriptor
- getDescriptor() {
- return acl.Acl.getDescriptor().getEnumTypes().get(2);
- }
-
- private static final AclLogActionEnum[] VALUES = values();
-
- public static AclLogActionEnum valueOf(
- com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
- if (desc.getType() != getDescriptor()) {
- throw new java.lang.IllegalArgumentException(
- "EnumValueDescriptor is not for this type.");
- }
- if (desc.getIndex() == -1) {
- return UNRECOGNIZED;
- }
- return VALUES[desc.getIndex()];
- }
-
- private final int value;
-
- private AclLogActionEnum(int value) {
- this.value = value;
- }
-
- // @@protoc_insertion_point(enum_scope:acl.AclLogActionEnum)
- }
-
- public interface AclMatchOrBuilder extends
- // @@protoc_insertion_point(interface_extends:acl.AclMatch)
- com.google.protobuf.MessageOrBuilder {
-
- /**
- * uint32 dscp = 1;
- * @return The dscp.
- */
- int getDscp();
-
- /**
- * uint32 protocol = 2;
- * @return The protocol.
- */
- int getProtocol();
-
- /**
- * string src_address = 3;
- * @return The srcAddress.
- */
- java.lang.String getSrcAddress();
- /**
- * string src_address = 3;
- * @return The bytes for srcAddress.
- */
- com.google.protobuf.ByteString
- getSrcAddressBytes();
-
- /**
- * string dst_address = 4;
- * @return The dstAddress.
- */
- java.lang.String getDstAddress();
- /**
- * string dst_address = 4;
- * @return The bytes for dstAddress.
- */
- com.google.protobuf.ByteString
- getDstAddressBytes();
-
- /**
- * uint32 src_port = 5;
- * @return The srcPort.
- */
- int getSrcPort();
-
- /**
- * uint32 dst_port = 6;
- * @return The dstPort.
- */
- int getDstPort();
-
- /**
- * uint32 start_mpls_label = 7;
- * @return The startMplsLabel.
- */
- int getStartMplsLabel();
-
- /**
- * uint32 end_mpls_label = 8;
- * @return The endMplsLabel.
- */
- int getEndMplsLabel();
- }
- /**
- * Protobuf type {@code acl.AclMatch}
- */
- public static final class AclMatch extends
- com.google.protobuf.GeneratedMessageV3 implements
- // @@protoc_insertion_point(message_implements:acl.AclMatch)
- AclMatchOrBuilder {
- private static final long serialVersionUID = 0L;
- // Use AclMatch.newBuilder() to construct.
- private AclMatch(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
- super(builder);
- }
- private AclMatch() {
- srcAddress_ = "";
- dstAddress_ = "";
- }
-
- @java.lang.Override
- @SuppressWarnings({"unused"})
- protected java.lang.Object newInstance(
- UnusedPrivateParameter unused) {
- return new AclMatch();
- }
-
- @java.lang.Override
- public final com.google.protobuf.UnknownFieldSet
- getUnknownFields() {
- return this.unknownFields;
- }
- private AclMatch(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- this();
- if (extensionRegistry == null) {
- throw new java.lang.NullPointerException();
- }
- com.google.protobuf.UnknownFieldSet.Builder unknownFields =
- com.google.protobuf.UnknownFieldSet.newBuilder();
- try {
- boolean done = false;
- while (!done) {
- int tag = input.readTag();
- switch (tag) {
- case 0:
- done = true;
- break;
- case 8: {
-
- dscp_ = input.readUInt32();
- break;
- }
- case 16: {
-
- protocol_ = input.readUInt32();
- break;
- }
- case 26: {
- java.lang.String s = input.readStringRequireUtf8();
-
- srcAddress_ = s;
- break;
- }
- case 34: {
- java.lang.String s = input.readStringRequireUtf8();
-
- dstAddress_ = s;
- break;
- }
- case 40: {
-
- srcPort_ = input.readUInt32();
- break;
- }
- case 48: {
-
- dstPort_ = input.readUInt32();
- break;
- }
- case 56: {
-
- startMplsLabel_ = input.readUInt32();
- break;
- }
- case 64: {
-
- endMplsLabel_ = input.readUInt32();
- break;
- }
- default: {
- if (!parseUnknownField(
- input, unknownFields, extensionRegistry, tag)) {
- done = true;
- }
- break;
- }
- }
- }
- } catch (com.google.protobuf.InvalidProtocolBufferException e) {
- throw e.setUnfinishedMessage(this);
- } catch (java.io.IOException e) {
- throw new com.google.protobuf.InvalidProtocolBufferException(
- e).setUnfinishedMessage(this);
- } finally {
- this.unknownFields = unknownFields.build();
- makeExtensionsImmutable();
- }
- }
- public static final com.google.protobuf.Descriptors.Descriptor
- getDescriptor() {
- return acl.Acl.internal_static_acl_AclMatch_descriptor;
- }
-
- @java.lang.Override
- protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
- internalGetFieldAccessorTable() {
- return acl.Acl.internal_static_acl_AclMatch_fieldAccessorTable
- .ensureFieldAccessorsInitialized(
- acl.Acl.AclMatch.class, acl.Acl.AclMatch.Builder.class);
- }
-
- public static final int DSCP_FIELD_NUMBER = 1;
- private int dscp_;
- /**
- * uint32 dscp = 1;
- * @return The dscp.
- */
- @java.lang.Override
- public int getDscp() {
- return dscp_;
- }
-
- public static final int PROTOCOL_FIELD_NUMBER = 2;
- private int protocol_;
- /**
- * uint32 protocol = 2;
- * @return The protocol.
- */
- @java.lang.Override
- public int getProtocol() {
- return protocol_;
- }
-
- public static final int SRC_ADDRESS_FIELD_NUMBER = 3;
- private volatile java.lang.Object srcAddress_;
- /**
- * string src_address = 3;
- * @return The srcAddress.
- */
- @java.lang.Override
- public java.lang.String getSrcAddress() {
- java.lang.Object ref = srcAddress_;
- if (ref instanceof java.lang.String) {
- return (java.lang.String) ref;
- } else {
- com.google.protobuf.ByteString bs =
- (com.google.protobuf.ByteString) ref;
- java.lang.String s = bs.toStringUtf8();
- srcAddress_ = s;
- return s;
- }
- }
- /**
- * string src_address = 3;
- * @return The bytes for srcAddress.
- */
- @java.lang.Override
- public com.google.protobuf.ByteString
- getSrcAddressBytes() {
- java.lang.Object ref = srcAddress_;
- if (ref instanceof java.lang.String) {
- com.google.protobuf.ByteString b =
- com.google.protobuf.ByteString.copyFromUtf8(
- (java.lang.String) ref);
- srcAddress_ = b;
- return b;
- } else {
- return (com.google.protobuf.ByteString) ref;
- }
- }
-
- public static final int DST_ADDRESS_FIELD_NUMBER = 4;
- private volatile java.lang.Object dstAddress_;
- /**
- * string dst_address = 4;
- * @return The dstAddress.
- */
- @java.lang.Override
- public java.lang.String getDstAddress() {
- java.lang.Object ref = dstAddress_;
- if (ref instanceof java.lang.String) {
- return (java.lang.String) ref;
- } else {
- com.google.protobuf.ByteString bs =
- (com.google.protobuf.ByteString) ref;
- java.lang.String s = bs.toStringUtf8();
- dstAddress_ = s;
- return s;
- }
- }
- /**
- * string dst_address = 4;
- * @return The bytes for dstAddress.
- */
- @java.lang.Override
- public com.google.protobuf.ByteString
- getDstAddressBytes() {
- java.lang.Object ref = dstAddress_;
- if (ref instanceof java.lang.String) {
- com.google.protobuf.ByteString b =
- com.google.protobuf.ByteString.copyFromUtf8(
- (java.lang.String) ref);
- dstAddress_ = b;
- return b;
- } else {
- return (com.google.protobuf.ByteString) ref;
- }
- }
-
- public static final int SRC_PORT_FIELD_NUMBER = 5;
- private int srcPort_;
- /**
- * uint32 src_port = 5;
- * @return The srcPort.
- */
- @java.lang.Override
- public int getSrcPort() {
- return srcPort_;
- }
-
- public static final int DST_PORT_FIELD_NUMBER = 6;
- private int dstPort_;
- /**
- * uint32 dst_port = 6;
- * @return The dstPort.
- */
- @java.lang.Override
- public int getDstPort() {
- return dstPort_;
- }
-
- public static final int START_MPLS_LABEL_FIELD_NUMBER = 7;
- private int startMplsLabel_;
- /**
- * uint32 start_mpls_label = 7;
- * @return The startMplsLabel.
- */
- @java.lang.Override
- public int getStartMplsLabel() {
- return startMplsLabel_;
- }
-
- public static final int END_MPLS_LABEL_FIELD_NUMBER = 8;
- private int endMplsLabel_;
- /**
- * uint32 end_mpls_label = 8;
- * @return The endMplsLabel.
- */
- @java.lang.Override
- public int getEndMplsLabel() {
- return endMplsLabel_;
- }
-
- private byte memoizedIsInitialized = -1;
- @java.lang.Override
- public final boolean isInitialized() {
- byte isInitialized = memoizedIsInitialized;
- if (isInitialized == 1) return true;
- if (isInitialized == 0) return false;
-
- memoizedIsInitialized = 1;
- return true;
- }
-
- @java.lang.Override
- public void writeTo(com.google.protobuf.CodedOutputStream output)
- throws java.io.IOException {
- if (dscp_ != 0) {
- output.writeUInt32(1, dscp_);
- }
- if (protocol_ != 0) {
- output.writeUInt32(2, protocol_);
- }
- if (!getSrcAddressBytes().isEmpty()) {
- com.google.protobuf.GeneratedMessageV3.writeString(output, 3, srcAddress_);
- }
- if (!getDstAddressBytes().isEmpty()) {
- com.google.protobuf.GeneratedMessageV3.writeString(output, 4, dstAddress_);
- }
- if (srcPort_ != 0) {
- output.writeUInt32(5, srcPort_);
- }
- if (dstPort_ != 0) {
- output.writeUInt32(6, dstPort_);
- }
- if (startMplsLabel_ != 0) {
- output.writeUInt32(7, startMplsLabel_);
- }
- if (endMplsLabel_ != 0) {
- output.writeUInt32(8, endMplsLabel_);
- }
- unknownFields.writeTo(output);
- }
-
- @java.lang.Override
- public int getSerializedSize() {
- int size = memoizedSize;
- if (size != -1) return size;
-
- size = 0;
- if (dscp_ != 0) {
- size += com.google.protobuf.CodedOutputStream
- .computeUInt32Size(1, dscp_);
- }
- if (protocol_ != 0) {
- size += com.google.protobuf.CodedOutputStream
- .computeUInt32Size(2, protocol_);
- }
- if (!getSrcAddressBytes().isEmpty()) {
- size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, srcAddress_);
- }
- if (!getDstAddressBytes().isEmpty()) {
- size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, dstAddress_);
- }
- if (srcPort_ != 0) {
- size += com.google.protobuf.CodedOutputStream
- .computeUInt32Size(5, srcPort_);
- }
- if (dstPort_ != 0) {
- size += com.google.protobuf.CodedOutputStream
- .computeUInt32Size(6, dstPort_);
- }
- if (startMplsLabel_ != 0) {
- size += com.google.protobuf.CodedOutputStream
- .computeUInt32Size(7, startMplsLabel_);
- }
- if (endMplsLabel_ != 0) {
- size += com.google.protobuf.CodedOutputStream
- .computeUInt32Size(8, endMplsLabel_);
- }
- size += unknownFields.getSerializedSize();
- memoizedSize = size;
- return size;
- }
-
- @java.lang.Override
- public boolean equals(final java.lang.Object obj) {
- if (obj == this) {
- return true;
- }
- if (!(obj instanceof acl.Acl.AclMatch)) {
- return super.equals(obj);
- }
- acl.Acl.AclMatch other = (acl.Acl.AclMatch) obj;
-
- if (getDscp()
- != other.getDscp()) return false;
- if (getProtocol()
- != other.getProtocol()) return false;
- if (!getSrcAddress()
- .equals(other.getSrcAddress())) return false;
- if (!getDstAddress()
- .equals(other.getDstAddress())) return false;
- if (getSrcPort()
- != other.getSrcPort()) return false;
- if (getDstPort()
- != other.getDstPort()) return false;
- if (getStartMplsLabel()
- != other.getStartMplsLabel()) return false;
- if (getEndMplsLabel()
- != other.getEndMplsLabel()) return false;
- if (!unknownFields.equals(other.unknownFields)) return false;
- return true;
- }
-
- @java.lang.Override
- public int hashCode() {
- if (memoizedHashCode != 0) {
- return memoizedHashCode;
- }
- int hash = 41;
- hash = (19 * hash) + getDescriptor().hashCode();
- hash = (37 * hash) + DSCP_FIELD_NUMBER;
- hash = (53 * hash) + getDscp();
- hash = (37 * hash) + PROTOCOL_FIELD_NUMBER;
- hash = (53 * hash) + getProtocol();
- hash = (37 * hash) + SRC_ADDRESS_FIELD_NUMBER;
- hash = (53 * hash) + getSrcAddress().hashCode();
- hash = (37 * hash) + DST_ADDRESS_FIELD_NUMBER;
- hash = (53 * hash) + getDstAddress().hashCode();
- hash = (37 * hash) + SRC_PORT_FIELD_NUMBER;
- hash = (53 * hash) + getSrcPort();
- hash = (37 * hash) + DST_PORT_FIELD_NUMBER;
- hash = (53 * hash) + getDstPort();
- hash = (37 * hash) + START_MPLS_LABEL_FIELD_NUMBER;
- hash = (53 * hash) + getStartMplsLabel();
- hash = (37 * hash) + END_MPLS_LABEL_FIELD_NUMBER;
- hash = (53 * hash) + getEndMplsLabel();
- hash = (29 * hash) + unknownFields.hashCode();
- memoizedHashCode = hash;
- return hash;
- }
-
- public static acl.Acl.AclMatch parseFrom(
- java.nio.ByteBuffer data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data);
- }
- public static acl.Acl.AclMatch parseFrom(
- java.nio.ByteBuffer data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data, extensionRegistry);
- }
- public static acl.Acl.AclMatch parseFrom(
- com.google.protobuf.ByteString data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data);
- }
- public static acl.Acl.AclMatch parseFrom(
- com.google.protobuf.ByteString data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data, extensionRegistry);
- }
- public static acl.Acl.AclMatch parseFrom(byte[] data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data);
- }
- public static acl.Acl.AclMatch parseFrom(
- byte[] data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data, extensionRegistry);
- }
- public static acl.Acl.AclMatch parseFrom(java.io.InputStream input)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input);
- }
- public static acl.Acl.AclMatch parseFrom(
- java.io.InputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input, extensionRegistry);
- }
- public static acl.Acl.AclMatch parseDelimitedFrom(java.io.InputStream input)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseDelimitedWithIOException(PARSER, input);
- }
- public static acl.Acl.AclMatch parseDelimitedFrom(
- java.io.InputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
- }
- public static acl.Acl.AclMatch parseFrom(
- com.google.protobuf.CodedInputStream input)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input);
- }
- public static acl.Acl.AclMatch parseFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input, extensionRegistry);
- }
-
- @java.lang.Override
- public Builder newBuilderForType() { return newBuilder(); }
- public static Builder newBuilder() {
- return DEFAULT_INSTANCE.toBuilder();
- }
- public static Builder newBuilder(acl.Acl.AclMatch prototype) {
- return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
- }
- @java.lang.Override
- public Builder toBuilder() {
- return this == DEFAULT_INSTANCE
- ? new Builder() : new Builder().mergeFrom(this);
- }
-
- @java.lang.Override
- protected Builder newBuilderForType(
- com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
- Builder builder = new Builder(parent);
- return builder;
- }
- /**
- * Protobuf type {@code acl.AclMatch}
- */
- public static final class Builder extends
- com.google.protobuf.GeneratedMessageV3.Builder implements
- // @@protoc_insertion_point(builder_implements:acl.AclMatch)
- acl.Acl.AclMatchOrBuilder {
- public static final com.google.protobuf.Descriptors.Descriptor
- getDescriptor() {
- return acl.Acl.internal_static_acl_AclMatch_descriptor;
- }
-
- @java.lang.Override
- protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
- internalGetFieldAccessorTable() {
- return acl.Acl.internal_static_acl_AclMatch_fieldAccessorTable
- .ensureFieldAccessorsInitialized(
- acl.Acl.AclMatch.class, acl.Acl.AclMatch.Builder.class);
- }
-
- // Construct using acl.Acl.AclMatch.newBuilder()
- private Builder() {
- maybeForceBuilderInitialization();
- }
-
- private Builder(
- com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
- super(parent);
- maybeForceBuilderInitialization();
- }
- private void maybeForceBuilderInitialization() {
- if (com.google.protobuf.GeneratedMessageV3
- .alwaysUseFieldBuilders) {
- }
- }
- @java.lang.Override
- public Builder clear() {
- super.clear();
- dscp_ = 0;
-
- protocol_ = 0;
-
- srcAddress_ = "";
-
- dstAddress_ = "";
-
- srcPort_ = 0;
-
- dstPort_ = 0;
-
- startMplsLabel_ = 0;
-
- endMplsLabel_ = 0;
-
- return this;
- }
-
- @java.lang.Override
- public com.google.protobuf.Descriptors.Descriptor
- getDescriptorForType() {
- return acl.Acl.internal_static_acl_AclMatch_descriptor;
- }
-
- @java.lang.Override
- public acl.Acl.AclMatch getDefaultInstanceForType() {
- return acl.Acl.AclMatch.getDefaultInstance();
- }
-
- @java.lang.Override
- public acl.Acl.AclMatch build() {
- acl.Acl.AclMatch result = buildPartial();
- if (!result.isInitialized()) {
- throw newUninitializedMessageException(result);
- }
- return result;
- }
-
- @java.lang.Override
- public acl.Acl.AclMatch buildPartial() {
- acl.Acl.AclMatch result = new acl.Acl.AclMatch(this);
- result.dscp_ = dscp_;
- result.protocol_ = protocol_;
- result.srcAddress_ = srcAddress_;
- result.dstAddress_ = dstAddress_;
- result.srcPort_ = srcPort_;
- result.dstPort_ = dstPort_;
- result.startMplsLabel_ = startMplsLabel_;
- result.endMplsLabel_ = endMplsLabel_;
- onBuilt();
- return result;
- }
-
- @java.lang.Override
- public Builder clone() {
- return super.clone();
- }
- @java.lang.Override
- public Builder setField(
- com.google.protobuf.Descriptors.FieldDescriptor field,
- java.lang.Object value) {
- return super.setField(field, value);
- }
- @java.lang.Override
- public Builder clearField(
- com.google.protobuf.Descriptors.FieldDescriptor field) {
- return super.clearField(field);
- }
- @java.lang.Override
- public Builder clearOneof(
- com.google.protobuf.Descriptors.OneofDescriptor oneof) {
- return super.clearOneof(oneof);
- }
- @java.lang.Override
- public Builder setRepeatedField(
- com.google.protobuf.Descriptors.FieldDescriptor field,
- int index, java.lang.Object value) {
- return super.setRepeatedField(field, index, value);
- }
- @java.lang.Override
- public Builder addRepeatedField(
- com.google.protobuf.Descriptors.FieldDescriptor field,
- java.lang.Object value) {
- return super.addRepeatedField(field, value);
- }
- @java.lang.Override
- public Builder mergeFrom(com.google.protobuf.Message other) {
- if (other instanceof acl.Acl.AclMatch) {
- return mergeFrom((acl.Acl.AclMatch)other);
- } else {
- super.mergeFrom(other);
- return this;
- }
- }
-
- public Builder mergeFrom(acl.Acl.AclMatch other) {
- if (other == acl.Acl.AclMatch.getDefaultInstance()) return this;
- if (other.getDscp() != 0) {
- setDscp(other.getDscp());
- }
- if (other.getProtocol() != 0) {
- setProtocol(other.getProtocol());
- }
- if (!other.getSrcAddress().isEmpty()) {
- srcAddress_ = other.srcAddress_;
- onChanged();
- }
- if (!other.getDstAddress().isEmpty()) {
- dstAddress_ = other.dstAddress_;
- onChanged();
- }
- if (other.getSrcPort() != 0) {
- setSrcPort(other.getSrcPort());
- }
- if (other.getDstPort() != 0) {
- setDstPort(other.getDstPort());
- }
- if (other.getStartMplsLabel() != 0) {
- setStartMplsLabel(other.getStartMplsLabel());
- }
- if (other.getEndMplsLabel() != 0) {
- setEndMplsLabel(other.getEndMplsLabel());
- }
- this.mergeUnknownFields(other.unknownFields);
- onChanged();
- return this;
- }
-
- @java.lang.Override
- public final boolean isInitialized() {
- return true;
- }
-
- @java.lang.Override
- public Builder mergeFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- acl.Acl.AclMatch parsedMessage = null;
- try {
- parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
- } catch (com.google.protobuf.InvalidProtocolBufferException e) {
- parsedMessage = (acl.Acl.AclMatch) e.getUnfinishedMessage();
- throw e.unwrapIOException();
- } finally {
- if (parsedMessage != null) {
- mergeFrom(parsedMessage);
- }
- }
- return this;
- }
-
- private int dscp_ ;
- /**
- * uint32 dscp = 1;
- * @return The dscp.
- */
- @java.lang.Override
- public int getDscp() {
- return dscp_;
- }
- /**
- * uint32 dscp = 1;
- * @param value The dscp to set.
- * @return This builder for chaining.
- */
- public Builder setDscp(int value) {
-
- dscp_ = value;
- onChanged();
- return this;
- }
- /**
- * uint32 dscp = 1;
- * @return This builder for chaining.
- */
- public Builder clearDscp() {
-
- dscp_ = 0;
- onChanged();
- return this;
- }
-
- private int protocol_ ;
- /**
- * uint32 protocol = 2;
- * @return The protocol.
- */
- @java.lang.Override
- public int getProtocol() {
- return protocol_;
- }
- /**
- * uint32 protocol = 2;
- * @param value The protocol to set.
- * @return This builder for chaining.
- */
- public Builder setProtocol(int value) {
-
- protocol_ = value;
- onChanged();
- return this;
- }
- /**
- * uint32 protocol = 2;
- * @return This builder for chaining.
- */
- public Builder clearProtocol() {
-
- protocol_ = 0;
- onChanged();
- return this;
- }
-
- private java.lang.Object srcAddress_ = "";
- /**
- * string src_address = 3;
- * @return The srcAddress.
- */
- public java.lang.String getSrcAddress() {
- java.lang.Object ref = srcAddress_;
- if (!(ref instanceof java.lang.String)) {
- com.google.protobuf.ByteString bs =
- (com.google.protobuf.ByteString) ref;
- java.lang.String s = bs.toStringUtf8();
- srcAddress_ = s;
- return s;
- } else {
- return (java.lang.String) ref;
- }
- }
- /**
- * string src_address = 3;
- * @return The bytes for srcAddress.
- */
- public com.google.protobuf.ByteString
- getSrcAddressBytes() {
- java.lang.Object ref = srcAddress_;
- if (ref instanceof String) {
- com.google.protobuf.ByteString b =
- com.google.protobuf.ByteString.copyFromUtf8(
- (java.lang.String) ref);
- srcAddress_ = b;
- return b;
- } else {
- return (com.google.protobuf.ByteString) ref;
- }
- }
- /**
- * string src_address = 3;
- * @param value The srcAddress to set.
- * @return This builder for chaining.
- */
- public Builder setSrcAddress(
- java.lang.String value) {
- if (value == null) {
- throw new NullPointerException();
- }
-
- srcAddress_ = value;
- onChanged();
- return this;
- }
- /**
- * string src_address = 3;
- * @return This builder for chaining.
- */
- public Builder clearSrcAddress() {
-
- srcAddress_ = getDefaultInstance().getSrcAddress();
- onChanged();
- return this;
- }
- /**
- * string src_address = 3;
- * @param value The bytes for srcAddress to set.
- * @return This builder for chaining.
- */
- public Builder setSrcAddressBytes(
- com.google.protobuf.ByteString value) {
- if (value == null) {
- throw new NullPointerException();
- }
- checkByteStringIsUtf8(value);
-
- srcAddress_ = value;
- onChanged();
- return this;
- }
-
- private java.lang.Object dstAddress_ = "";
- /**
- * string dst_address = 4;
- * @return The dstAddress.
- */
- public java.lang.String getDstAddress() {
- java.lang.Object ref = dstAddress_;
- if (!(ref instanceof java.lang.String)) {
- com.google.protobuf.ByteString bs =
- (com.google.protobuf.ByteString) ref;
- java.lang.String s = bs.toStringUtf8();
- dstAddress_ = s;
- return s;
- } else {
- return (java.lang.String) ref;
- }
- }
- /**
- * string dst_address = 4;
- * @return The bytes for dstAddress.
- */
- public com.google.protobuf.ByteString
- getDstAddressBytes() {
- java.lang.Object ref = dstAddress_;
- if (ref instanceof String) {
- com.google.protobuf.ByteString b =
- com.google.protobuf.ByteString.copyFromUtf8(
- (java.lang.String) ref);
- dstAddress_ = b;
- return b;
- } else {
- return (com.google.protobuf.ByteString) ref;
- }
- }
- /**
- * string dst_address = 4;
- * @param value The dstAddress to set.
- * @return This builder for chaining.
- */
- public Builder setDstAddress(
- java.lang.String value) {
- if (value == null) {
- throw new NullPointerException();
- }
-
- dstAddress_ = value;
- onChanged();
- return this;
- }
- /**
- * string dst_address = 4;
- * @return This builder for chaining.
- */
- public Builder clearDstAddress() {
-
- dstAddress_ = getDefaultInstance().getDstAddress();
- onChanged();
- return this;
- }
- /**
- * string dst_address = 4;
- * @param value The bytes for dstAddress to set.
- * @return This builder for chaining.
- */
- public Builder setDstAddressBytes(
- com.google.protobuf.ByteString value) {
- if (value == null) {
- throw new NullPointerException();
- }
- checkByteStringIsUtf8(value);
-
- dstAddress_ = value;
- onChanged();
- return this;
- }
-
- private int srcPort_ ;
- /**
- * uint32 src_port = 5;
- * @return The srcPort.
- */
- @java.lang.Override
- public int getSrcPort() {
- return srcPort_;
- }
- /**
- * uint32 src_port = 5;
- * @param value The srcPort to set.
- * @return This builder for chaining.
- */
- public Builder setSrcPort(int value) {
-
- srcPort_ = value;
- onChanged();
- return this;
- }
- /**
- * uint32 src_port = 5;
- * @return This builder for chaining.
- */
- public Builder clearSrcPort() {
-
- srcPort_ = 0;
- onChanged();
- return this;
- }
-
- private int dstPort_ ;
- /**
- * uint32 dst_port = 6;
- * @return The dstPort.
- */
- @java.lang.Override
- public int getDstPort() {
- return dstPort_;
- }
- /**
- * uint32 dst_port = 6;
- * @param value The dstPort to set.
- * @return This builder for chaining.
- */
- public Builder setDstPort(int value) {
-
- dstPort_ = value;
- onChanged();
- return this;
- }
- /**
- * uint32 dst_port = 6;
- * @return This builder for chaining.
- */
- public Builder clearDstPort() {
-
- dstPort_ = 0;
- onChanged();
- return this;
- }
-
- private int startMplsLabel_ ;
- /**
- * uint32 start_mpls_label = 7;
- * @return The startMplsLabel.
- */
- @java.lang.Override
- public int getStartMplsLabel() {
- return startMplsLabel_;
- }
- /**
- * uint32 start_mpls_label = 7;
- * @param value The startMplsLabel to set.
- * @return This builder for chaining.
- */
- public Builder setStartMplsLabel(int value) {
-
- startMplsLabel_ = value;
- onChanged();
- return this;
- }
- /**
- * uint32 start_mpls_label = 7;
- * @return This builder for chaining.
- */
- public Builder clearStartMplsLabel() {
-
- startMplsLabel_ = 0;
- onChanged();
- return this;
- }
-
- private int endMplsLabel_ ;
- /**
- * uint32 end_mpls_label = 8;
- * @return The endMplsLabel.
- */
- @java.lang.Override
- public int getEndMplsLabel() {
- return endMplsLabel_;
- }
- /**
- * uint32 end_mpls_label = 8;
- * @param value The endMplsLabel to set.
- * @return This builder for chaining.
- */
- public Builder setEndMplsLabel(int value) {
-
- endMplsLabel_ = value;
- onChanged();
- return this;
- }
- /**
- * uint32 end_mpls_label = 8;
- * @return This builder for chaining.
- */
- public Builder clearEndMplsLabel() {
-
- endMplsLabel_ = 0;
- onChanged();
- return this;
- }
- @java.lang.Override
- public final Builder setUnknownFields(
- final com.google.protobuf.UnknownFieldSet unknownFields) {
- return super.setUnknownFields(unknownFields);
- }
-
- @java.lang.Override
- public final Builder mergeUnknownFields(
- final com.google.protobuf.UnknownFieldSet unknownFields) {
- return super.mergeUnknownFields(unknownFields);
- }
-
-
- // @@protoc_insertion_point(builder_scope:acl.AclMatch)
- }
-
- // @@protoc_insertion_point(class_scope:acl.AclMatch)
- private static final acl.Acl.AclMatch DEFAULT_INSTANCE;
- static {
- DEFAULT_INSTANCE = new acl.Acl.AclMatch();
- }
-
- public static acl.Acl.AclMatch getDefaultInstance() {
- return DEFAULT_INSTANCE;
- }
-
- private static final com.google.protobuf.Parser
- PARSER = new com.google.protobuf.AbstractParser() {
- @java.lang.Override
- public AclMatch parsePartialFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return new AclMatch(input, extensionRegistry);
- }
- };
-
- public static com.google.protobuf.Parser parser() {
- return PARSER;
- }
-
- @java.lang.Override
- public com.google.protobuf.Parser getParserForType() {
- return PARSER;
- }
-
- @java.lang.Override
- public acl.Acl.AclMatch getDefaultInstanceForType() {
- return DEFAULT_INSTANCE;
- }
-
- }
-
- public interface AclActionOrBuilder extends
- // @@protoc_insertion_point(interface_extends:acl.AclAction)
- com.google.protobuf.MessageOrBuilder {
-
- /**
- * .acl.AclForwardActionEnum forward_action = 1;
- * @return The enum numeric value on the wire for forwardAction.
- */
- int getForwardActionValue();
- /**
- * .acl.AclForwardActionEnum forward_action = 1;
- * @return The forwardAction.
- */
- acl.Acl.AclForwardActionEnum getForwardAction();
-
- /**
- * .acl.AclLogActionEnum log_action = 2;
- * @return The enum numeric value on the wire for logAction.
- */
- int getLogActionValue();
- /**
- * .acl.AclLogActionEnum log_action = 2;
- * @return The logAction.
- */
- acl.Acl.AclLogActionEnum getLogAction();
- }
- /**
- * Protobuf type {@code acl.AclAction}
- */
- public static final class AclAction extends
- com.google.protobuf.GeneratedMessageV3 implements
- // @@protoc_insertion_point(message_implements:acl.AclAction)
- AclActionOrBuilder {
- private static final long serialVersionUID = 0L;
- // Use AclAction.newBuilder() to construct.
- private AclAction(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
- super(builder);
- }
- private AclAction() {
- forwardAction_ = 0;
- logAction_ = 0;
- }
-
- @java.lang.Override
- @SuppressWarnings({"unused"})
- protected java.lang.Object newInstance(
- UnusedPrivateParameter unused) {
- return new AclAction();
- }
-
- @java.lang.Override
- public final com.google.protobuf.UnknownFieldSet
- getUnknownFields() {
- return this.unknownFields;
- }
- private AclAction(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- this();
- if (extensionRegistry == null) {
- throw new java.lang.NullPointerException();
- }
- com.google.protobuf.UnknownFieldSet.Builder unknownFields =
- com.google.protobuf.UnknownFieldSet.newBuilder();
- try {
- boolean done = false;
- while (!done) {
- int tag = input.readTag();
- switch (tag) {
- case 0:
- done = true;
- break;
- case 8: {
- int rawValue = input.readEnum();
-
- forwardAction_ = rawValue;
- break;
- }
- case 16: {
- int rawValue = input.readEnum();
-
- logAction_ = rawValue;
- break;
- }
- default: {
- if (!parseUnknownField(
- input, unknownFields, extensionRegistry, tag)) {
- done = true;
- }
- break;
- }
- }
- }
- } catch (com.google.protobuf.InvalidProtocolBufferException e) {
- throw e.setUnfinishedMessage(this);
- } catch (java.io.IOException e) {
- throw new com.google.protobuf.InvalidProtocolBufferException(
- e).setUnfinishedMessage(this);
- } finally {
- this.unknownFields = unknownFields.build();
- makeExtensionsImmutable();
- }
- }
- public static final com.google.protobuf.Descriptors.Descriptor
- getDescriptor() {
- return acl.Acl.internal_static_acl_AclAction_descriptor;
- }
-
- @java.lang.Override
- protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
- internalGetFieldAccessorTable() {
- return acl.Acl.internal_static_acl_AclAction_fieldAccessorTable
- .ensureFieldAccessorsInitialized(
- acl.Acl.AclAction.class, acl.Acl.AclAction.Builder.class);
- }
-
- public static final int FORWARD_ACTION_FIELD_NUMBER = 1;
- private int forwardAction_;
- /**
- * .acl.AclForwardActionEnum forward_action = 1;
- * @return The enum numeric value on the wire for forwardAction.
- */
- @java.lang.Override public int getForwardActionValue() {
- return forwardAction_;
- }
- /**
- * .acl.AclForwardActionEnum forward_action = 1;
- * @return The forwardAction.
- */
- @java.lang.Override public acl.Acl.AclForwardActionEnum getForwardAction() {
- @SuppressWarnings("deprecation")
- acl.Acl.AclForwardActionEnum result = acl.Acl.AclForwardActionEnum.valueOf(forwardAction_);
- return result == null ? acl.Acl.AclForwardActionEnum.UNRECOGNIZED : result;
- }
-
- public static final int LOG_ACTION_FIELD_NUMBER = 2;
- private int logAction_;
- /**
- * .acl.AclLogActionEnum log_action = 2;
- * @return The enum numeric value on the wire for logAction.
- */
- @java.lang.Override public int getLogActionValue() {
- return logAction_;
- }
- /**
- * .acl.AclLogActionEnum log_action = 2;
- * @return The logAction.
- */
- @java.lang.Override public acl.Acl.AclLogActionEnum getLogAction() {
- @SuppressWarnings("deprecation")
- acl.Acl.AclLogActionEnum result = acl.Acl.AclLogActionEnum.valueOf(logAction_);
- return result == null ? acl.Acl.AclLogActionEnum.UNRECOGNIZED : result;
- }
-
- private byte memoizedIsInitialized = -1;
- @java.lang.Override
- public final boolean isInitialized() {
- byte isInitialized = memoizedIsInitialized;
- if (isInitialized == 1) return true;
- if (isInitialized == 0) return false;
-
- memoizedIsInitialized = 1;
- return true;
- }
-
- @java.lang.Override
- public void writeTo(com.google.protobuf.CodedOutputStream output)
- throws java.io.IOException {
- if (forwardAction_ != acl.Acl.AclForwardActionEnum.ACLFORWARDINGACTION_UNDEFINED.getNumber()) {
- output.writeEnum(1, forwardAction_);
- }
- if (logAction_ != acl.Acl.AclLogActionEnum.ACLLOGACTION_UNDEFINED.getNumber()) {
- output.writeEnum(2, logAction_);
- }
- unknownFields.writeTo(output);
- }
-
- @java.lang.Override
- public int getSerializedSize() {
- int size = memoizedSize;
- if (size != -1) return size;
-
- size = 0;
- if (forwardAction_ != acl.Acl.AclForwardActionEnum.ACLFORWARDINGACTION_UNDEFINED.getNumber()) {
- size += com.google.protobuf.CodedOutputStream
- .computeEnumSize(1, forwardAction_);
- }
- if (logAction_ != acl.Acl.AclLogActionEnum.ACLLOGACTION_UNDEFINED.getNumber()) {
- size += com.google.protobuf.CodedOutputStream
- .computeEnumSize(2, logAction_);
- }
- size += unknownFields.getSerializedSize();
- memoizedSize = size;
- return size;
- }
-
- @java.lang.Override
- public boolean equals(final java.lang.Object obj) {
- if (obj == this) {
- return true;
- }
- if (!(obj instanceof acl.Acl.AclAction)) {
- return super.equals(obj);
- }
- acl.Acl.AclAction other = (acl.Acl.AclAction) obj;
-
- if (forwardAction_ != other.forwardAction_) return false;
- if (logAction_ != other.logAction_) return false;
- if (!unknownFields.equals(other.unknownFields)) return false;
- return true;
- }
-
- @java.lang.Override
- public int hashCode() {
- if (memoizedHashCode != 0) {
- return memoizedHashCode;
- }
- int hash = 41;
- hash = (19 * hash) + getDescriptor().hashCode();
- hash = (37 * hash) + FORWARD_ACTION_FIELD_NUMBER;
- hash = (53 * hash) + forwardAction_;
- hash = (37 * hash) + LOG_ACTION_FIELD_NUMBER;
- hash = (53 * hash) + logAction_;
- hash = (29 * hash) + unknownFields.hashCode();
- memoizedHashCode = hash;
- return hash;
- }
-
- public static acl.Acl.AclAction parseFrom(
- java.nio.ByteBuffer data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data);
- }
- public static acl.Acl.AclAction parseFrom(
- java.nio.ByteBuffer data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data, extensionRegistry);
- }
- public static acl.Acl.AclAction parseFrom(
- com.google.protobuf.ByteString data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data);
- }
- public static acl.Acl.AclAction parseFrom(
- com.google.protobuf.ByteString data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data, extensionRegistry);
- }
- public static acl.Acl.AclAction parseFrom(byte[] data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data);
- }
- public static acl.Acl.AclAction parseFrom(
- byte[] data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data, extensionRegistry);
- }
- public static acl.Acl.AclAction parseFrom(java.io.InputStream input)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input);
- }
- public static acl.Acl.AclAction parseFrom(
- java.io.InputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input, extensionRegistry);
- }
- public static acl.Acl.AclAction parseDelimitedFrom(java.io.InputStream input)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseDelimitedWithIOException(PARSER, input);
- }
- public static acl.Acl.AclAction parseDelimitedFrom(
- java.io.InputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
- }
- public static acl.Acl.AclAction parseFrom(
- com.google.protobuf.CodedInputStream input)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input);
- }
- public static acl.Acl.AclAction parseFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input, extensionRegistry);
- }
-
- @java.lang.Override
- public Builder newBuilderForType() { return newBuilder(); }
- public static Builder newBuilder() {
- return DEFAULT_INSTANCE.toBuilder();
- }
- public static Builder newBuilder(acl.Acl.AclAction prototype) {
- return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
- }
- @java.lang.Override
- public Builder toBuilder() {
- return this == DEFAULT_INSTANCE
- ? new Builder() : new Builder().mergeFrom(this);
- }
-
- @java.lang.Override
- protected Builder newBuilderForType(
- com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
- Builder builder = new Builder(parent);
- return builder;
- }
- /**
- * Protobuf type {@code acl.AclAction}
- */
- public static final class Builder extends
- com.google.protobuf.GeneratedMessageV3.Builder implements
- // @@protoc_insertion_point(builder_implements:acl.AclAction)
- acl.Acl.AclActionOrBuilder {
- public static final com.google.protobuf.Descriptors.Descriptor
- getDescriptor() {
- return acl.Acl.internal_static_acl_AclAction_descriptor;
- }
-
- @java.lang.Override
- protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
- internalGetFieldAccessorTable() {
- return acl.Acl.internal_static_acl_AclAction_fieldAccessorTable
- .ensureFieldAccessorsInitialized(
- acl.Acl.AclAction.class, acl.Acl.AclAction.Builder.class);
- }
-
- // Construct using acl.Acl.AclAction.newBuilder()
- private Builder() {
- maybeForceBuilderInitialization();
- }
-
- private Builder(
- com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
- super(parent);
- maybeForceBuilderInitialization();
- }
- private void maybeForceBuilderInitialization() {
- if (com.google.protobuf.GeneratedMessageV3
- .alwaysUseFieldBuilders) {
- }
- }
- @java.lang.Override
- public Builder clear() {
- super.clear();
- forwardAction_ = 0;
-
- logAction_ = 0;
-
- return this;
- }
-
- @java.lang.Override
- public com.google.protobuf.Descriptors.Descriptor
- getDescriptorForType() {
- return acl.Acl.internal_static_acl_AclAction_descriptor;
- }
-
- @java.lang.Override
- public acl.Acl.AclAction getDefaultInstanceForType() {
- return acl.Acl.AclAction.getDefaultInstance();
- }
-
- @java.lang.Override
- public acl.Acl.AclAction build() {
- acl.Acl.AclAction result = buildPartial();
- if (!result.isInitialized()) {
- throw newUninitializedMessageException(result);
- }
- return result;
- }
-
- @java.lang.Override
- public acl.Acl.AclAction buildPartial() {
- acl.Acl.AclAction result = new acl.Acl.AclAction(this);
- result.forwardAction_ = forwardAction_;
- result.logAction_ = logAction_;
- onBuilt();
- return result;
- }
-
- @java.lang.Override
- public Builder clone() {
- return super.clone();
- }
- @java.lang.Override
- public Builder setField(
- com.google.protobuf.Descriptors.FieldDescriptor field,
- java.lang.Object value) {
- return super.setField(field, value);
- }
- @java.lang.Override
- public Builder clearField(
- com.google.protobuf.Descriptors.FieldDescriptor field) {
- return super.clearField(field);
- }
- @java.lang.Override
- public Builder clearOneof(
- com.google.protobuf.Descriptors.OneofDescriptor oneof) {
- return super.clearOneof(oneof);
- }
- @java.lang.Override
- public Builder setRepeatedField(
- com.google.protobuf.Descriptors.FieldDescriptor field,
- int index, java.lang.Object value) {
- return super.setRepeatedField(field, index, value);
- }
- @java.lang.Override
- public Builder addRepeatedField(
- com.google.protobuf.Descriptors.FieldDescriptor field,
- java.lang.Object value) {
- return super.addRepeatedField(field, value);
- }
- @java.lang.Override
- public Builder mergeFrom(com.google.protobuf.Message other) {
- if (other instanceof acl.Acl.AclAction) {
- return mergeFrom((acl.Acl.AclAction)other);
- } else {
- super.mergeFrom(other);
- return this;
- }
- }
-
- public Builder mergeFrom(acl.Acl.AclAction other) {
- if (other == acl.Acl.AclAction.getDefaultInstance()) return this;
- if (other.forwardAction_ != 0) {
- setForwardActionValue(other.getForwardActionValue());
- }
- if (other.logAction_ != 0) {
- setLogActionValue(other.getLogActionValue());
- }
- this.mergeUnknownFields(other.unknownFields);
- onChanged();
- return this;
- }
-
- @java.lang.Override
- public final boolean isInitialized() {
- return true;
- }
-
- @java.lang.Override
- public Builder mergeFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- acl.Acl.AclAction parsedMessage = null;
- try {
- parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
- } catch (com.google.protobuf.InvalidProtocolBufferException e) {
- parsedMessage = (acl.Acl.AclAction) e.getUnfinishedMessage();
- throw e.unwrapIOException();
- } finally {
- if (parsedMessage != null) {
- mergeFrom(parsedMessage);
- }
- }
- return this;
- }
-
- private int forwardAction_ = 0;
- /**
- * .acl.AclForwardActionEnum forward_action = 1;
- * @return The enum numeric value on the wire for forwardAction.
- */
- @java.lang.Override public int getForwardActionValue() {
- return forwardAction_;
- }
- /**
- * .acl.AclForwardActionEnum forward_action = 1;
- * @param value The enum numeric value on the wire for forwardAction to set.
- * @return This builder for chaining.
- */
- public Builder setForwardActionValue(int value) {
-
- forwardAction_ = value;
- onChanged();
- return this;
- }
- /**
- * .acl.AclForwardActionEnum forward_action = 1;
- * @return The forwardAction.
- */
- @java.lang.Override
- public acl.Acl.AclForwardActionEnum getForwardAction() {
- @SuppressWarnings("deprecation")
- acl.Acl.AclForwardActionEnum result = acl.Acl.AclForwardActionEnum.valueOf(forwardAction_);
- return result == null ? acl.Acl.AclForwardActionEnum.UNRECOGNIZED : result;
- }
- /**
- * .acl.AclForwardActionEnum forward_action = 1;
- * @param value The forwardAction to set.
- * @return This builder for chaining.
- */
- public Builder setForwardAction(acl.Acl.AclForwardActionEnum value) {
- if (value == null) {
- throw new NullPointerException();
- }
-
- forwardAction_ = value.getNumber();
- onChanged();
- return this;
- }
- /**
- * .acl.AclForwardActionEnum forward_action = 1;
- * @return This builder for chaining.
- */
- public Builder clearForwardAction() {
-
- forwardAction_ = 0;
- onChanged();
- return this;
- }
-
- private int logAction_ = 0;
- /**
- * .acl.AclLogActionEnum log_action = 2;
- * @return The enum numeric value on the wire for logAction.
- */
- @java.lang.Override public int getLogActionValue() {
- return logAction_;
- }
- /**
- * .acl.AclLogActionEnum log_action = 2;
- * @param value The enum numeric value on the wire for logAction to set.
- * @return This builder for chaining.
- */
- public Builder setLogActionValue(int value) {
-
- logAction_ = value;
- onChanged();
- return this;
- }
- /**
- * .acl.AclLogActionEnum log_action = 2;
- * @return The logAction.
- */
- @java.lang.Override
- public acl.Acl.AclLogActionEnum getLogAction() {
- @SuppressWarnings("deprecation")
- acl.Acl.AclLogActionEnum result = acl.Acl.AclLogActionEnum.valueOf(logAction_);
- return result == null ? acl.Acl.AclLogActionEnum.UNRECOGNIZED : result;
- }
- /**
- * .acl.AclLogActionEnum log_action = 2;
- * @param value The logAction to set.
- * @return This builder for chaining.
- */
- public Builder setLogAction(acl.Acl.AclLogActionEnum value) {
- if (value == null) {
- throw new NullPointerException();
- }
-
- logAction_ = value.getNumber();
- onChanged();
- return this;
- }
- /**
- * .acl.AclLogActionEnum log_action = 2;
- * @return This builder for chaining.
- */
- public Builder clearLogAction() {
-
- logAction_ = 0;
- onChanged();
- return this;
- }
- @java.lang.Override
- public final Builder setUnknownFields(
- final com.google.protobuf.UnknownFieldSet unknownFields) {
- return super.setUnknownFields(unknownFields);
- }
-
- @java.lang.Override
- public final Builder mergeUnknownFields(
- final com.google.protobuf.UnknownFieldSet unknownFields) {
- return super.mergeUnknownFields(unknownFields);
- }
-
-
- // @@protoc_insertion_point(builder_scope:acl.AclAction)
- }
-
- // @@protoc_insertion_point(class_scope:acl.AclAction)
- private static final acl.Acl.AclAction DEFAULT_INSTANCE;
- static {
- DEFAULT_INSTANCE = new acl.Acl.AclAction();
- }
-
- public static acl.Acl.AclAction getDefaultInstance() {
- return DEFAULT_INSTANCE;
- }
-
- private static final com.google.protobuf.Parser
- PARSER = new com.google.protobuf.AbstractParser() {
- @java.lang.Override
- public AclAction parsePartialFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return new AclAction(input, extensionRegistry);
- }
- };
-
- public static com.google.protobuf.Parser parser() {
- return PARSER;
- }
-
- @java.lang.Override
- public com.google.protobuf.Parser getParserForType() {
- return PARSER;
- }
-
- @java.lang.Override
- public acl.Acl.AclAction getDefaultInstanceForType() {
- return DEFAULT_INSTANCE;
- }
-
- }
-
- public interface AclEntryOrBuilder extends
- // @@protoc_insertion_point(interface_extends:acl.AclEntry)
- com.google.protobuf.MessageOrBuilder {
-
- /**
- * uint32 sequence_id = 1;
- * @return The sequenceId.
- */
- int getSequenceId();
-
- /**
- * string description = 2;
- * @return The description.
- */
- java.lang.String getDescription();
- /**
- * string description = 2;
- * @return The bytes for description.
- */
- com.google.protobuf.ByteString
- getDescriptionBytes();
-
- /**
- * .acl.AclMatch match = 3;
- * @return Whether the match field is set.
- */
- boolean hasMatch();
- /**
- * .acl.AclMatch match = 3;
- * @return The match.
- */
- acl.Acl.AclMatch getMatch();
- /**
- * .acl.AclMatch match = 3;
- */
- acl.Acl.AclMatchOrBuilder getMatchOrBuilder();
-
- /**
- * .acl.AclAction action = 4;
- * @return Whether the action field is set.
- */
- boolean hasAction();
- /**
- * .acl.AclAction action = 4;
- * @return The action.
- */
- acl.Acl.AclAction getAction();
- /**
- * .acl.AclAction action = 4;
- */
- acl.Acl.AclActionOrBuilder getActionOrBuilder();
- }
- /**
- * Protobuf type {@code acl.AclEntry}
- */
- public static final class AclEntry extends
- com.google.protobuf.GeneratedMessageV3 implements
- // @@protoc_insertion_point(message_implements:acl.AclEntry)
- AclEntryOrBuilder {
- private static final long serialVersionUID = 0L;
- // Use AclEntry.newBuilder() to construct.
- private AclEntry(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
- super(builder);
- }
- private AclEntry() {
- description_ = "";
- }
-
- @java.lang.Override
- @SuppressWarnings({"unused"})
- protected java.lang.Object newInstance(
- UnusedPrivateParameter unused) {
- return new AclEntry();
- }
-
- @java.lang.Override
- public final com.google.protobuf.UnknownFieldSet
- getUnknownFields() {
- return this.unknownFields;
- }
- private AclEntry(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- this();
- if (extensionRegistry == null) {
- throw new java.lang.NullPointerException();
- }
- com.google.protobuf.UnknownFieldSet.Builder unknownFields =
- com.google.protobuf.UnknownFieldSet.newBuilder();
- try {
- boolean done = false;
- while (!done) {
- int tag = input.readTag();
- switch (tag) {
- case 0:
- done = true;
- break;
- case 8: {
-
- sequenceId_ = input.readUInt32();
- break;
- }
- case 18: {
- java.lang.String s = input.readStringRequireUtf8();
-
- description_ = s;
- break;
- }
- case 26: {
- acl.Acl.AclMatch.Builder subBuilder = null;
- if (match_ != null) {
- subBuilder = match_.toBuilder();
- }
- match_ = input.readMessage(acl.Acl.AclMatch.parser(), extensionRegistry);
- if (subBuilder != null) {
- subBuilder.mergeFrom(match_);
- match_ = subBuilder.buildPartial();
- }
-
- break;
- }
- case 34: {
- acl.Acl.AclAction.Builder subBuilder = null;
- if (action_ != null) {
- subBuilder = action_.toBuilder();
- }
- action_ = input.readMessage(acl.Acl.AclAction.parser(), extensionRegistry);
- if (subBuilder != null) {
- subBuilder.mergeFrom(action_);
- action_ = subBuilder.buildPartial();
- }
-
- break;
- }
- default: {
- if (!parseUnknownField(
- input, unknownFields, extensionRegistry, tag)) {
- done = true;
- }
- break;
- }
- }
- }
- } catch (com.google.protobuf.InvalidProtocolBufferException e) {
- throw e.setUnfinishedMessage(this);
- } catch (java.io.IOException e) {
- throw new com.google.protobuf.InvalidProtocolBufferException(
- e).setUnfinishedMessage(this);
- } finally {
- this.unknownFields = unknownFields.build();
- makeExtensionsImmutable();
- }
- }
- public static final com.google.protobuf.Descriptors.Descriptor
- getDescriptor() {
- return acl.Acl.internal_static_acl_AclEntry_descriptor;
- }
-
- @java.lang.Override
- protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
- internalGetFieldAccessorTable() {
- return acl.Acl.internal_static_acl_AclEntry_fieldAccessorTable
- .ensureFieldAccessorsInitialized(
- acl.Acl.AclEntry.class, acl.Acl.AclEntry.Builder.class);
- }
-
- public static final int SEQUENCE_ID_FIELD_NUMBER = 1;
- private int sequenceId_;
- /**
- * uint32 sequence_id = 1;
- * @return The sequenceId.
- */
- @java.lang.Override
- public int getSequenceId() {
- return sequenceId_;
- }
-
- public static final int DESCRIPTION_FIELD_NUMBER = 2;
- private volatile java.lang.Object description_;
- /**
- * string description = 2;
- * @return The description.
- */
- @java.lang.Override
- public java.lang.String getDescription() {
- java.lang.Object ref = description_;
- if (ref instanceof java.lang.String) {
- return (java.lang.String) ref;
- } else {
- com.google.protobuf.ByteString bs =
- (com.google.protobuf.ByteString) ref;
- java.lang.String s = bs.toStringUtf8();
- description_ = s;
- return s;
- }
- }
- /**
- * string description = 2;
- * @return The bytes for description.
- */
- @java.lang.Override
- public com.google.protobuf.ByteString
- getDescriptionBytes() {
- java.lang.Object ref = description_;
- if (ref instanceof java.lang.String) {
- com.google.protobuf.ByteString b =
- com.google.protobuf.ByteString.copyFromUtf8(
- (java.lang.String) ref);
- description_ = b;
- return b;
- } else {
- return (com.google.protobuf.ByteString) ref;
- }
- }
-
- public static final int MATCH_FIELD_NUMBER = 3;
- private acl.Acl.AclMatch match_;
- /**
- * .acl.AclMatch match = 3;
- * @return Whether the match field is set.
- */
- @java.lang.Override
- public boolean hasMatch() {
- return match_ != null;
- }
- /**
- * .acl.AclMatch match = 3;
- * @return The match.
- */
- @java.lang.Override
- public acl.Acl.AclMatch getMatch() {
- return match_ == null ? acl.Acl.AclMatch.getDefaultInstance() : match_;
- }
- /**
- * .acl.AclMatch match = 3;
- */
- @java.lang.Override
- public acl.Acl.AclMatchOrBuilder getMatchOrBuilder() {
- return getMatch();
- }
-
- public static final int ACTION_FIELD_NUMBER = 4;
- private acl.Acl.AclAction action_;
- /**
- * .acl.AclAction action = 4;
- * @return Whether the action field is set.
- */
- @java.lang.Override
- public boolean hasAction() {
- return action_ != null;
- }
- /**
- * .acl.AclAction action = 4;
- * @return The action.
- */
- @java.lang.Override
- public acl.Acl.AclAction getAction() {
- return action_ == null ? acl.Acl.AclAction.getDefaultInstance() : action_;
- }
- /**
- * .acl.AclAction action = 4;
- */
- @java.lang.Override
- public acl.Acl.AclActionOrBuilder getActionOrBuilder() {
- return getAction();
- }
-
- private byte memoizedIsInitialized = -1;
- @java.lang.Override
- public final boolean isInitialized() {
- byte isInitialized = memoizedIsInitialized;
- if (isInitialized == 1) return true;
- if (isInitialized == 0) return false;
-
- memoizedIsInitialized = 1;
- return true;
- }
-
- @java.lang.Override
- public void writeTo(com.google.protobuf.CodedOutputStream output)
- throws java.io.IOException {
- if (sequenceId_ != 0) {
- output.writeUInt32(1, sequenceId_);
- }
- if (!getDescriptionBytes().isEmpty()) {
- com.google.protobuf.GeneratedMessageV3.writeString(output, 2, description_);
- }
- if (match_ != null) {
- output.writeMessage(3, getMatch());
- }
- if (action_ != null) {
- output.writeMessage(4, getAction());
- }
- unknownFields.writeTo(output);
- }
-
- @java.lang.Override
- public int getSerializedSize() {
- int size = memoizedSize;
- if (size != -1) return size;
-
- size = 0;
- if (sequenceId_ != 0) {
- size += com.google.protobuf.CodedOutputStream
- .computeUInt32Size(1, sequenceId_);
- }
- if (!getDescriptionBytes().isEmpty()) {
- size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, description_);
- }
- if (match_ != null) {
- size += com.google.protobuf.CodedOutputStream
- .computeMessageSize(3, getMatch());
- }
- if (action_ != null) {
- size += com.google.protobuf.CodedOutputStream
- .computeMessageSize(4, getAction());
- }
- size += unknownFields.getSerializedSize();
- memoizedSize = size;
- return size;
- }
-
- @java.lang.Override
- public boolean equals(final java.lang.Object obj) {
- if (obj == this) {
- return true;
- }
- if (!(obj instanceof acl.Acl.AclEntry)) {
- return super.equals(obj);
- }
- acl.Acl.AclEntry other = (acl.Acl.AclEntry) obj;
-
- if (getSequenceId()
- != other.getSequenceId()) return false;
- if (!getDescription()
- .equals(other.getDescription())) return false;
- if (hasMatch() != other.hasMatch()) return false;
- if (hasMatch()) {
- if (!getMatch()
- .equals(other.getMatch())) return false;
- }
- if (hasAction() != other.hasAction()) return false;
- if (hasAction()) {
- if (!getAction()
- .equals(other.getAction())) return false;
- }
- if (!unknownFields.equals(other.unknownFields)) return false;
- return true;
- }
-
- @java.lang.Override
- public int hashCode() {
- if (memoizedHashCode != 0) {
- return memoizedHashCode;
- }
- int hash = 41;
- hash = (19 * hash) + getDescriptor().hashCode();
- hash = (37 * hash) + SEQUENCE_ID_FIELD_NUMBER;
- hash = (53 * hash) + getSequenceId();
- hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER;
- hash = (53 * hash) + getDescription().hashCode();
- if (hasMatch()) {
- hash = (37 * hash) + MATCH_FIELD_NUMBER;
- hash = (53 * hash) + getMatch().hashCode();
- }
- if (hasAction()) {
- hash = (37 * hash) + ACTION_FIELD_NUMBER;
- hash = (53 * hash) + getAction().hashCode();
- }
- hash = (29 * hash) + unknownFields.hashCode();
- memoizedHashCode = hash;
- return hash;
- }
-
- public static acl.Acl.AclEntry parseFrom(
- java.nio.ByteBuffer data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data);
- }
- public static acl.Acl.AclEntry parseFrom(
- java.nio.ByteBuffer data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data, extensionRegistry);
- }
- public static acl.Acl.AclEntry parseFrom(
- com.google.protobuf.ByteString data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data);
- }
- public static acl.Acl.AclEntry parseFrom(
- com.google.protobuf.ByteString data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data, extensionRegistry);
- }
- public static acl.Acl.AclEntry parseFrom(byte[] data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data);
- }
- public static acl.Acl.AclEntry parseFrom(
- byte[] data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data, extensionRegistry);
- }
- public static acl.Acl.AclEntry parseFrom(java.io.InputStream input)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input);
- }
- public static acl.Acl.AclEntry parseFrom(
- java.io.InputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input, extensionRegistry);
- }
- public static acl.Acl.AclEntry parseDelimitedFrom(java.io.InputStream input)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseDelimitedWithIOException(PARSER, input);
- }
- public static acl.Acl.AclEntry parseDelimitedFrom(
- java.io.InputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
- }
- public static acl.Acl.AclEntry parseFrom(
- com.google.protobuf.CodedInputStream input)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input);
- }
- public static acl.Acl.AclEntry parseFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input, extensionRegistry);
- }
-
- @java.lang.Override
- public Builder newBuilderForType() { return newBuilder(); }
- public static Builder newBuilder() {
- return DEFAULT_INSTANCE.toBuilder();
- }
- public static Builder newBuilder(acl.Acl.AclEntry prototype) {
- return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
- }
- @java.lang.Override
- public Builder toBuilder() {
- return this == DEFAULT_INSTANCE
- ? new Builder() : new Builder().mergeFrom(this);
- }
-
- @java.lang.Override
- protected Builder newBuilderForType(
- com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
- Builder builder = new Builder(parent);
- return builder;
- }
- /**
- * Protobuf type {@code acl.AclEntry}
- */
- public static final class Builder extends
- com.google.protobuf.GeneratedMessageV3.Builder implements
- // @@protoc_insertion_point(builder_implements:acl.AclEntry)
- acl.Acl.AclEntryOrBuilder {
- public static final com.google.protobuf.Descriptors.Descriptor
- getDescriptor() {
- return acl.Acl.internal_static_acl_AclEntry_descriptor;
- }
-
- @java.lang.Override
- protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
- internalGetFieldAccessorTable() {
- return acl.Acl.internal_static_acl_AclEntry_fieldAccessorTable
- .ensureFieldAccessorsInitialized(
- acl.Acl.AclEntry.class, acl.Acl.AclEntry.Builder.class);
- }
-
- // Construct using acl.Acl.AclEntry.newBuilder()
- private Builder() {
- maybeForceBuilderInitialization();
- }
-
- private Builder(
- com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
- super(parent);
- maybeForceBuilderInitialization();
- }
- private void maybeForceBuilderInitialization() {
- if (com.google.protobuf.GeneratedMessageV3
- .alwaysUseFieldBuilders) {
- }
- }
- @java.lang.Override
- public Builder clear() {
- super.clear();
- sequenceId_ = 0;
-
- description_ = "";
-
- if (matchBuilder_ == null) {
- match_ = null;
- } else {
- match_ = null;
- matchBuilder_ = null;
- }
- if (actionBuilder_ == null) {
- action_ = null;
- } else {
- action_ = null;
- actionBuilder_ = null;
- }
- return this;
- }
-
- @java.lang.Override
- public com.google.protobuf.Descriptors.Descriptor
- getDescriptorForType() {
- return acl.Acl.internal_static_acl_AclEntry_descriptor;
- }
-
- @java.lang.Override
- public acl.Acl.AclEntry getDefaultInstanceForType() {
- return acl.Acl.AclEntry.getDefaultInstance();
- }
-
- @java.lang.Override
- public acl.Acl.AclEntry build() {
- acl.Acl.AclEntry result = buildPartial();
- if (!result.isInitialized()) {
- throw newUninitializedMessageException(result);
- }
- return result;
- }
-
- @java.lang.Override
- public acl.Acl.AclEntry buildPartial() {
- acl.Acl.AclEntry result = new acl.Acl.AclEntry(this);
- result.sequenceId_ = sequenceId_;
- result.description_ = description_;
- if (matchBuilder_ == null) {
- result.match_ = match_;
- } else {
- result.match_ = matchBuilder_.build();
- }
- if (actionBuilder_ == null) {
- result.action_ = action_;
- } else {
- result.action_ = actionBuilder_.build();
- }
- onBuilt();
- return result;
- }
-
- @java.lang.Override
- public Builder clone() {
- return super.clone();
- }
- @java.lang.Override
- public Builder setField(
- com.google.protobuf.Descriptors.FieldDescriptor field,
- java.lang.Object value) {
- return super.setField(field, value);
- }
- @java.lang.Override
- public Builder clearField(
- com.google.protobuf.Descriptors.FieldDescriptor field) {
- return super.clearField(field);
- }
- @java.lang.Override
- public Builder clearOneof(
- com.google.protobuf.Descriptors.OneofDescriptor oneof) {
- return super.clearOneof(oneof);
- }
- @java.lang.Override
- public Builder setRepeatedField(
- com.google.protobuf.Descriptors.FieldDescriptor field,
- int index, java.lang.Object value) {
- return super.setRepeatedField(field, index, value);
- }
- @java.lang.Override
- public Builder addRepeatedField(
- com.google.protobuf.Descriptors.FieldDescriptor field,
- java.lang.Object value) {
- return super.addRepeatedField(field, value);
- }
- @java.lang.Override
- public Builder mergeFrom(com.google.protobuf.Message other) {
- if (other instanceof acl.Acl.AclEntry) {
- return mergeFrom((acl.Acl.AclEntry)other);
- } else {
- super.mergeFrom(other);
- return this;
- }
- }
-
- public Builder mergeFrom(acl.Acl.AclEntry other) {
- if (other == acl.Acl.AclEntry.getDefaultInstance()) return this;
- if (other.getSequenceId() != 0) {
- setSequenceId(other.getSequenceId());
- }
- if (!other.getDescription().isEmpty()) {
- description_ = other.description_;
- onChanged();
- }
- if (other.hasMatch()) {
- mergeMatch(other.getMatch());
- }
- if (other.hasAction()) {
- mergeAction(other.getAction());
- }
- this.mergeUnknownFields(other.unknownFields);
- onChanged();
- return this;
- }
-
- @java.lang.Override
- public final boolean isInitialized() {
- return true;
- }
-
- @java.lang.Override
- public Builder mergeFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- acl.Acl.AclEntry parsedMessage = null;
- try {
- parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
- } catch (com.google.protobuf.InvalidProtocolBufferException e) {
- parsedMessage = (acl.Acl.AclEntry) e.getUnfinishedMessage();
- throw e.unwrapIOException();
- } finally {
- if (parsedMessage != null) {
- mergeFrom(parsedMessage);
- }
- }
- return this;
- }
-
- private int sequenceId_ ;
- /**
- * uint32 sequence_id = 1;
- * @return The sequenceId.
- */
- @java.lang.Override
- public int getSequenceId() {
- return sequenceId_;
- }
- /**
- * uint32 sequence_id = 1;
- * @param value The sequenceId to set.
- * @return This builder for chaining.
- */
- public Builder setSequenceId(int value) {
-
- sequenceId_ = value;
- onChanged();
- return this;
- }
- /**
- * uint32 sequence_id = 1;
- * @return This builder for chaining.
- */
- public Builder clearSequenceId() {
-
- sequenceId_ = 0;
- onChanged();
- return this;
- }
-
- private java.lang.Object description_ = "";
- /**
- * string description = 2;
- * @return The description.
- */
- public java.lang.String getDescription() {
- java.lang.Object ref = description_;
- if (!(ref instanceof java.lang.String)) {
- com.google.protobuf.ByteString bs =
- (com.google.protobuf.ByteString) ref;
- java.lang.String s = bs.toStringUtf8();
- description_ = s;
- return s;
- } else {
- return (java.lang.String) ref;
- }
- }
- /**
- * string description = 2;
- * @return The bytes for description.
- */
- public com.google.protobuf.ByteString
- getDescriptionBytes() {
- java.lang.Object ref = description_;
- if (ref instanceof String) {
- com.google.protobuf.ByteString b =
- com.google.protobuf.ByteString.copyFromUtf8(
- (java.lang.String) ref);
- description_ = b;
- return b;
- } else {
- return (com.google.protobuf.ByteString) ref;
- }
- }
- /**
- * string description = 2;
- * @param value The description to set.
- * @return This builder for chaining.
- */
- public Builder setDescription(
- java.lang.String value) {
- if (value == null) {
- throw new NullPointerException();
- }
-
- description_ = value;
- onChanged();
- return this;
- }
- /**
- * string description = 2;
- * @return This builder for chaining.
- */
- public Builder clearDescription() {
-
- description_ = getDefaultInstance().getDescription();
- onChanged();
- return this;
- }
- /**
- * string description = 2;
- * @param value The bytes for description to set.
- * @return This builder for chaining.
- */
- public Builder setDescriptionBytes(
- com.google.protobuf.ByteString value) {
- if (value == null) {
- throw new NullPointerException();
- }
- checkByteStringIsUtf8(value);
-
- description_ = value;
- onChanged();
- return this;
- }
-
- private acl.Acl.AclMatch match_;
- private com.google.protobuf.SingleFieldBuilderV3<
- acl.Acl.AclMatch, acl.Acl.AclMatch.Builder, acl.Acl.AclMatchOrBuilder> matchBuilder_;
- /**
- * .acl.AclMatch match = 3;
- * @return Whether the match field is set.
- */
- public boolean hasMatch() {
- return matchBuilder_ != null || match_ != null;
- }
- /**
- * .acl.AclMatch match = 3;
- * @return The match.
- */
- public acl.Acl.AclMatch getMatch() {
- if (matchBuilder_ == null) {
- return match_ == null ? acl.Acl.AclMatch.getDefaultInstance() : match_;
- } else {
- return matchBuilder_.getMessage();
- }
- }
- /**
- * .acl.AclMatch match = 3;
- */
- public Builder setMatch(acl.Acl.AclMatch value) {
- if (matchBuilder_ == null) {
- if (value == null) {
- throw new NullPointerException();
- }
- match_ = value;
- onChanged();
- } else {
- matchBuilder_.setMessage(value);
- }
-
- return this;
- }
- /**
- * .acl.AclMatch match = 3;
- */
- public Builder setMatch(
- acl.Acl.AclMatch.Builder builderForValue) {
- if (matchBuilder_ == null) {
- match_ = builderForValue.build();
- onChanged();
- } else {
- matchBuilder_.setMessage(builderForValue.build());
- }
-
- return this;
- }
- /**
- * .acl.AclMatch match = 3;
- */
- public Builder mergeMatch(acl.Acl.AclMatch value) {
- if (matchBuilder_ == null) {
- if (match_ != null) {
- match_ =
- acl.Acl.AclMatch.newBuilder(match_).mergeFrom(value).buildPartial();
- } else {
- match_ = value;
- }
- onChanged();
- } else {
- matchBuilder_.mergeFrom(value);
- }
-
- return this;
- }
- /**
- * .acl.AclMatch match = 3;
- */
- public Builder clearMatch() {
- if (matchBuilder_ == null) {
- match_ = null;
- onChanged();
- } else {
- match_ = null;
- matchBuilder_ = null;
- }
-
- return this;
- }
- /**
- * .acl.AclMatch match = 3;
- */
- public acl.Acl.AclMatch.Builder getMatchBuilder() {
-
- onChanged();
- return getMatchFieldBuilder().getBuilder();
- }
- /**
- * .acl.AclMatch match = 3;
- */
- public acl.Acl.AclMatchOrBuilder getMatchOrBuilder() {
- if (matchBuilder_ != null) {
- return matchBuilder_.getMessageOrBuilder();
- } else {
- return match_ == null ?
- acl.Acl.AclMatch.getDefaultInstance() : match_;
- }
- }
- /**
- * .acl.AclMatch match = 3;
- */
- private com.google.protobuf.SingleFieldBuilderV3<
- acl.Acl.AclMatch, acl.Acl.AclMatch.Builder, acl.Acl.AclMatchOrBuilder>
- getMatchFieldBuilder() {
- if (matchBuilder_ == null) {
- matchBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
- acl.Acl.AclMatch, acl.Acl.AclMatch.Builder, acl.Acl.AclMatchOrBuilder>(
- getMatch(),
- getParentForChildren(),
- isClean());
- match_ = null;
- }
- return matchBuilder_;
- }
-
- private acl.Acl.AclAction action_;
- private com.google.protobuf.SingleFieldBuilderV3<
- acl.Acl.AclAction, acl.Acl.AclAction.Builder, acl.Acl.AclActionOrBuilder> actionBuilder_;
- /**
- * .acl.AclAction action = 4;
- * @return Whether the action field is set.
- */
- public boolean hasAction() {
- return actionBuilder_ != null || action_ != null;
- }
- /**
- * .acl.AclAction action = 4;
- * @return The action.
- */
- public acl.Acl.AclAction getAction() {
- if (actionBuilder_ == null) {
- return action_ == null ? acl.Acl.AclAction.getDefaultInstance() : action_;
- } else {
- return actionBuilder_.getMessage();
- }
- }
- /**
- * .acl.AclAction action = 4;
- */
- public Builder setAction(acl.Acl.AclAction value) {
- if (actionBuilder_ == null) {
- if (value == null) {
- throw new NullPointerException();
- }
- action_ = value;
- onChanged();
- } else {
- actionBuilder_.setMessage(value);
- }
-
- return this;
- }
- /**
- * .acl.AclAction action = 4;
- */
- public Builder setAction(
- acl.Acl.AclAction.Builder builderForValue) {
- if (actionBuilder_ == null) {
- action_ = builderForValue.build();
- onChanged();
- } else {
- actionBuilder_.setMessage(builderForValue.build());
- }
-
- return this;
- }
- /**
- * .acl.AclAction action = 4;
- */
- public Builder mergeAction(acl.Acl.AclAction value) {
- if (actionBuilder_ == null) {
- if (action_ != null) {
- action_ =
- acl.Acl.AclAction.newBuilder(action_).mergeFrom(value).buildPartial();
- } else {
- action_ = value;
- }
- onChanged();
- } else {
- actionBuilder_.mergeFrom(value);
- }
-
- return this;
- }
- /**
- * .acl.AclAction action = 4;
- */
- public Builder clearAction() {
- if (actionBuilder_ == null) {
- action_ = null;
- onChanged();
- } else {
- action_ = null;
- actionBuilder_ = null;
- }
-
- return this;
- }
- /**
- * .acl.AclAction action = 4;
- */
- public acl.Acl.AclAction.Builder getActionBuilder() {
-
- onChanged();
- return getActionFieldBuilder().getBuilder();
- }
- /**
- * .acl.AclAction action = 4;
- */
- public acl.Acl.AclActionOrBuilder getActionOrBuilder() {
- if (actionBuilder_ != null) {
- return actionBuilder_.getMessageOrBuilder();
- } else {
- return action_ == null ?
- acl.Acl.AclAction.getDefaultInstance() : action_;
- }
- }
- /**
- * .acl.AclAction action = 4;
- */
- private com.google.protobuf.SingleFieldBuilderV3<
- acl.Acl.AclAction, acl.Acl.AclAction.Builder, acl.Acl.AclActionOrBuilder>
- getActionFieldBuilder() {
- if (actionBuilder_ == null) {
- actionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
- acl.Acl.AclAction, acl.Acl.AclAction.Builder, acl.Acl.AclActionOrBuilder>(
- getAction(),
- getParentForChildren(),
- isClean());
- action_ = null;
- }
- return actionBuilder_;
- }
- @java.lang.Override
- public final Builder setUnknownFields(
- final com.google.protobuf.UnknownFieldSet unknownFields) {
- return super.setUnknownFields(unknownFields);
- }
-
- @java.lang.Override
- public final Builder mergeUnknownFields(
- final com.google.protobuf.UnknownFieldSet unknownFields) {
- return super.mergeUnknownFields(unknownFields);
- }
-
-
- // @@protoc_insertion_point(builder_scope:acl.AclEntry)
- }
-
- // @@protoc_insertion_point(class_scope:acl.AclEntry)
- private static final acl.Acl.AclEntry DEFAULT_INSTANCE;
- static {
- DEFAULT_INSTANCE = new acl.Acl.AclEntry();
- }
-
- public static acl.Acl.AclEntry getDefaultInstance() {
- return DEFAULT_INSTANCE;
- }
-
- private static final com.google.protobuf.Parser
- PARSER = new com.google.protobuf.AbstractParser() {
- @java.lang.Override
- public AclEntry parsePartialFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return new AclEntry(input, extensionRegistry);
- }
- };
-
- public static com.google.protobuf.Parser parser() {
- return PARSER;
- }
-
- @java.lang.Override
- public com.google.protobuf.Parser getParserForType() {
- return PARSER;
- }
-
- @java.lang.Override
- public acl.Acl.AclEntry getDefaultInstanceForType() {
- return DEFAULT_INSTANCE;
- }
-
- }
-
- public interface AclRuleSetOrBuilder extends
- // @@protoc_insertion_point(interface_extends:acl.AclRuleSet)
- com.google.protobuf.MessageOrBuilder {
-
- /**
- * string name = 1;
- * @return The name.
- */
- java.lang.String getName();
- /**
- * string name = 1;
- * @return The bytes for name.
- */
- com.google.protobuf.ByteString
- getNameBytes();
-
- /**
- * .acl.AclRuleTypeEnum type = 2;
- * @return The enum numeric value on the wire for type.
- */
- int getTypeValue();
- /**
- * .acl.AclRuleTypeEnum type = 2;
- * @return The type.
- */
- acl.Acl.AclRuleTypeEnum getType();
-
- /**
- * string description = 3;
- * @return The description.
- */
- java.lang.String getDescription();
- /**
- * string description = 3;
- * @return The bytes for description.
- */
- com.google.protobuf.ByteString
- getDescriptionBytes();
-
- /**
- * string user_id = 4;
- * @return The userId.
- */
- java.lang.String getUserId();
- /**
- * string user_id = 4;
- * @return The bytes for userId.
- */
- com.google.protobuf.ByteString
- getUserIdBytes();
-
- /**
- * repeated .acl.AclEntry entries = 5;
- */
- java.util.List
- getEntriesList();
- /**
- * repeated .acl.AclEntry entries = 5;
- */
- acl.Acl.AclEntry getEntries(int index);
- /**
- * repeated .acl.AclEntry entries = 5;
- */
- int getEntriesCount();
- /**
- * repeated .acl.AclEntry entries = 5;
- */
- java.util.List 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.ArrayList();
- mutable_bitField0_ |= 0x00000001;
- }
- entries_.add(
- input.readMessage(acl.Acl.AclEntry.parser(), extensionRegistry));
- break;
- }
- default: {
- if (!parseUnknownField(
- input, unknownFields, extensionRegistry, tag)) {
- done = true;
- }
- break;
- }
- }
- }
- } catch (com.google.protobuf.InvalidProtocolBufferException e) {
- throw e.setUnfinishedMessage(this);
- } catch (java.io.IOException e) {
- throw new com.google.protobuf.InvalidProtocolBufferException(
- e).setUnfinishedMessage(this);
- } finally {
- if (((mutable_bitField0_ & 0x00000001) != 0)) {
- entries_ = java.util.Collections.unmodifiableList(entries_);
- }
- this.unknownFields = unknownFields.build();
- makeExtensionsImmutable();
- }
- }
- public static final com.google.protobuf.Descriptors.Descriptor
- getDescriptor() {
- return acl.Acl.internal_static_acl_AclRuleSet_descriptor;
- }
-
- @java.lang.Override
- protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
- internalGetFieldAccessorTable() {
- return acl.Acl.internal_static_acl_AclRuleSet_fieldAccessorTable
- .ensureFieldAccessorsInitialized(
- acl.Acl.AclRuleSet.class, acl.Acl.AclRuleSet.Builder.class);
- }
-
- public static final int NAME_FIELD_NUMBER = 1;
- private volatile java.lang.Object name_;
- /**
- * string name = 1;
- * @return The name.
- */
- @java.lang.Override
- public java.lang.String getName() {
- java.lang.Object ref = name_;
- if (ref instanceof java.lang.String) {
- return (java.lang.String) ref;
- } else {
- com.google.protobuf.ByteString bs =
- (com.google.protobuf.ByteString) ref;
- java.lang.String s = bs.toStringUtf8();
- name_ = s;
- return s;
- }
- }
- /**
- * string name = 1;
- * @return The bytes for name.
- */
- @java.lang.Override
- public com.google.protobuf.ByteString
- getNameBytes() {
- java.lang.Object ref = name_;
- if (ref instanceof java.lang.String) {
- com.google.protobuf.ByteString b =
- com.google.protobuf.ByteString.copyFromUtf8(
- (java.lang.String) ref);
- name_ = b;
- return b;
- } else {
- return (com.google.protobuf.ByteString) ref;
- }
- }
-
- public static final int TYPE_FIELD_NUMBER = 2;
- private int type_;
- /**
- * .acl.AclRuleTypeEnum type = 2;
- * @return The enum numeric value on the wire for type.
- */
- @java.lang.Override public int getTypeValue() {
- return type_;
- }
- /**
- * .acl.AclRuleTypeEnum type = 2;
- * @return The type.
- */
- @java.lang.Override public acl.Acl.AclRuleTypeEnum getType() {
- @SuppressWarnings("deprecation")
- acl.Acl.AclRuleTypeEnum result = acl.Acl.AclRuleTypeEnum.valueOf(type_);
- return result == null ? acl.Acl.AclRuleTypeEnum.UNRECOGNIZED : result;
- }
-
- public static final int DESCRIPTION_FIELD_NUMBER = 3;
- private volatile java.lang.Object description_;
- /**
- * string description = 3;
- * @return The description.
- */
- @java.lang.Override
- public java.lang.String getDescription() {
- java.lang.Object ref = description_;
- if (ref instanceof java.lang.String) {
- return (java.lang.String) ref;
- } else {
- com.google.protobuf.ByteString bs =
- (com.google.protobuf.ByteString) ref;
- java.lang.String s = bs.toStringUtf8();
- description_ = s;
- return s;
- }
- }
- /**
- * string description = 3;
- * @return The bytes for description.
- */
- @java.lang.Override
- public com.google.protobuf.ByteString
- getDescriptionBytes() {
- java.lang.Object ref = description_;
- if (ref instanceof java.lang.String) {
- com.google.protobuf.ByteString b =
- com.google.protobuf.ByteString.copyFromUtf8(
- (java.lang.String) ref);
- description_ = b;
- return b;
- } else {
- return (com.google.protobuf.ByteString) ref;
- }
- }
-
- public static final int USER_ID_FIELD_NUMBER = 4;
- private volatile java.lang.Object userId_;
- /**
- * string user_id = 4;
- * @return The userId.
- */
- @java.lang.Override
- public java.lang.String getUserId() {
- java.lang.Object ref = userId_;
- if (ref instanceof java.lang.String) {
- return (java.lang.String) ref;
- } else {
- com.google.protobuf.ByteString bs =
- (com.google.protobuf.ByteString) ref;
- java.lang.String s = bs.toStringUtf8();
- userId_ = s;
- return s;
- }
- }
- /**
- * string user_id = 4;
- * @return The bytes for userId.
- */
- @java.lang.Override
- public com.google.protobuf.ByteString
- getUserIdBytes() {
- java.lang.Object ref = userId_;
- if (ref instanceof java.lang.String) {
- com.google.protobuf.ByteString b =
- com.google.protobuf.ByteString.copyFromUtf8(
- (java.lang.String) ref);
- userId_ = b;
- return b;
- } else {
- return (com.google.protobuf.ByteString) ref;
- }
- }
-
- public static final int ENTRIES_FIELD_NUMBER = 5;
- private java.util.List entries_;
- /**
- * repeated .acl.AclEntry entries = 5;
- */
- @java.lang.Override
- public java.util.List getEntriesList() {
- return entries_;
- }
- /**
- * repeated .acl.AclEntry entries = 5;
- */
- @java.lang.Override
- public java.util.List 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.Builder implements
- // @@protoc_insertion_point(builder_implements:acl.AclRuleSet)
- acl.Acl.AclRuleSetOrBuilder {
- public static final com.google.protobuf.Descriptors.Descriptor
- getDescriptor() {
- return acl.Acl.internal_static_acl_AclRuleSet_descriptor;
- }
-
- @java.lang.Override
- protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
- internalGetFieldAccessorTable() {
- return acl.Acl.internal_static_acl_AclRuleSet_fieldAccessorTable
- .ensureFieldAccessorsInitialized(
- acl.Acl.AclRuleSet.class, acl.Acl.AclRuleSet.Builder.class);
- }
-
- // Construct using acl.Acl.AclRuleSet.newBuilder()
- private Builder() {
- maybeForceBuilderInitialization();
- }
-
- private Builder(
- com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
- super(parent);
- maybeForceBuilderInitialization();
- }
- private void maybeForceBuilderInitialization() {
- if (com.google.protobuf.GeneratedMessageV3
- .alwaysUseFieldBuilders) {
- getEntriesFieldBuilder();
- }
- }
- @java.lang.Override
- public Builder clear() {
- super.clear();
- name_ = "";
-
- type_ = 0;
-
- description_ = "";
-
- userId_ = "";
-
- if (entriesBuilder_ == null) {
- entries_ = java.util.Collections.emptyList();
- bitField0_ = (bitField0_ & ~0x00000001);
- } else {
- entriesBuilder_.clear();
- }
- return this;
- }
-
- @java.lang.Override
- public com.google.protobuf.Descriptors.Descriptor
- getDescriptorForType() {
- return acl.Acl.internal_static_acl_AclRuleSet_descriptor;
- }
-
- @java.lang.Override
- public acl.Acl.AclRuleSet getDefaultInstanceForType() {
- return acl.Acl.AclRuleSet.getDefaultInstance();
- }
-
- @java.lang.Override
- public acl.Acl.AclRuleSet build() {
- acl.Acl.AclRuleSet result = buildPartial();
- if (!result.isInitialized()) {
- throw newUninitializedMessageException(result);
- }
- return result;
- }
-
- @java.lang.Override
- public acl.Acl.AclRuleSet buildPartial() {
- acl.Acl.AclRuleSet result = new acl.Acl.AclRuleSet(this);
- int from_bitField0_ = bitField0_;
- result.name_ = name_;
- result.type_ = type_;
- result.description_ = description_;
- result.userId_ = userId_;
- if (entriesBuilder_ == null) {
- if (((bitField0_ & 0x00000001) != 0)) {
- entries_ = java.util.Collections.unmodifiableList(entries_);
- bitField0_ = (bitField0_ & ~0x00000001);
- }
- result.entries_ = entries_;
- } else {
- result.entries_ = entriesBuilder_.build();
- }
- onBuilt();
- return result;
- }
-
- @java.lang.Override
- public Builder clone() {
- return super.clone();
- }
- @java.lang.Override
- public Builder setField(
- com.google.protobuf.Descriptors.FieldDescriptor field,
- java.lang.Object value) {
- return super.setField(field, value);
- }
- @java.lang.Override
- public Builder clearField(
- com.google.protobuf.Descriptors.FieldDescriptor field) {
- return super.clearField(field);
- }
- @java.lang.Override
- public Builder clearOneof(
- com.google.protobuf.Descriptors.OneofDescriptor oneof) {
- return super.clearOneof(oneof);
- }
- @java.lang.Override
- public Builder setRepeatedField(
- com.google.protobuf.Descriptors.FieldDescriptor field,
- int index, java.lang.Object value) {
- return super.setRepeatedField(field, index, value);
- }
- @java.lang.Override
- public Builder addRepeatedField(
- com.google.protobuf.Descriptors.FieldDescriptor field,
- java.lang.Object value) {
- return super.addRepeatedField(field, value);
- }
- @java.lang.Override
- public Builder mergeFrom(com.google.protobuf.Message other) {
- if (other instanceof acl.Acl.AclRuleSet) {
- return mergeFrom((acl.Acl.AclRuleSet)other);
- } else {
- super.mergeFrom(other);
- return this;
- }
- }
-
- public Builder mergeFrom(acl.Acl.AclRuleSet other) {
- if (other == acl.Acl.AclRuleSet.getDefaultInstance()) return this;
- if (!other.getName().isEmpty()) {
- name_ = other.name_;
- onChanged();
- }
- if (other.type_ != 0) {
- setTypeValue(other.getTypeValue());
- }
- if (!other.getDescription().isEmpty()) {
- description_ = other.description_;
- onChanged();
- }
- if (!other.getUserId().isEmpty()) {
- userId_ = other.userId_;
- onChanged();
- }
- if (entriesBuilder_ == null) {
- if (!other.entries_.isEmpty()) {
- if (entries_.isEmpty()) {
- entries_ = other.entries_;
- bitField0_ = (bitField0_ & ~0x00000001);
- } else {
- ensureEntriesIsMutable();
- entries_.addAll(other.entries_);
- }
- onChanged();
- }
- } else {
- if (!other.entries_.isEmpty()) {
- if (entriesBuilder_.isEmpty()) {
- entriesBuilder_.dispose();
- entriesBuilder_ = null;
- entries_ = other.entries_;
- bitField0_ = (bitField0_ & ~0x00000001);
- entriesBuilder_ =
- com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
- getEntriesFieldBuilder() : null;
- } else {
- entriesBuilder_.addAllMessages(other.entries_);
- }
- }
- }
- this.mergeUnknownFields(other.unknownFields);
- onChanged();
- return this;
- }
-
- @java.lang.Override
- public final boolean isInitialized() {
- return true;
- }
-
- @java.lang.Override
- public Builder mergeFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- acl.Acl.AclRuleSet parsedMessage = null;
- try {
- parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
- } catch (com.google.protobuf.InvalidProtocolBufferException e) {
- parsedMessage = (acl.Acl.AclRuleSet) e.getUnfinishedMessage();
- throw e.unwrapIOException();
- } finally {
- if (parsedMessage != null) {
- mergeFrom(parsedMessage);
- }
- }
- return this;
- }
- private int bitField0_;
-
- private java.lang.Object name_ = "";
- /**
- * string name = 1;
- * @return The name.
- */
- public java.lang.String getName() {
- java.lang.Object ref = name_;
- if (!(ref instanceof java.lang.String)) {
- com.google.protobuf.ByteString bs =
- (com.google.protobuf.ByteString) ref;
- java.lang.String s = bs.toStringUtf8();
- name_ = s;
- return s;
- } else {
- return (java.lang.String) ref;
- }
- }
- /**
- * string name = 1;
- * @return The bytes for name.
- */
- public com.google.protobuf.ByteString
- getNameBytes() {
- java.lang.Object ref = name_;
- if (ref instanceof String) {
- com.google.protobuf.ByteString b =
- com.google.protobuf.ByteString.copyFromUtf8(
- (java.lang.String) ref);
- name_ = b;
- return b;
- } else {
- return (com.google.protobuf.ByteString) ref;
- }
- }
- /**
- * string name = 1;
- * @param value The name to set.
- * @return This builder for chaining.
- */
- public Builder setName(
- java.lang.String value) {
- if (value == null) {
- throw new NullPointerException();
- }
-
- name_ = value;
- onChanged();
- return this;
- }
- /**
- * string name = 1;
- * @return This builder for chaining.
- */
- public Builder clearName() {
-
- name_ = getDefaultInstance().getName();
- onChanged();
- return this;
- }
- /**
- * string name = 1;
- * @param value The bytes for name to set.
- * @return This builder for chaining.
- */
- public Builder setNameBytes(
- com.google.protobuf.ByteString value) {
- if (value == null) {
- throw new NullPointerException();
- }
- checkByteStringIsUtf8(value);
-
- name_ = value;
- onChanged();
- return this;
- }
-
- private int type_ = 0;
- /**
- * .acl.AclRuleTypeEnum type = 2;
- * @return The enum numeric value on the wire for type.
- */
- @java.lang.Override public int getTypeValue() {
- return type_;
- }
- /**
- * .acl.AclRuleTypeEnum type = 2;
- * @param value The enum numeric value on the wire for type to set.
- * @return This builder for chaining.
- */
- public Builder setTypeValue(int value) {
-
- type_ = value;
- onChanged();
- return this;
- }
- /**
- * .acl.AclRuleTypeEnum type = 2;
- * @return The type.
- */
- @java.lang.Override
- public acl.Acl.AclRuleTypeEnum getType() {
- @SuppressWarnings("deprecation")
- acl.Acl.AclRuleTypeEnum result = acl.Acl.AclRuleTypeEnum.valueOf(type_);
- return result == null ? acl.Acl.AclRuleTypeEnum.UNRECOGNIZED : result;
- }
- /**
- * .acl.AclRuleTypeEnum type = 2;
- * @param value The type to set.
- * @return This builder for chaining.
- */
- public Builder setType(acl.Acl.AclRuleTypeEnum value) {
- if (value == null) {
- throw new NullPointerException();
- }
-
- type_ = value.getNumber();
- onChanged();
- return this;
- }
- /**
- * .acl.AclRuleTypeEnum type = 2;
- * @return This builder for chaining.
- */
- public Builder clearType() {
-
- type_ = 0;
- onChanged();
- return this;
- }
-
- private java.lang.Object description_ = "";
- /**
- * string description = 3;
- * @return The description.
- */
- public java.lang.String getDescription() {
- java.lang.Object ref = description_;
- if (!(ref instanceof java.lang.String)) {
- com.google.protobuf.ByteString bs =
- (com.google.protobuf.ByteString) ref;
- java.lang.String s = bs.toStringUtf8();
- description_ = s;
- return s;
- } else {
- return (java.lang.String) ref;
- }
- }
- /**
- * string description = 3;
- * @return The bytes for description.
- */
- public com.google.protobuf.ByteString
- getDescriptionBytes() {
- java.lang.Object ref = description_;
- if (ref instanceof String) {
- com.google.protobuf.ByteString b =
- com.google.protobuf.ByteString.copyFromUtf8(
- (java.lang.String) ref);
- description_ = b;
- return b;
- } else {
- return (com.google.protobuf.ByteString) ref;
- }
- }
- /**
- * string description = 3;
- * @param value The description to set.
- * @return This builder for chaining.
- */
- public Builder setDescription(
- java.lang.String value) {
- if (value == null) {
- throw new NullPointerException();
- }
-
- description_ = value;
- onChanged();
- return this;
- }
- /**
- * string description = 3;
- * @return This builder for chaining.
- */
- public Builder clearDescription() {
-
- description_ = getDefaultInstance().getDescription();
- onChanged();
- return this;
- }
- /**
- * string description = 3;
- * @param value The bytes for description to set.
- * @return This builder for chaining.
- */
- public Builder setDescriptionBytes(
- com.google.protobuf.ByteString value) {
- if (value == null) {
- throw new NullPointerException();
- }
- checkByteStringIsUtf8(value);
-
- description_ = value;
- onChanged();
- return this;
- }
-
- private java.lang.Object userId_ = "";
- /**
- * string user_id = 4;
- * @return The userId.
- */
- public java.lang.String getUserId() {
- java.lang.Object ref = userId_;
- if (!(ref instanceof java.lang.String)) {
- com.google.protobuf.ByteString bs =
- (com.google.protobuf.ByteString) ref;
- java.lang.String s = bs.toStringUtf8();
- userId_ = s;
- return s;
- } else {
- return (java.lang.String) ref;
- }
- }
- /**
- * string user_id = 4;
- * @return The bytes for userId.
- */
- public com.google.protobuf.ByteString
- getUserIdBytes() {
- java.lang.Object ref = userId_;
- if (ref instanceof String) {
- com.google.protobuf.ByteString b =
- com.google.protobuf.ByteString.copyFromUtf8(
- (java.lang.String) ref);
- userId_ = b;
- return b;
- } else {
- return (com.google.protobuf.ByteString) ref;
- }
- }
- /**
- * string user_id = 4;
- * @param value The userId to set.
- * @return This builder for chaining.
- */
- public Builder setUserId(
- java.lang.String value) {
- if (value == null) {
- throw new NullPointerException();
- }
-
- userId_ = value;
- onChanged();
- return this;
- }
- /**
- * string user_id = 4;
- * @return This builder for chaining.
- */
- public Builder clearUserId() {
-
- userId_ = getDefaultInstance().getUserId();
- onChanged();
- return this;
- }
- /**
- * string user_id = 4;
- * @param value The bytes for userId to set.
- * @return This builder for chaining.
- */
- public Builder setUserIdBytes(
- com.google.protobuf.ByteString value) {
- if (value == null) {
- throw new NullPointerException();
- }
- checkByteStringIsUtf8(value);
-
- userId_ = value;
- onChanged();
- return this;
- }
-
- private java.util.List entries_ =
- java.util.Collections.emptyList();
- private void ensureEntriesIsMutable() {
- if (!((bitField0_ & 0x00000001) != 0)) {
- entries_ = new java.util.ArrayList(entries_);
- bitField0_ |= 0x00000001;
- }
- }
-
- private com.google.protobuf.RepeatedFieldBuilderV3<
- acl.Acl.AclEntry, acl.Acl.AclEntry.Builder, acl.Acl.AclEntryOrBuilder> entriesBuilder_;
-
- /**
- * repeated .acl.AclEntry entries = 5;
- */
- public java.util.List getEntriesList() {
- if (entriesBuilder_ == null) {
- return java.util.Collections.unmodifiableList(entries_);
- } else {
- return entriesBuilder_.getMessageList();
- }
- }
- /**
- * repeated .acl.AclEntry entries = 5;
- */
- public int getEntriesCount() {
- if (entriesBuilder_ == null) {
- return entries_.size();
- } else {
- return entriesBuilder_.getCount();
- }
- }
- /**
- * repeated .acl.AclEntry entries = 5;
- */
- public acl.Acl.AclEntry getEntries(int index) {
- if (entriesBuilder_ == null) {
- return entries_.get(index);
- } else {
- return entriesBuilder_.getMessage(index);
- }
- }
- /**
- * repeated .acl.AclEntry entries = 5;
- */
- public Builder setEntries(
- int index, acl.Acl.AclEntry value) {
- if (entriesBuilder_ == null) {
- if (value == null) {
- throw new NullPointerException();
- }
- ensureEntriesIsMutable();
- entries_.set(index, value);
- onChanged();
- } else {
- entriesBuilder_.setMessage(index, value);
- }
- return this;
- }
- /**
- * repeated .acl.AclEntry entries = 5;
- */
- public Builder setEntries(
- int index, acl.Acl.AclEntry.Builder builderForValue) {
- if (entriesBuilder_ == null) {
- ensureEntriesIsMutable();
- entries_.set(index, builderForValue.build());
- onChanged();
- } else {
- entriesBuilder_.setMessage(index, builderForValue.build());
- }
- return this;
- }
- /**
- * repeated .acl.AclEntry entries = 5;
- */
- public Builder addEntries(acl.Acl.AclEntry value) {
- if (entriesBuilder_ == null) {
- if (value == null) {
- throw new NullPointerException();
- }
- ensureEntriesIsMutable();
- entries_.add(value);
- onChanged();
- } else {
- entriesBuilder_.addMessage(value);
- }
- return this;
- }
- /**
- * repeated .acl.AclEntry entries = 5;
- */
- public Builder addEntries(
- int index, acl.Acl.AclEntry value) {
- if (entriesBuilder_ == null) {
- if (value == null) {
- throw new NullPointerException();
- }
- ensureEntriesIsMutable();
- entries_.add(index, value);
- onChanged();
- } else {
- entriesBuilder_.addMessage(index, value);
- }
- return this;
- }
- /**
- * repeated .acl.AclEntry entries = 5;
- */
- public Builder addEntries(
- acl.Acl.AclEntry.Builder builderForValue) {
- if (entriesBuilder_ == null) {
- ensureEntriesIsMutable();
- entries_.add(builderForValue.build());
- onChanged();
- } else {
- entriesBuilder_.addMessage(builderForValue.build());
- }
- return this;
- }
- /**
- * repeated .acl.AclEntry entries = 5;
- */
- public Builder addEntries(
- int index, acl.Acl.AclEntry.Builder builderForValue) {
- if (entriesBuilder_ == null) {
- ensureEntriesIsMutable();
- entries_.add(index, builderForValue.build());
- onChanged();
- } else {
- entriesBuilder_.addMessage(index, builderForValue.build());
- }
- return this;
- }
- /**
- * repeated .acl.AclEntry entries = 5;
- */
- public Builder addAllEntries(
- java.lang.Iterable 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.List
- getEntriesBuilderList() {
- return getEntriesFieldBuilder().getBuilderList();
- }
- private com.google.protobuf.RepeatedFieldBuilderV3<
- acl.Acl.AclEntry, acl.Acl.AclEntry.Builder, acl.Acl.AclEntryOrBuilder>
- getEntriesFieldBuilder() {
- if (entriesBuilder_ == null) {
- entriesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
- acl.Acl.AclEntry, acl.Acl.AclEntry.Builder, acl.Acl.AclEntryOrBuilder>(
- entries_,
- ((bitField0_ & 0x00000001) != 0),
- getParentForChildren(),
- isClean());
- entries_ = null;
- }
- return entriesBuilder_;
- }
- @java.lang.Override
- public final Builder setUnknownFields(
- final com.google.protobuf.UnknownFieldSet unknownFields) {
- return super.setUnknownFields(unknownFields);
- }
-
- @java.lang.Override
- public final Builder mergeUnknownFields(
- final com.google.protobuf.UnknownFieldSet unknownFields) {
- return super.mergeUnknownFields(unknownFields);
- }
-
-
- // @@protoc_insertion_point(builder_scope:acl.AclRuleSet)
- }
-
- // @@protoc_insertion_point(class_scope:acl.AclRuleSet)
- private static final acl.Acl.AclRuleSet DEFAULT_INSTANCE;
- static {
- DEFAULT_INSTANCE = new acl.Acl.AclRuleSet();
- }
-
- public static acl.Acl.AclRuleSet getDefaultInstance() {
- return DEFAULT_INSTANCE;
- }
-
- private static final com.google.protobuf.Parser
- PARSER = new com.google.protobuf.AbstractParser() {
- @java.lang.Override
- public AclRuleSet parsePartialFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return new AclRuleSet(input, extensionRegistry);
- }
- };
-
- public static com.google.protobuf.Parser parser() {
- return PARSER;
- }
-
- @java.lang.Override
- public com.google.protobuf.Parser getParserForType() {
- return PARSER;
- }
-
- @java.lang.Override
- public acl.Acl.AclRuleSet getDefaultInstanceForType() {
- return DEFAULT_INSTANCE;
- }
-
- }
-
- private static final com.google.protobuf.Descriptors.Descriptor
- internal_static_acl_AclMatch_descriptor;
- private static final
- com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
- internal_static_acl_AclMatch_fieldAccessorTable;
- private static final com.google.protobuf.Descriptors.Descriptor
- internal_static_acl_AclAction_descriptor;
- private static final
- com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
- internal_static_acl_AclAction_fieldAccessorTable;
- private static final com.google.protobuf.Descriptors.Descriptor
- internal_static_acl_AclEntry_descriptor;
- private static final
- com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
- internal_static_acl_AclEntry_fieldAccessorTable;
- private static final com.google.protobuf.Descriptors.Descriptor
- internal_static_acl_AclRuleSet_descriptor;
- private static final
- com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
- internal_static_acl_AclRuleSet_fieldAccessorTable;
-
- public static com.google.protobuf.Descriptors.FileDescriptor
- getDescriptor() {
- return descriptor;
- }
- private static com.google.protobuf.Descriptors.FileDescriptor
- descriptor;
- static {
- java.lang.String[] descriptorData = {
- "\n\tacl.proto\022\003acl\"\252\001\n\010AclMatch\022\014\n\004dscp\030\001 " +
- "\001(\r\022\020\n\010protocol\030\002 \001(\r\022\023\n\013src_address\030\003 \001" +
- "(\t\022\023\n\013dst_address\030\004 \001(\t\022\020\n\010src_port\030\005 \001(" +
- "\r\022\020\n\010dst_port\030\006 \001(\r\022\030\n\020start_mpls_label\030" +
- "\007 \001(\r\022\026\n\016end_mpls_label\030\010 \001(\r\"i\n\tAclActi" +
- "on\0221\n\016forward_action\030\001 \001(\0162\031.acl.AclForw" +
- "ardActionEnum\022)\n\nlog_action\030\002 \001(\0162\025.acl." +
- "AclLogActionEnum\"r\n\010AclEntry\022\023\n\013sequence" +
- "_id\030\001 \001(\r\022\023\n\013description\030\002 \001(\t\022\034\n\005match\030" +
- "\003 \001(\0132\r.acl.AclMatch\022\036\n\006action\030\004 \001(\0132\016.a" +
- "cl.AclAction\"\204\001\n\nAclRuleSet\022\014\n\004name\030\001 \001(" +
- "\t\022\"\n\004type\030\002 \001(\0162\024.acl.AclRuleTypeEnum\022\023\n" +
- "\013description\030\003 \001(\t\022\017\n\007user_id\030\004 \001(\t\022\036\n\007e" +
- "ntries\030\005 \003(\0132\r.acl.AclEntry*\231\001\n\017AclRuleT" +
- "ypeEnum\022\031\n\025ACLRULETYPE_UNDEFINED\020\000\022\024\n\020AC" +
- "LRULETYPE_IPV4\020\001\022\024\n\020ACLRULETYPE_IPV6\020\002\022\022" +
- "\n\016ACLRULETYPE_L2\020\003\022\024\n\020ACLRULETYPE_MPLS\020\004" +
- "\022\025\n\021ACLRULETYPE_MIXED\020\005*\227\001\n\024AclForwardAc" +
- "tionEnum\022!\n\035ACLFORWARDINGACTION_UNDEFINE" +
- "D\020\000\022\034\n\030ACLFORWARDINGACTION_DROP\020\001\022\036\n\032ACL" +
- "FORWARDINGACTION_ACCEPT\020\002\022\036\n\032ACLFORWARDI" +
- "NGACTION_REJECT\020\003*_\n\020AclLogActionEnum\022\032\n" +
- "\026ACLLOGACTION_UNDEFINED\020\000\022\026\n\022ACLLOGACTIO" +
- "N_NOLOG\020\001\022\027\n\023ACLLOGACTION_SYSLOG\020\002b\006prot" +
- "o3"
- };
- descriptor = com.google.protobuf.Descriptors.FileDescriptor
- .internalBuildGeneratedFileFrom(descriptorData,
- new com.google.protobuf.Descriptors.FileDescriptor[] {
- });
- internal_static_acl_AclMatch_descriptor =
- getDescriptor().getMessageTypes().get(0);
- internal_static_acl_AclMatch_fieldAccessorTable = new
- com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
- internal_static_acl_AclMatch_descriptor,
- new java.lang.String[] { "Dscp", "Protocol", "SrcAddress", "DstAddress", "SrcPort", "DstPort", "StartMplsLabel", "EndMplsLabel", });
- internal_static_acl_AclAction_descriptor =
- getDescriptor().getMessageTypes().get(1);
- internal_static_acl_AclAction_fieldAccessorTable = new
- com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
- internal_static_acl_AclAction_descriptor,
- new java.lang.String[] { "ForwardAction", "LogAction", });
- internal_static_acl_AclEntry_descriptor =
- getDescriptor().getMessageTypes().get(2);
- internal_static_acl_AclEntry_fieldAccessorTable = new
- com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
- internal_static_acl_AclEntry_descriptor,
- new java.lang.String[] { "SequenceId", "Description", "Match", "Action", });
- internal_static_acl_AclRuleSet_descriptor =
- getDescriptor().getMessageTypes().get(3);
- internal_static_acl_AclRuleSet_fieldAccessorTable = new
- com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
- internal_static_acl_AclRuleSet_descriptor,
- new java.lang.String[] { "Name", "Type", "Description", "UserId", "Entries", });
- }
-
- // @@protoc_insertion_point(outer_class_scope)
-}
diff --git a/src/automation/target/generated-sources/grpc/automation/Automation.java b/src/automation/target/generated-sources/grpc/automation/Automation.java
deleted file mode 100644
index cd82f7423092c72c6c2fa02836db645db52f7041..0000000000000000000000000000000000000000
--- a/src/automation/target/generated-sources/grpc/automation/Automation.java
+++ /dev/null
@@ -1,4920 +0,0 @@
-// Generated by the protocol buffer compiler. DO NOT EDIT!
-// source: automation.proto
-
-package automation;
-
-public final class Automation {
- private Automation() {}
- public static void registerAllExtensions(
- com.google.protobuf.ExtensionRegistryLite registry) {
- }
-
- public static void registerAllExtensions(
- com.google.protobuf.ExtensionRegistry registry) {
- registerAllExtensions(
- (com.google.protobuf.ExtensionRegistryLite) registry);
- }
- /**
- * Protobuf enum {@code automation.DeviceRoleType}
- */
- public enum DeviceRoleType
- implements com.google.protobuf.ProtocolMessageEnum {
- /**
- * NONE = 0;
- */
- NONE(0),
- /**
- * DEV_OPS = 1;
- */
- DEV_OPS(1),
- /**
- * DEV_CONF = 2;
- */
- DEV_CONF(2),
- /**
- * PIPELINE_CONF = 3;
- */
- PIPELINE_CONF(3),
- UNRECOGNIZED(-1),
- ;
-
- /**
- * NONE = 0;
- */
- public static final int NONE_VALUE = 0;
- /**
- * DEV_OPS = 1;
- */
- public static final int DEV_OPS_VALUE = 1;
- /**
- * DEV_CONF = 2;
- */
- public static final int DEV_CONF_VALUE = 2;
- /**
- * PIPELINE_CONF = 3;
- */
- public static final int PIPELINE_CONF_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 DeviceRoleType 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 DeviceRoleType forNumber(int value) {
- switch (value) {
- case 0: return NONE;
- case 1: return DEV_OPS;
- case 2: return DEV_CONF;
- case 3: return PIPELINE_CONF;
- default: return null;
- }
- }
-
- public static com.google.protobuf.Internal.EnumLiteMap
- internalGetValueMap() {
- return internalValueMap;
- }
- private static final com.google.protobuf.Internal.EnumLiteMap<
- DeviceRoleType> internalValueMap =
- new com.google.protobuf.Internal.EnumLiteMap() {
- public DeviceRoleType findValueByNumber(int number) {
- return DeviceRoleType.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 automation.Automation.getDescriptor().getEnumTypes().get(0);
- }
-
- private static final DeviceRoleType[] VALUES = values();
-
- public static DeviceRoleType 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 DeviceRoleType(int value) {
- this.value = value;
- }
-
- // @@protoc_insertion_point(enum_scope:automation.DeviceRoleType)
- }
-
- /**
- * Protobuf enum {@code automation.ZtpDeviceState}
- */
- public enum ZtpDeviceState
- implements com.google.protobuf.ProtocolMessageEnum {
- /**
- * ZTP_DEV_STATE_UNDEFINED = 0;
- */
- ZTP_DEV_STATE_UNDEFINED(0),
- /**
- * ZTP_DEV_STATE_CREATED = 1;
- */
- ZTP_DEV_STATE_CREATED(1),
- /**
- * ZTP_DEV_STATE_UPDATED = 2;
- */
- ZTP_DEV_STATE_UPDATED(2),
- /**
- * ZTP_DEV_STATE_DELETED = 3;
- */
- ZTP_DEV_STATE_DELETED(3),
- UNRECOGNIZED(-1),
- ;
-
- /**
- * ZTP_DEV_STATE_UNDEFINED = 0;
- */
- public static final int ZTP_DEV_STATE_UNDEFINED_VALUE = 0;
- /**
- * ZTP_DEV_STATE_CREATED = 1;
- */
- public static final int ZTP_DEV_STATE_CREATED_VALUE = 1;
- /**
- * ZTP_DEV_STATE_UPDATED = 2;
- */
- public static final int ZTP_DEV_STATE_UPDATED_VALUE = 2;
- /**
- * ZTP_DEV_STATE_DELETED = 3;
- */
- public static final int ZTP_DEV_STATE_DELETED_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 ZtpDeviceState 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 ZtpDeviceState forNumber(int value) {
- switch (value) {
- case 0: return ZTP_DEV_STATE_UNDEFINED;
- case 1: return ZTP_DEV_STATE_CREATED;
- case 2: return ZTP_DEV_STATE_UPDATED;
- case 3: return ZTP_DEV_STATE_DELETED;
- default: return null;
- }
- }
-
- public static com.google.protobuf.Internal.EnumLiteMap
- internalGetValueMap() {
- return internalValueMap;
- }
- private static final com.google.protobuf.Internal.EnumLiteMap<
- ZtpDeviceState> internalValueMap =
- new com.google.protobuf.Internal.EnumLiteMap() {
- public ZtpDeviceState findValueByNumber(int number) {
- return ZtpDeviceState.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 automation.Automation.getDescriptor().getEnumTypes().get(1);
- }
-
- private static final ZtpDeviceState[] VALUES = values();
-
- public static ZtpDeviceState 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 ZtpDeviceState(int value) {
- this.value = value;
- }
-
- // @@protoc_insertion_point(enum_scope:automation.ZtpDeviceState)
- }
-
- public interface DeviceRoleIdOrBuilder extends
- // @@protoc_insertion_point(interface_extends:automation.DeviceRoleId)
- com.google.protobuf.MessageOrBuilder {
-
- /**
- * .context.Uuid devRoleId = 1;
- * @return Whether the devRoleId field is set.
- */
- boolean hasDevRoleId();
- /**
- * .context.Uuid devRoleId = 1;
- * @return The devRoleId.
- */
- context.ContextOuterClass.Uuid getDevRoleId();
- /**
- * .context.Uuid devRoleId = 1;
- */
- context.ContextOuterClass.UuidOrBuilder getDevRoleIdOrBuilder();
-
- /**
- * .context.DeviceId devId = 2;
- * @return Whether the devId field is set.
- */
- boolean hasDevId();
- /**
- * .context.DeviceId devId = 2;
- * @return The devId.
- */
- context.ContextOuterClass.DeviceId getDevId();
- /**
- * .context.DeviceId devId = 2;
- */
- context.ContextOuterClass.DeviceIdOrBuilder getDevIdOrBuilder();
- }
- /**
- * Protobuf type {@code automation.DeviceRoleId}
- */
- public static final class DeviceRoleId extends
- com.google.protobuf.GeneratedMessageV3 implements
- // @@protoc_insertion_point(message_implements:automation.DeviceRoleId)
- DeviceRoleIdOrBuilder {
- private static final long serialVersionUID = 0L;
- // Use DeviceRoleId.newBuilder() to construct.
- private DeviceRoleId(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
- super(builder);
- }
- private DeviceRoleId() {
- }
-
- @java.lang.Override
- @SuppressWarnings({"unused"})
- protected java.lang.Object newInstance(
- UnusedPrivateParameter unused) {
- return new DeviceRoleId();
- }
-
- @java.lang.Override
- public final com.google.protobuf.UnknownFieldSet
- getUnknownFields() {
- return this.unknownFields;
- }
- private DeviceRoleId(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- this();
- if (extensionRegistry == null) {
- throw new java.lang.NullPointerException();
- }
- com.google.protobuf.UnknownFieldSet.Builder unknownFields =
- com.google.protobuf.UnknownFieldSet.newBuilder();
- try {
- boolean done = false;
- while (!done) {
- int tag = input.readTag();
- switch (tag) {
- case 0:
- done = true;
- break;
- case 10: {
- context.ContextOuterClass.Uuid.Builder subBuilder = null;
- if (devRoleId_ != null) {
- subBuilder = devRoleId_.toBuilder();
- }
- devRoleId_ = input.readMessage(context.ContextOuterClass.Uuid.parser(), extensionRegistry);
- if (subBuilder != null) {
- subBuilder.mergeFrom(devRoleId_);
- devRoleId_ = subBuilder.buildPartial();
- }
-
- break;
- }
- case 18: {
- context.ContextOuterClass.DeviceId.Builder subBuilder = null;
- if (devId_ != null) {
- subBuilder = devId_.toBuilder();
- }
- devId_ = input.readMessage(context.ContextOuterClass.DeviceId.parser(), extensionRegistry);
- if (subBuilder != null) {
- subBuilder.mergeFrom(devId_);
- devId_ = 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 automation.Automation.internal_static_automation_DeviceRoleId_descriptor;
- }
-
- @java.lang.Override
- protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
- internalGetFieldAccessorTable() {
- return automation.Automation.internal_static_automation_DeviceRoleId_fieldAccessorTable
- .ensureFieldAccessorsInitialized(
- automation.Automation.DeviceRoleId.class, automation.Automation.DeviceRoleId.Builder.class);
- }
-
- public static final int DEVROLEID_FIELD_NUMBER = 1;
- private context.ContextOuterClass.Uuid devRoleId_;
- /**
- * .context.Uuid devRoleId = 1;
- * @return Whether the devRoleId field is set.
- */
- @java.lang.Override
- public boolean hasDevRoleId() {
- return devRoleId_ != null;
- }
- /**
- * .context.Uuid devRoleId = 1;
- * @return The devRoleId.
- */
- @java.lang.Override
- public context.ContextOuterClass.Uuid getDevRoleId() {
- return devRoleId_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : devRoleId_;
- }
- /**
- * .context.Uuid devRoleId = 1;
- */
- @java.lang.Override
- public context.ContextOuterClass.UuidOrBuilder getDevRoleIdOrBuilder() {
- return getDevRoleId();
- }
-
- public static final int DEVID_FIELD_NUMBER = 2;
- private context.ContextOuterClass.DeviceId devId_;
- /**
- * .context.DeviceId devId = 2;
- * @return Whether the devId field is set.
- */
- @java.lang.Override
- public boolean hasDevId() {
- return devId_ != null;
- }
- /**
- * .context.DeviceId devId = 2;
- * @return The devId.
- */
- @java.lang.Override
- public context.ContextOuterClass.DeviceId getDevId() {
- return devId_ == null ? context.ContextOuterClass.DeviceId.getDefaultInstance() : devId_;
- }
- /**
- * .context.DeviceId devId = 2;
- */
- @java.lang.Override
- public context.ContextOuterClass.DeviceIdOrBuilder getDevIdOrBuilder() {
- return getDevId();
- }
-
- 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 (devRoleId_ != null) {
- output.writeMessage(1, getDevRoleId());
- }
- if (devId_ != null) {
- output.writeMessage(2, getDevId());
- }
- unknownFields.writeTo(output);
- }
-
- @java.lang.Override
- public int getSerializedSize() {
- int size = memoizedSize;
- if (size != -1) return size;
-
- size = 0;
- if (devRoleId_ != null) {
- size += com.google.protobuf.CodedOutputStream
- .computeMessageSize(1, getDevRoleId());
- }
- if (devId_ != null) {
- size += com.google.protobuf.CodedOutputStream
- .computeMessageSize(2, getDevId());
- }
- size += unknownFields.getSerializedSize();
- memoizedSize = size;
- return size;
- }
-
- @java.lang.Override
- public boolean equals(final java.lang.Object obj) {
- if (obj == this) {
- return true;
- }
- if (!(obj instanceof automation.Automation.DeviceRoleId)) {
- return super.equals(obj);
- }
- automation.Automation.DeviceRoleId other = (automation.Automation.DeviceRoleId) obj;
-
- if (hasDevRoleId() != other.hasDevRoleId()) return false;
- if (hasDevRoleId()) {
- if (!getDevRoleId()
- .equals(other.getDevRoleId())) return false;
- }
- if (hasDevId() != other.hasDevId()) return false;
- if (hasDevId()) {
- if (!getDevId()
- .equals(other.getDevId())) 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 (hasDevRoleId()) {
- hash = (37 * hash) + DEVROLEID_FIELD_NUMBER;
- hash = (53 * hash) + getDevRoleId().hashCode();
- }
- if (hasDevId()) {
- hash = (37 * hash) + DEVID_FIELD_NUMBER;
- hash = (53 * hash) + getDevId().hashCode();
- }
- hash = (29 * hash) + unknownFields.hashCode();
- memoizedHashCode = hash;
- return hash;
- }
-
- public static automation.Automation.DeviceRoleId parseFrom(
- java.nio.ByteBuffer data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data);
- }
- public static automation.Automation.DeviceRoleId parseFrom(
- java.nio.ByteBuffer data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data, extensionRegistry);
- }
- public static automation.Automation.DeviceRoleId parseFrom(
- com.google.protobuf.ByteString data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data);
- }
- public static automation.Automation.DeviceRoleId parseFrom(
- com.google.protobuf.ByteString data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data, extensionRegistry);
- }
- public static automation.Automation.DeviceRoleId parseFrom(byte[] data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data);
- }
- public static automation.Automation.DeviceRoleId parseFrom(
- byte[] data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data, extensionRegistry);
- }
- public static automation.Automation.DeviceRoleId parseFrom(java.io.InputStream input)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input);
- }
- public static automation.Automation.DeviceRoleId parseFrom(
- java.io.InputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input, extensionRegistry);
- }
- public static automation.Automation.DeviceRoleId parseDelimitedFrom(java.io.InputStream input)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseDelimitedWithIOException(PARSER, input);
- }
- public static automation.Automation.DeviceRoleId parseDelimitedFrom(
- java.io.InputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
- }
- public static automation.Automation.DeviceRoleId parseFrom(
- com.google.protobuf.CodedInputStream input)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input);
- }
- public static automation.Automation.DeviceRoleId parseFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input, extensionRegistry);
- }
-
- @java.lang.Override
- public Builder newBuilderForType() { return newBuilder(); }
- public static Builder newBuilder() {
- return DEFAULT_INSTANCE.toBuilder();
- }
- public static Builder newBuilder(automation.Automation.DeviceRoleId prototype) {
- return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
- }
- @java.lang.Override
- public Builder toBuilder() {
- return this == DEFAULT_INSTANCE
- ? new Builder() : new Builder().mergeFrom(this);
- }
-
- @java.lang.Override
- protected Builder newBuilderForType(
- com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
- Builder builder = new Builder(parent);
- return builder;
- }
- /**
- * Protobuf type {@code automation.DeviceRoleId}
- */
- public static final class Builder extends
- com.google.protobuf.GeneratedMessageV3.Builder implements
- // @@protoc_insertion_point(builder_implements:automation.DeviceRoleId)
- automation.Automation.DeviceRoleIdOrBuilder {
- public static final com.google.protobuf.Descriptors.Descriptor
- getDescriptor() {
- return automation.Automation.internal_static_automation_DeviceRoleId_descriptor;
- }
-
- @java.lang.Override
- protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
- internalGetFieldAccessorTable() {
- return automation.Automation.internal_static_automation_DeviceRoleId_fieldAccessorTable
- .ensureFieldAccessorsInitialized(
- automation.Automation.DeviceRoleId.class, automation.Automation.DeviceRoleId.Builder.class);
- }
-
- // Construct using automation.Automation.DeviceRoleId.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 (devRoleIdBuilder_ == null) {
- devRoleId_ = null;
- } else {
- devRoleId_ = null;
- devRoleIdBuilder_ = null;
- }
- if (devIdBuilder_ == null) {
- devId_ = null;
- } else {
- devId_ = null;
- devIdBuilder_ = null;
- }
- return this;
- }
-
- @java.lang.Override
- public com.google.protobuf.Descriptors.Descriptor
- getDescriptorForType() {
- return automation.Automation.internal_static_automation_DeviceRoleId_descriptor;
- }
-
- @java.lang.Override
- public automation.Automation.DeviceRoleId getDefaultInstanceForType() {
- return automation.Automation.DeviceRoleId.getDefaultInstance();
- }
-
- @java.lang.Override
- public automation.Automation.DeviceRoleId build() {
- automation.Automation.DeviceRoleId result = buildPartial();
- if (!result.isInitialized()) {
- throw newUninitializedMessageException(result);
- }
- return result;
- }
-
- @java.lang.Override
- public automation.Automation.DeviceRoleId buildPartial() {
- automation.Automation.DeviceRoleId result = new automation.Automation.DeviceRoleId(this);
- if (devRoleIdBuilder_ == null) {
- result.devRoleId_ = devRoleId_;
- } else {
- result.devRoleId_ = devRoleIdBuilder_.build();
- }
- if (devIdBuilder_ == null) {
- result.devId_ = devId_;
- } else {
- result.devId_ = devIdBuilder_.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 automation.Automation.DeviceRoleId) {
- return mergeFrom((automation.Automation.DeviceRoleId)other);
- } else {
- super.mergeFrom(other);
- return this;
- }
- }
-
- public Builder mergeFrom(automation.Automation.DeviceRoleId other) {
- if (other == automation.Automation.DeviceRoleId.getDefaultInstance()) return this;
- if (other.hasDevRoleId()) {
- mergeDevRoleId(other.getDevRoleId());
- }
- if (other.hasDevId()) {
- mergeDevId(other.getDevId());
- }
- this.mergeUnknownFields(other.unknownFields);
- onChanged();
- return this;
- }
-
- @java.lang.Override
- public final boolean isInitialized() {
- return true;
- }
-
- @java.lang.Override
- public Builder mergeFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- automation.Automation.DeviceRoleId parsedMessage = null;
- try {
- parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
- } catch (com.google.protobuf.InvalidProtocolBufferException e) {
- parsedMessage = (automation.Automation.DeviceRoleId) e.getUnfinishedMessage();
- throw e.unwrapIOException();
- } finally {
- if (parsedMessage != null) {
- mergeFrom(parsedMessage);
- }
- }
- return this;
- }
-
- private context.ContextOuterClass.Uuid devRoleId_;
- private com.google.protobuf.SingleFieldBuilderV3<
- context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> devRoleIdBuilder_;
- /**
- * .context.Uuid devRoleId = 1;
- * @return Whether the devRoleId field is set.
- */
- public boolean hasDevRoleId() {
- return devRoleIdBuilder_ != null || devRoleId_ != null;
- }
- /**
- * .context.Uuid devRoleId = 1;
- * @return The devRoleId.
- */
- public context.ContextOuterClass.Uuid getDevRoleId() {
- if (devRoleIdBuilder_ == null) {
- return devRoleId_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : devRoleId_;
- } else {
- return devRoleIdBuilder_.getMessage();
- }
- }
- /**
- * .context.Uuid devRoleId = 1;
- */
- public Builder setDevRoleId(context.ContextOuterClass.Uuid value) {
- if (devRoleIdBuilder_ == null) {
- if (value == null) {
- throw new NullPointerException();
- }
- devRoleId_ = value;
- onChanged();
- } else {
- devRoleIdBuilder_.setMessage(value);
- }
-
- return this;
- }
- /**
- * .context.Uuid devRoleId = 1;
- */
- public Builder setDevRoleId(
- context.ContextOuterClass.Uuid.Builder builderForValue) {
- if (devRoleIdBuilder_ == null) {
- devRoleId_ = builderForValue.build();
- onChanged();
- } else {
- devRoleIdBuilder_.setMessage(builderForValue.build());
- }
-
- return this;
- }
- /**
- * .context.Uuid devRoleId = 1;
- */
- public Builder mergeDevRoleId(context.ContextOuterClass.Uuid value) {
- if (devRoleIdBuilder_ == null) {
- if (devRoleId_ != null) {
- devRoleId_ =
- context.ContextOuterClass.Uuid.newBuilder(devRoleId_).mergeFrom(value).buildPartial();
- } else {
- devRoleId_ = value;
- }
- onChanged();
- } else {
- devRoleIdBuilder_.mergeFrom(value);
- }
-
- return this;
- }
- /**
- * .context.Uuid devRoleId = 1;
- */
- public Builder clearDevRoleId() {
- if (devRoleIdBuilder_ == null) {
- devRoleId_ = null;
- onChanged();
- } else {
- devRoleId_ = null;
- devRoleIdBuilder_ = null;
- }
-
- return this;
- }
- /**
- * .context.Uuid devRoleId = 1;
- */
- public context.ContextOuterClass.Uuid.Builder getDevRoleIdBuilder() {
-
- onChanged();
- return getDevRoleIdFieldBuilder().getBuilder();
- }
- /**
- * .context.Uuid devRoleId = 1;
- */
- public context.ContextOuterClass.UuidOrBuilder getDevRoleIdOrBuilder() {
- if (devRoleIdBuilder_ != null) {
- return devRoleIdBuilder_.getMessageOrBuilder();
- } else {
- return devRoleId_ == null ?
- context.ContextOuterClass.Uuid.getDefaultInstance() : devRoleId_;
- }
- }
- /**
- * .context.Uuid devRoleId = 1;
- */
- private com.google.protobuf.SingleFieldBuilderV3<
- context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder>
- getDevRoleIdFieldBuilder() {
- if (devRoleIdBuilder_ == null) {
- devRoleIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
- context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder>(
- getDevRoleId(),
- getParentForChildren(),
- isClean());
- devRoleId_ = null;
- }
- return devRoleIdBuilder_;
- }
-
- private context.ContextOuterClass.DeviceId devId_;
- private com.google.protobuf.SingleFieldBuilderV3<
- context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> devIdBuilder_;
- /**
- * .context.DeviceId devId = 2;
- * @return Whether the devId field is set.
- */
- public boolean hasDevId() {
- return devIdBuilder_ != null || devId_ != null;
- }
- /**
- * .context.DeviceId devId = 2;
- * @return The devId.
- */
- public context.ContextOuterClass.DeviceId getDevId() {
- if (devIdBuilder_ == null) {
- return devId_ == null ? context.ContextOuterClass.DeviceId.getDefaultInstance() : devId_;
- } else {
- return devIdBuilder_.getMessage();
- }
- }
- /**
- * .context.DeviceId devId = 2;
- */
- public Builder setDevId(context.ContextOuterClass.DeviceId value) {
- if (devIdBuilder_ == null) {
- if (value == null) {
- throw new NullPointerException();
- }
- devId_ = value;
- onChanged();
- } else {
- devIdBuilder_.setMessage(value);
- }
-
- return this;
- }
- /**
- * .context.DeviceId devId = 2;
- */
- public Builder setDevId(
- context.ContextOuterClass.DeviceId.Builder builderForValue) {
- if (devIdBuilder_ == null) {
- devId_ = builderForValue.build();
- onChanged();
- } else {
- devIdBuilder_.setMessage(builderForValue.build());
- }
-
- return this;
- }
- /**
- * .context.DeviceId devId = 2;
- */
- public Builder mergeDevId(context.ContextOuterClass.DeviceId value) {
- if (devIdBuilder_ == null) {
- if (devId_ != null) {
- devId_ =
- context.ContextOuterClass.DeviceId.newBuilder(devId_).mergeFrom(value).buildPartial();
- } else {
- devId_ = value;
- }
- onChanged();
- } else {
- devIdBuilder_.mergeFrom(value);
- }
-
- return this;
- }
- /**
- * .context.DeviceId devId = 2;
- */
- public Builder clearDevId() {
- if (devIdBuilder_ == null) {
- devId_ = null;
- onChanged();
- } else {
- devId_ = null;
- devIdBuilder_ = null;
- }
-
- return this;
- }
- /**
- * .context.DeviceId devId = 2;
- */
- public context.ContextOuterClass.DeviceId.Builder getDevIdBuilder() {
-
- onChanged();
- return getDevIdFieldBuilder().getBuilder();
- }
- /**
- * .context.DeviceId devId = 2;
- */
- public context.ContextOuterClass.DeviceIdOrBuilder getDevIdOrBuilder() {
- if (devIdBuilder_ != null) {
- return devIdBuilder_.getMessageOrBuilder();
- } else {
- return devId_ == null ?
- context.ContextOuterClass.DeviceId.getDefaultInstance() : devId_;
- }
- }
- /**
- * .context.DeviceId devId = 2;
- */
- private com.google.protobuf.SingleFieldBuilderV3<
- context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder>
- getDevIdFieldBuilder() {
- if (devIdBuilder_ == null) {
- devIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
- context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder>(
- getDevId(),
- getParentForChildren(),
- isClean());
- devId_ = null;
- }
- return devIdBuilder_;
- }
- @java.lang.Override
- public final Builder setUnknownFields(
- final com.google.protobuf.UnknownFieldSet unknownFields) {
- return super.setUnknownFields(unknownFields);
- }
-
- @java.lang.Override
- public final Builder mergeUnknownFields(
- final com.google.protobuf.UnknownFieldSet unknownFields) {
- return super.mergeUnknownFields(unknownFields);
- }
-
-
- // @@protoc_insertion_point(builder_scope:automation.DeviceRoleId)
- }
-
- // @@protoc_insertion_point(class_scope:automation.DeviceRoleId)
- private static final automation.Automation.DeviceRoleId DEFAULT_INSTANCE;
- static {
- DEFAULT_INSTANCE = new automation.Automation.DeviceRoleId();
- }
-
- public static automation.Automation.DeviceRoleId getDefaultInstance() {
- return DEFAULT_INSTANCE;
- }
-
- private static final com.google.protobuf.Parser
- PARSER = new com.google.protobuf.AbstractParser() {
- @java.lang.Override
- public DeviceRoleId parsePartialFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return new DeviceRoleId(input, extensionRegistry);
- }
- };
-
- public static com.google.protobuf.Parser parser() {
- return PARSER;
- }
-
- @java.lang.Override
- public com.google.protobuf.Parser getParserForType() {
- return PARSER;
- }
-
- @java.lang.Override
- public automation.Automation.DeviceRoleId getDefaultInstanceForType() {
- return DEFAULT_INSTANCE;
- }
-
- }
-
- public interface DeviceRoleOrBuilder extends
- // @@protoc_insertion_point(interface_extends:automation.DeviceRole)
- com.google.protobuf.MessageOrBuilder {
-
- /**
- * .automation.DeviceRoleId devRoleId = 1;
- * @return Whether the devRoleId field is set.
- */
- boolean hasDevRoleId();
- /**
- * .automation.DeviceRoleId devRoleId = 1;
- * @return The devRoleId.
- */
- automation.Automation.DeviceRoleId getDevRoleId();
- /**
- * .automation.DeviceRoleId devRoleId = 1;
- */
- automation.Automation.DeviceRoleIdOrBuilder getDevRoleIdOrBuilder();
-
- /**
- * .automation.DeviceRoleType devRoleType = 2;
- * @return The enum numeric value on the wire for devRoleType.
- */
- int getDevRoleTypeValue();
- /**
- * .automation.DeviceRoleType devRoleType = 2;
- * @return The devRoleType.
- */
- automation.Automation.DeviceRoleType getDevRoleType();
- }
- /**
- * Protobuf type {@code automation.DeviceRole}
- */
- public static final class DeviceRole extends
- com.google.protobuf.GeneratedMessageV3 implements
- // @@protoc_insertion_point(message_implements:automation.DeviceRole)
- DeviceRoleOrBuilder {
- private static final long serialVersionUID = 0L;
- // Use DeviceRole.newBuilder() to construct.
- private DeviceRole(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
- super(builder);
- }
- private DeviceRole() {
- devRoleType_ = 0;
- }
-
- @java.lang.Override
- @SuppressWarnings({"unused"})
- protected java.lang.Object newInstance(
- UnusedPrivateParameter unused) {
- return new DeviceRole();
- }
-
- @java.lang.Override
- public final com.google.protobuf.UnknownFieldSet
- getUnknownFields() {
- return this.unknownFields;
- }
- private DeviceRole(
- 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: {
- automation.Automation.DeviceRoleId.Builder subBuilder = null;
- if (devRoleId_ != null) {
- subBuilder = devRoleId_.toBuilder();
- }
- devRoleId_ = input.readMessage(automation.Automation.DeviceRoleId.parser(), extensionRegistry);
- if (subBuilder != null) {
- subBuilder.mergeFrom(devRoleId_);
- devRoleId_ = subBuilder.buildPartial();
- }
-
- break;
- }
- case 16: {
- int rawValue = input.readEnum();
-
- devRoleType_ = 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 automation.Automation.internal_static_automation_DeviceRole_descriptor;
- }
-
- @java.lang.Override
- protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
- internalGetFieldAccessorTable() {
- return automation.Automation.internal_static_automation_DeviceRole_fieldAccessorTable
- .ensureFieldAccessorsInitialized(
- automation.Automation.DeviceRole.class, automation.Automation.DeviceRole.Builder.class);
- }
-
- public static final int DEVROLEID_FIELD_NUMBER = 1;
- private automation.Automation.DeviceRoleId devRoleId_;
- /**
- * .automation.DeviceRoleId devRoleId = 1;
- * @return Whether the devRoleId field is set.
- */
- @java.lang.Override
- public boolean hasDevRoleId() {
- return devRoleId_ != null;
- }
- /**
- * .automation.DeviceRoleId devRoleId = 1;
- * @return The devRoleId.
- */
- @java.lang.Override
- public automation.Automation.DeviceRoleId getDevRoleId() {
- return devRoleId_ == null ? automation.Automation.DeviceRoleId.getDefaultInstance() : devRoleId_;
- }
- /**
- * .automation.DeviceRoleId devRoleId = 1;
- */
- @java.lang.Override
- public automation.Automation.DeviceRoleIdOrBuilder getDevRoleIdOrBuilder() {
- return getDevRoleId();
- }
-
- public static final int DEVROLETYPE_FIELD_NUMBER = 2;
- private int devRoleType_;
- /**
- * .automation.DeviceRoleType devRoleType = 2;
- * @return The enum numeric value on the wire for devRoleType.
- */
- @java.lang.Override public int getDevRoleTypeValue() {
- return devRoleType_;
- }
- /**
- * .automation.DeviceRoleType devRoleType = 2;
- * @return The devRoleType.
- */
- @java.lang.Override public automation.Automation.DeviceRoleType getDevRoleType() {
- @SuppressWarnings("deprecation")
- automation.Automation.DeviceRoleType result = automation.Automation.DeviceRoleType.valueOf(devRoleType_);
- return result == null ? automation.Automation.DeviceRoleType.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 (devRoleId_ != null) {
- output.writeMessage(1, getDevRoleId());
- }
- if (devRoleType_ != automation.Automation.DeviceRoleType.NONE.getNumber()) {
- output.writeEnum(2, devRoleType_);
- }
- unknownFields.writeTo(output);
- }
-
- @java.lang.Override
- public int getSerializedSize() {
- int size = memoizedSize;
- if (size != -1) return size;
-
- size = 0;
- if (devRoleId_ != null) {
- size += com.google.protobuf.CodedOutputStream
- .computeMessageSize(1, getDevRoleId());
- }
- if (devRoleType_ != automation.Automation.DeviceRoleType.NONE.getNumber()) {
- size += com.google.protobuf.CodedOutputStream
- .computeEnumSize(2, devRoleType_);
- }
- size += unknownFields.getSerializedSize();
- memoizedSize = size;
- return size;
- }
-
- @java.lang.Override
- public boolean equals(final java.lang.Object obj) {
- if (obj == this) {
- return true;
- }
- if (!(obj instanceof automation.Automation.DeviceRole)) {
- return super.equals(obj);
- }
- automation.Automation.DeviceRole other = (automation.Automation.DeviceRole) obj;
-
- if (hasDevRoleId() != other.hasDevRoleId()) return false;
- if (hasDevRoleId()) {
- if (!getDevRoleId()
- .equals(other.getDevRoleId())) return false;
- }
- if (devRoleType_ != other.devRoleType_) 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 (hasDevRoleId()) {
- hash = (37 * hash) + DEVROLEID_FIELD_NUMBER;
- hash = (53 * hash) + getDevRoleId().hashCode();
- }
- hash = (37 * hash) + DEVROLETYPE_FIELD_NUMBER;
- hash = (53 * hash) + devRoleType_;
- hash = (29 * hash) + unknownFields.hashCode();
- memoizedHashCode = hash;
- return hash;
- }
-
- public static automation.Automation.DeviceRole parseFrom(
- java.nio.ByteBuffer data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data);
- }
- public static automation.Automation.DeviceRole parseFrom(
- java.nio.ByteBuffer data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data, extensionRegistry);
- }
- public static automation.Automation.DeviceRole parseFrom(
- com.google.protobuf.ByteString data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data);
- }
- public static automation.Automation.DeviceRole parseFrom(
- com.google.protobuf.ByteString data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data, extensionRegistry);
- }
- public static automation.Automation.DeviceRole parseFrom(byte[] data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data);
- }
- public static automation.Automation.DeviceRole parseFrom(
- byte[] data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data, extensionRegistry);
- }
- public static automation.Automation.DeviceRole parseFrom(java.io.InputStream input)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input);
- }
- public static automation.Automation.DeviceRole parseFrom(
- java.io.InputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input, extensionRegistry);
- }
- public static automation.Automation.DeviceRole parseDelimitedFrom(java.io.InputStream input)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseDelimitedWithIOException(PARSER, input);
- }
- public static automation.Automation.DeviceRole parseDelimitedFrom(
- java.io.InputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
- }
- public static automation.Automation.DeviceRole parseFrom(
- com.google.protobuf.CodedInputStream input)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input);
- }
- public static automation.Automation.DeviceRole parseFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input, extensionRegistry);
- }
-
- @java.lang.Override
- public Builder newBuilderForType() { return newBuilder(); }
- public static Builder newBuilder() {
- return DEFAULT_INSTANCE.toBuilder();
- }
- public static Builder newBuilder(automation.Automation.DeviceRole prototype) {
- return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
- }
- @java.lang.Override
- public Builder toBuilder() {
- return this == DEFAULT_INSTANCE
- ? new Builder() : new Builder().mergeFrom(this);
- }
-
- @java.lang.Override
- protected Builder newBuilderForType(
- com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
- Builder builder = new Builder(parent);
- return builder;
- }
- /**
- * Protobuf type {@code automation.DeviceRole}
- */
- public static final class Builder extends
- com.google.protobuf.GeneratedMessageV3.Builder implements
- // @@protoc_insertion_point(builder_implements:automation.DeviceRole)
- automation.Automation.DeviceRoleOrBuilder {
- public static final com.google.protobuf.Descriptors.Descriptor
- getDescriptor() {
- return automation.Automation.internal_static_automation_DeviceRole_descriptor;
- }
-
- @java.lang.Override
- protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
- internalGetFieldAccessorTable() {
- return automation.Automation.internal_static_automation_DeviceRole_fieldAccessorTable
- .ensureFieldAccessorsInitialized(
- automation.Automation.DeviceRole.class, automation.Automation.DeviceRole.Builder.class);
- }
-
- // Construct using automation.Automation.DeviceRole.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 (devRoleIdBuilder_ == null) {
- devRoleId_ = null;
- } else {
- devRoleId_ = null;
- devRoleIdBuilder_ = null;
- }
- devRoleType_ = 0;
-
- return this;
- }
-
- @java.lang.Override
- public com.google.protobuf.Descriptors.Descriptor
- getDescriptorForType() {
- return automation.Automation.internal_static_automation_DeviceRole_descriptor;
- }
-
- @java.lang.Override
- public automation.Automation.DeviceRole getDefaultInstanceForType() {
- return automation.Automation.DeviceRole.getDefaultInstance();
- }
-
- @java.lang.Override
- public automation.Automation.DeviceRole build() {
- automation.Automation.DeviceRole result = buildPartial();
- if (!result.isInitialized()) {
- throw newUninitializedMessageException(result);
- }
- return result;
- }
-
- @java.lang.Override
- public automation.Automation.DeviceRole buildPartial() {
- automation.Automation.DeviceRole result = new automation.Automation.DeviceRole(this);
- if (devRoleIdBuilder_ == null) {
- result.devRoleId_ = devRoleId_;
- } else {
- result.devRoleId_ = devRoleIdBuilder_.build();
- }
- result.devRoleType_ = devRoleType_;
- onBuilt();
- return result;
- }
-
- @java.lang.Override
- public Builder clone() {
- return super.clone();
- }
- @java.lang.Override
- public Builder setField(
- com.google.protobuf.Descriptors.FieldDescriptor field,
- java.lang.Object value) {
- return super.setField(field, value);
- }
- @java.lang.Override
- public Builder clearField(
- com.google.protobuf.Descriptors.FieldDescriptor field) {
- return super.clearField(field);
- }
- @java.lang.Override
- public Builder clearOneof(
- com.google.protobuf.Descriptors.OneofDescriptor oneof) {
- return super.clearOneof(oneof);
- }
- @java.lang.Override
- public Builder setRepeatedField(
- com.google.protobuf.Descriptors.FieldDescriptor field,
- int index, java.lang.Object value) {
- return super.setRepeatedField(field, index, value);
- }
- @java.lang.Override
- public Builder addRepeatedField(
- com.google.protobuf.Descriptors.FieldDescriptor field,
- java.lang.Object value) {
- return super.addRepeatedField(field, value);
- }
- @java.lang.Override
- public Builder mergeFrom(com.google.protobuf.Message other) {
- if (other instanceof automation.Automation.DeviceRole) {
- return mergeFrom((automation.Automation.DeviceRole)other);
- } else {
- super.mergeFrom(other);
- return this;
- }
- }
-
- public Builder mergeFrom(automation.Automation.DeviceRole other) {
- if (other == automation.Automation.DeviceRole.getDefaultInstance()) return this;
- if (other.hasDevRoleId()) {
- mergeDevRoleId(other.getDevRoleId());
- }
- if (other.devRoleType_ != 0) {
- setDevRoleTypeValue(other.getDevRoleTypeValue());
- }
- this.mergeUnknownFields(other.unknownFields);
- onChanged();
- return this;
- }
-
- @java.lang.Override
- public final boolean isInitialized() {
- return true;
- }
-
- @java.lang.Override
- public Builder mergeFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- automation.Automation.DeviceRole parsedMessage = null;
- try {
- parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
- } catch (com.google.protobuf.InvalidProtocolBufferException e) {
- parsedMessage = (automation.Automation.DeviceRole) e.getUnfinishedMessage();
- throw e.unwrapIOException();
- } finally {
- if (parsedMessage != null) {
- mergeFrom(parsedMessage);
- }
- }
- return this;
- }
-
- private automation.Automation.DeviceRoleId devRoleId_;
- private com.google.protobuf.SingleFieldBuilderV3<
- automation.Automation.DeviceRoleId, automation.Automation.DeviceRoleId.Builder, automation.Automation.DeviceRoleIdOrBuilder> devRoleIdBuilder_;
- /**
- * .automation.DeviceRoleId devRoleId = 1;
- * @return Whether the devRoleId field is set.
- */
- public boolean hasDevRoleId() {
- return devRoleIdBuilder_ != null || devRoleId_ != null;
- }
- /**
- * .automation.DeviceRoleId devRoleId = 1;
- * @return The devRoleId.
- */
- public automation.Automation.DeviceRoleId getDevRoleId() {
- if (devRoleIdBuilder_ == null) {
- return devRoleId_ == null ? automation.Automation.DeviceRoleId.getDefaultInstance() : devRoleId_;
- } else {
- return devRoleIdBuilder_.getMessage();
- }
- }
- /**
- * .automation.DeviceRoleId devRoleId = 1;
- */
- public Builder setDevRoleId(automation.Automation.DeviceRoleId value) {
- if (devRoleIdBuilder_ == null) {
- if (value == null) {
- throw new NullPointerException();
- }
- devRoleId_ = value;
- onChanged();
- } else {
- devRoleIdBuilder_.setMessage(value);
- }
-
- return this;
- }
- /**
- * .automation.DeviceRoleId devRoleId = 1;
- */
- public Builder setDevRoleId(
- automation.Automation.DeviceRoleId.Builder builderForValue) {
- if (devRoleIdBuilder_ == null) {
- devRoleId_ = builderForValue.build();
- onChanged();
- } else {
- devRoleIdBuilder_.setMessage(builderForValue.build());
- }
-
- return this;
- }
- /**
- * .automation.DeviceRoleId devRoleId = 1;
- */
- public Builder mergeDevRoleId(automation.Automation.DeviceRoleId value) {
- if (devRoleIdBuilder_ == null) {
- if (devRoleId_ != null) {
- devRoleId_ =
- automation.Automation.DeviceRoleId.newBuilder(devRoleId_).mergeFrom(value).buildPartial();
- } else {
- devRoleId_ = value;
- }
- onChanged();
- } else {
- devRoleIdBuilder_.mergeFrom(value);
- }
-
- return this;
- }
- /**
- * .automation.DeviceRoleId devRoleId = 1;
- */
- public Builder clearDevRoleId() {
- if (devRoleIdBuilder_ == null) {
- devRoleId_ = null;
- onChanged();
- } else {
- devRoleId_ = null;
- devRoleIdBuilder_ = null;
- }
-
- return this;
- }
- /**
- * .automation.DeviceRoleId devRoleId = 1;
- */
- public automation.Automation.DeviceRoleId.Builder getDevRoleIdBuilder() {
-
- onChanged();
- return getDevRoleIdFieldBuilder().getBuilder();
- }
- /**
- * .automation.DeviceRoleId devRoleId = 1;
- */
- public automation.Automation.DeviceRoleIdOrBuilder getDevRoleIdOrBuilder() {
- if (devRoleIdBuilder_ != null) {
- return devRoleIdBuilder_.getMessageOrBuilder();
- } else {
- return devRoleId_ == null ?
- automation.Automation.DeviceRoleId.getDefaultInstance() : devRoleId_;
- }
- }
- /**
- * .automation.DeviceRoleId devRoleId = 1;
- */
- private com.google.protobuf.SingleFieldBuilderV3<
- automation.Automation.DeviceRoleId, automation.Automation.DeviceRoleId.Builder, automation.Automation.DeviceRoleIdOrBuilder>
- getDevRoleIdFieldBuilder() {
- if (devRoleIdBuilder_ == null) {
- devRoleIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
- automation.Automation.DeviceRoleId, automation.Automation.DeviceRoleId.Builder, automation.Automation.DeviceRoleIdOrBuilder>(
- getDevRoleId(),
- getParentForChildren(),
- isClean());
- devRoleId_ = null;
- }
- return devRoleIdBuilder_;
- }
-
- private int devRoleType_ = 0;
- /**
- * .automation.DeviceRoleType devRoleType = 2;
- * @return The enum numeric value on the wire for devRoleType.
- */
- @java.lang.Override public int getDevRoleTypeValue() {
- return devRoleType_;
- }
- /**
- * .automation.DeviceRoleType devRoleType = 2;
- * @param value The enum numeric value on the wire for devRoleType to set.
- * @return This builder for chaining.
- */
- public Builder setDevRoleTypeValue(int value) {
-
- devRoleType_ = value;
- onChanged();
- return this;
- }
- /**
- * .automation.DeviceRoleType devRoleType = 2;
- * @return The devRoleType.
- */
- @java.lang.Override
- public automation.Automation.DeviceRoleType getDevRoleType() {
- @SuppressWarnings("deprecation")
- automation.Automation.DeviceRoleType result = automation.Automation.DeviceRoleType.valueOf(devRoleType_);
- return result == null ? automation.Automation.DeviceRoleType.UNRECOGNIZED : result;
- }
- /**
- * .automation.DeviceRoleType devRoleType = 2;
- * @param value The devRoleType to set.
- * @return This builder for chaining.
- */
- public Builder setDevRoleType(automation.Automation.DeviceRoleType value) {
- if (value == null) {
- throw new NullPointerException();
- }
-
- devRoleType_ = value.getNumber();
- onChanged();
- return this;
- }
- /**
- * .automation.DeviceRoleType devRoleType = 2;
- * @return This builder for chaining.
- */
- public Builder clearDevRoleType() {
-
- devRoleType_ = 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:automation.DeviceRole)
- }
-
- // @@protoc_insertion_point(class_scope:automation.DeviceRole)
- private static final automation.Automation.DeviceRole DEFAULT_INSTANCE;
- static {
- DEFAULT_INSTANCE = new automation.Automation.DeviceRole();
- }
-
- public static automation.Automation.DeviceRole getDefaultInstance() {
- return DEFAULT_INSTANCE;
- }
-
- private static final com.google.protobuf.Parser
- PARSER = new com.google.protobuf.AbstractParser() {
- @java.lang.Override
- public DeviceRole parsePartialFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return new DeviceRole(input, extensionRegistry);
- }
- };
-
- public static com.google.protobuf.Parser parser() {
- return PARSER;
- }
-
- @java.lang.Override
- public com.google.protobuf.Parser getParserForType() {
- return PARSER;
- }
-
- @java.lang.Override
- public automation.Automation.DeviceRole getDefaultInstanceForType() {
- return DEFAULT_INSTANCE;
- }
-
- }
-
- public interface DeviceRoleConfigOrBuilder extends
- // @@protoc_insertion_point(interface_extends:automation.DeviceRoleConfig)
- com.google.protobuf.MessageOrBuilder {
-
- /**
- * .automation.DeviceRole devRole = 1;
- * @return Whether the devRole field is set.
- */
- boolean hasDevRole();
- /**
- * .automation.DeviceRole devRole = 1;
- * @return The devRole.
- */
- automation.Automation.DeviceRole getDevRole();
- /**
- * .automation.DeviceRole devRole = 1;
- */
- automation.Automation.DeviceRoleOrBuilder getDevRoleOrBuilder();
-
- /**
- * .context.DeviceConfig devConfig = 2;
- * @return Whether the devConfig field is set.
- */
- boolean hasDevConfig();
- /**
- * .context.DeviceConfig devConfig = 2;
- * @return The devConfig.
- */
- context.ContextOuterClass.DeviceConfig getDevConfig();
- /**
- * .context.DeviceConfig devConfig = 2;
- */
- context.ContextOuterClass.DeviceConfigOrBuilder getDevConfigOrBuilder();
- }
- /**
- * Protobuf type {@code automation.DeviceRoleConfig}
- */
- public static final class DeviceRoleConfig extends
- com.google.protobuf.GeneratedMessageV3 implements
- // @@protoc_insertion_point(message_implements:automation.DeviceRoleConfig)
- DeviceRoleConfigOrBuilder {
- private static final long serialVersionUID = 0L;
- // Use DeviceRoleConfig.newBuilder() to construct.
- private DeviceRoleConfig(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
- super(builder);
- }
- private DeviceRoleConfig() {
- }
-
- @java.lang.Override
- @SuppressWarnings({"unused"})
- protected java.lang.Object newInstance(
- UnusedPrivateParameter unused) {
- return new DeviceRoleConfig();
- }
-
- @java.lang.Override
- public final com.google.protobuf.UnknownFieldSet
- getUnknownFields() {
- return this.unknownFields;
- }
- private DeviceRoleConfig(
- 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: {
- automation.Automation.DeviceRole.Builder subBuilder = null;
- if (devRole_ != null) {
- subBuilder = devRole_.toBuilder();
- }
- devRole_ = input.readMessage(automation.Automation.DeviceRole.parser(), extensionRegistry);
- if (subBuilder != null) {
- subBuilder.mergeFrom(devRole_);
- devRole_ = subBuilder.buildPartial();
- }
-
- break;
- }
- case 18: {
- context.ContextOuterClass.DeviceConfig.Builder subBuilder = null;
- if (devConfig_ != null) {
- subBuilder = devConfig_.toBuilder();
- }
- devConfig_ = input.readMessage(context.ContextOuterClass.DeviceConfig.parser(), extensionRegistry);
- if (subBuilder != null) {
- subBuilder.mergeFrom(devConfig_);
- devConfig_ = 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 automation.Automation.internal_static_automation_DeviceRoleConfig_descriptor;
- }
-
- @java.lang.Override
- protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
- internalGetFieldAccessorTable() {
- return automation.Automation.internal_static_automation_DeviceRoleConfig_fieldAccessorTable
- .ensureFieldAccessorsInitialized(
- automation.Automation.DeviceRoleConfig.class, automation.Automation.DeviceRoleConfig.Builder.class);
- }
-
- public static final int DEVROLE_FIELD_NUMBER = 1;
- private automation.Automation.DeviceRole devRole_;
- /**
- * .automation.DeviceRole devRole = 1;
- * @return Whether the devRole field is set.
- */
- @java.lang.Override
- public boolean hasDevRole() {
- return devRole_ != null;
- }
- /**
- * .automation.DeviceRole devRole = 1;
- * @return The devRole.
- */
- @java.lang.Override
- public automation.Automation.DeviceRole getDevRole() {
- return devRole_ == null ? automation.Automation.DeviceRole.getDefaultInstance() : devRole_;
- }
- /**
- * .automation.DeviceRole devRole = 1;
- */
- @java.lang.Override
- public automation.Automation.DeviceRoleOrBuilder getDevRoleOrBuilder() {
- return getDevRole();
- }
-
- public static final int DEVCONFIG_FIELD_NUMBER = 2;
- private context.ContextOuterClass.DeviceConfig devConfig_;
- /**
- * .context.DeviceConfig devConfig = 2;
- * @return Whether the devConfig field is set.
- */
- @java.lang.Override
- public boolean hasDevConfig() {
- return devConfig_ != null;
- }
- /**
- * .context.DeviceConfig devConfig = 2;
- * @return The devConfig.
- */
- @java.lang.Override
- public context.ContextOuterClass.DeviceConfig getDevConfig() {
- return devConfig_ == null ? context.ContextOuterClass.DeviceConfig.getDefaultInstance() : devConfig_;
- }
- /**
- * .context.DeviceConfig devConfig = 2;
- */
- @java.lang.Override
- public context.ContextOuterClass.DeviceConfigOrBuilder getDevConfigOrBuilder() {
- return getDevConfig();
- }
-
- 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 (devRole_ != null) {
- output.writeMessage(1, getDevRole());
- }
- if (devConfig_ != null) {
- output.writeMessage(2, getDevConfig());
- }
- unknownFields.writeTo(output);
- }
-
- @java.lang.Override
- public int getSerializedSize() {
- int size = memoizedSize;
- if (size != -1) return size;
-
- size = 0;
- if (devRole_ != null) {
- size += com.google.protobuf.CodedOutputStream
- .computeMessageSize(1, getDevRole());
- }
- if (devConfig_ != null) {
- size += com.google.protobuf.CodedOutputStream
- .computeMessageSize(2, getDevConfig());
- }
- size += unknownFields.getSerializedSize();
- memoizedSize = size;
- return size;
- }
-
- @java.lang.Override
- public boolean equals(final java.lang.Object obj) {
- if (obj == this) {
- return true;
- }
- if (!(obj instanceof automation.Automation.DeviceRoleConfig)) {
- return super.equals(obj);
- }
- automation.Automation.DeviceRoleConfig other = (automation.Automation.DeviceRoleConfig) obj;
-
- if (hasDevRole() != other.hasDevRole()) return false;
- if (hasDevRole()) {
- if (!getDevRole()
- .equals(other.getDevRole())) return false;
- }
- if (hasDevConfig() != other.hasDevConfig()) return false;
- if (hasDevConfig()) {
- if (!getDevConfig()
- .equals(other.getDevConfig())) 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 (hasDevRole()) {
- hash = (37 * hash) + DEVROLE_FIELD_NUMBER;
- hash = (53 * hash) + getDevRole().hashCode();
- }
- if (hasDevConfig()) {
- hash = (37 * hash) + DEVCONFIG_FIELD_NUMBER;
- hash = (53 * hash) + getDevConfig().hashCode();
- }
- hash = (29 * hash) + unknownFields.hashCode();
- memoizedHashCode = hash;
- return hash;
- }
-
- public static automation.Automation.DeviceRoleConfig parseFrom(
- java.nio.ByteBuffer data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data);
- }
- public static automation.Automation.DeviceRoleConfig parseFrom(
- java.nio.ByteBuffer data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data, extensionRegistry);
- }
- public static automation.Automation.DeviceRoleConfig parseFrom(
- com.google.protobuf.ByteString data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data);
- }
- public static automation.Automation.DeviceRoleConfig parseFrom(
- com.google.protobuf.ByteString data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data, extensionRegistry);
- }
- public static automation.Automation.DeviceRoleConfig parseFrom(byte[] data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data);
- }
- public static automation.Automation.DeviceRoleConfig parseFrom(
- byte[] data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data, extensionRegistry);
- }
- public static automation.Automation.DeviceRoleConfig parseFrom(java.io.InputStream input)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input);
- }
- public static automation.Automation.DeviceRoleConfig parseFrom(
- java.io.InputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input, extensionRegistry);
- }
- public static automation.Automation.DeviceRoleConfig parseDelimitedFrom(java.io.InputStream input)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseDelimitedWithIOException(PARSER, input);
- }
- public static automation.Automation.DeviceRoleConfig parseDelimitedFrom(
- java.io.InputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
- }
- public static automation.Automation.DeviceRoleConfig parseFrom(
- com.google.protobuf.CodedInputStream input)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input);
- }
- public static automation.Automation.DeviceRoleConfig parseFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input, extensionRegistry);
- }
-
- @java.lang.Override
- public Builder newBuilderForType() { return newBuilder(); }
- public static Builder newBuilder() {
- return DEFAULT_INSTANCE.toBuilder();
- }
- public static Builder newBuilder(automation.Automation.DeviceRoleConfig prototype) {
- return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
- }
- @java.lang.Override
- public Builder toBuilder() {
- return this == DEFAULT_INSTANCE
- ? new Builder() : new Builder().mergeFrom(this);
- }
-
- @java.lang.Override
- protected Builder newBuilderForType(
- com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
- Builder builder = new Builder(parent);
- return builder;
- }
- /**
- * Protobuf type {@code automation.DeviceRoleConfig}
- */
- public static final class Builder extends
- com.google.protobuf.GeneratedMessageV3.Builder implements
- // @@protoc_insertion_point(builder_implements:automation.DeviceRoleConfig)
- automation.Automation.DeviceRoleConfigOrBuilder {
- public static final com.google.protobuf.Descriptors.Descriptor
- getDescriptor() {
- return automation.Automation.internal_static_automation_DeviceRoleConfig_descriptor;
- }
-
- @java.lang.Override
- protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
- internalGetFieldAccessorTable() {
- return automation.Automation.internal_static_automation_DeviceRoleConfig_fieldAccessorTable
- .ensureFieldAccessorsInitialized(
- automation.Automation.DeviceRoleConfig.class, automation.Automation.DeviceRoleConfig.Builder.class);
- }
-
- // Construct using automation.Automation.DeviceRoleConfig.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 (devRoleBuilder_ == null) {
- devRole_ = null;
- } else {
- devRole_ = null;
- devRoleBuilder_ = null;
- }
- if (devConfigBuilder_ == null) {
- devConfig_ = null;
- } else {
- devConfig_ = null;
- devConfigBuilder_ = null;
- }
- return this;
- }
-
- @java.lang.Override
- public com.google.protobuf.Descriptors.Descriptor
- getDescriptorForType() {
- return automation.Automation.internal_static_automation_DeviceRoleConfig_descriptor;
- }
-
- @java.lang.Override
- public automation.Automation.DeviceRoleConfig getDefaultInstanceForType() {
- return automation.Automation.DeviceRoleConfig.getDefaultInstance();
- }
-
- @java.lang.Override
- public automation.Automation.DeviceRoleConfig build() {
- automation.Automation.DeviceRoleConfig result = buildPartial();
- if (!result.isInitialized()) {
- throw newUninitializedMessageException(result);
- }
- return result;
- }
-
- @java.lang.Override
- public automation.Automation.DeviceRoleConfig buildPartial() {
- automation.Automation.DeviceRoleConfig result = new automation.Automation.DeviceRoleConfig(this);
- if (devRoleBuilder_ == null) {
- result.devRole_ = devRole_;
- } else {
- result.devRole_ = devRoleBuilder_.build();
- }
- if (devConfigBuilder_ == null) {
- result.devConfig_ = devConfig_;
- } else {
- result.devConfig_ = devConfigBuilder_.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 automation.Automation.DeviceRoleConfig) {
- return mergeFrom((automation.Automation.DeviceRoleConfig)other);
- } else {
- super.mergeFrom(other);
- return this;
- }
- }
-
- public Builder mergeFrom(automation.Automation.DeviceRoleConfig other) {
- if (other == automation.Automation.DeviceRoleConfig.getDefaultInstance()) return this;
- if (other.hasDevRole()) {
- mergeDevRole(other.getDevRole());
- }
- if (other.hasDevConfig()) {
- mergeDevConfig(other.getDevConfig());
- }
- this.mergeUnknownFields(other.unknownFields);
- onChanged();
- return this;
- }
-
- @java.lang.Override
- public final boolean isInitialized() {
- return true;
- }
-
- @java.lang.Override
- public Builder mergeFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- automation.Automation.DeviceRoleConfig parsedMessage = null;
- try {
- parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
- } catch (com.google.protobuf.InvalidProtocolBufferException e) {
- parsedMessage = (automation.Automation.DeviceRoleConfig) e.getUnfinishedMessage();
- throw e.unwrapIOException();
- } finally {
- if (parsedMessage != null) {
- mergeFrom(parsedMessage);
- }
- }
- return this;
- }
-
- private automation.Automation.DeviceRole devRole_;
- private com.google.protobuf.SingleFieldBuilderV3<
- automation.Automation.DeviceRole, automation.Automation.DeviceRole.Builder, automation.Automation.DeviceRoleOrBuilder> devRoleBuilder_;
- /**
- * .automation.DeviceRole devRole = 1;
- * @return Whether the devRole field is set.
- */
- public boolean hasDevRole() {
- return devRoleBuilder_ != null || devRole_ != null;
- }
- /**
- * .automation.DeviceRole devRole = 1;
- * @return The devRole.
- */
- public automation.Automation.DeviceRole getDevRole() {
- if (devRoleBuilder_ == null) {
- return devRole_ == null ? automation.Automation.DeviceRole.getDefaultInstance() : devRole_;
- } else {
- return devRoleBuilder_.getMessage();
- }
- }
- /**
- * .automation.DeviceRole devRole = 1;
- */
- public Builder setDevRole(automation.Automation.DeviceRole value) {
- if (devRoleBuilder_ == null) {
- if (value == null) {
- throw new NullPointerException();
- }
- devRole_ = value;
- onChanged();
- } else {
- devRoleBuilder_.setMessage(value);
- }
-
- return this;
- }
- /**
- * .automation.DeviceRole devRole = 1;
- */
- public Builder setDevRole(
- automation.Automation.DeviceRole.Builder builderForValue) {
- if (devRoleBuilder_ == null) {
- devRole_ = builderForValue.build();
- onChanged();
- } else {
- devRoleBuilder_.setMessage(builderForValue.build());
- }
-
- return this;
- }
- /**
- * .automation.DeviceRole devRole = 1;
- */
- public Builder mergeDevRole(automation.Automation.DeviceRole value) {
- if (devRoleBuilder_ == null) {
- if (devRole_ != null) {
- devRole_ =
- automation.Automation.DeviceRole.newBuilder(devRole_).mergeFrom(value).buildPartial();
- } else {
- devRole_ = value;
- }
- onChanged();
- } else {
- devRoleBuilder_.mergeFrom(value);
- }
-
- return this;
- }
- /**
- * .automation.DeviceRole devRole = 1;
- */
- public Builder clearDevRole() {
- if (devRoleBuilder_ == null) {
- devRole_ = null;
- onChanged();
- } else {
- devRole_ = null;
- devRoleBuilder_ = null;
- }
-
- return this;
- }
- /**
- * .automation.DeviceRole devRole = 1;
- */
- public automation.Automation.DeviceRole.Builder getDevRoleBuilder() {
-
- onChanged();
- return getDevRoleFieldBuilder().getBuilder();
- }
- /**
- * .automation.DeviceRole devRole = 1;
- */
- public automation.Automation.DeviceRoleOrBuilder getDevRoleOrBuilder() {
- if (devRoleBuilder_ != null) {
- return devRoleBuilder_.getMessageOrBuilder();
- } else {
- return devRole_ == null ?
- automation.Automation.DeviceRole.getDefaultInstance() : devRole_;
- }
- }
- /**
- * .automation.DeviceRole devRole = 1;
- */
- private com.google.protobuf.SingleFieldBuilderV3<
- automation.Automation.DeviceRole, automation.Automation.DeviceRole.Builder, automation.Automation.DeviceRoleOrBuilder>
- getDevRoleFieldBuilder() {
- if (devRoleBuilder_ == null) {
- devRoleBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
- automation.Automation.DeviceRole, automation.Automation.DeviceRole.Builder, automation.Automation.DeviceRoleOrBuilder>(
- getDevRole(),
- getParentForChildren(),
- isClean());
- devRole_ = null;
- }
- return devRoleBuilder_;
- }
-
- private context.ContextOuterClass.DeviceConfig devConfig_;
- private com.google.protobuf.SingleFieldBuilderV3<
- context.ContextOuterClass.DeviceConfig, context.ContextOuterClass.DeviceConfig.Builder, context.ContextOuterClass.DeviceConfigOrBuilder> devConfigBuilder_;
- /**
- * .context.DeviceConfig devConfig = 2;
- * @return Whether the devConfig field is set.
- */
- public boolean hasDevConfig() {
- return devConfigBuilder_ != null || devConfig_ != null;
- }
- /**
- * .context.DeviceConfig devConfig = 2;
- * @return The devConfig.
- */
- public context.ContextOuterClass.DeviceConfig getDevConfig() {
- if (devConfigBuilder_ == null) {
- return devConfig_ == null ? context.ContextOuterClass.DeviceConfig.getDefaultInstance() : devConfig_;
- } else {
- return devConfigBuilder_.getMessage();
- }
- }
- /**
- * .context.DeviceConfig devConfig = 2;
- */
- public Builder setDevConfig(context.ContextOuterClass.DeviceConfig value) {
- if (devConfigBuilder_ == null) {
- if (value == null) {
- throw new NullPointerException();
- }
- devConfig_ = value;
- onChanged();
- } else {
- devConfigBuilder_.setMessage(value);
- }
-
- return this;
- }
- /**
- * .context.DeviceConfig devConfig = 2;
- */
- public Builder setDevConfig(
- context.ContextOuterClass.DeviceConfig.Builder builderForValue) {
- if (devConfigBuilder_ == null) {
- devConfig_ = builderForValue.build();
- onChanged();
- } else {
- devConfigBuilder_.setMessage(builderForValue.build());
- }
-
- return this;
- }
- /**
- * .context.DeviceConfig devConfig = 2;
- */
- public Builder mergeDevConfig(context.ContextOuterClass.DeviceConfig value) {
- if (devConfigBuilder_ == null) {
- if (devConfig_ != null) {
- devConfig_ =
- context.ContextOuterClass.DeviceConfig.newBuilder(devConfig_).mergeFrom(value).buildPartial();
- } else {
- devConfig_ = value;
- }
- onChanged();
- } else {
- devConfigBuilder_.mergeFrom(value);
- }
-
- return this;
- }
- /**
- * .context.DeviceConfig devConfig = 2;
- */
- public Builder clearDevConfig() {
- if (devConfigBuilder_ == null) {
- devConfig_ = null;
- onChanged();
- } else {
- devConfig_ = null;
- devConfigBuilder_ = null;
- }
-
- return this;
- }
- /**
- * .context.DeviceConfig devConfig = 2;
- */
- public context.ContextOuterClass.DeviceConfig.Builder getDevConfigBuilder() {
-
- onChanged();
- return getDevConfigFieldBuilder().getBuilder();
- }
- /**
- * .context.DeviceConfig devConfig = 2;
- */
- public context.ContextOuterClass.DeviceConfigOrBuilder getDevConfigOrBuilder() {
- if (devConfigBuilder_ != null) {
- return devConfigBuilder_.getMessageOrBuilder();
- } else {
- return devConfig_ == null ?
- context.ContextOuterClass.DeviceConfig.getDefaultInstance() : devConfig_;
- }
- }
- /**
- * .context.DeviceConfig devConfig = 2;
- */
- private com.google.protobuf.SingleFieldBuilderV3<
- context.ContextOuterClass.DeviceConfig, context.ContextOuterClass.DeviceConfig.Builder, context.ContextOuterClass.DeviceConfigOrBuilder>
- getDevConfigFieldBuilder() {
- if (devConfigBuilder_ == null) {
- devConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
- context.ContextOuterClass.DeviceConfig, context.ContextOuterClass.DeviceConfig.Builder, context.ContextOuterClass.DeviceConfigOrBuilder>(
- getDevConfig(),
- getParentForChildren(),
- isClean());
- devConfig_ = null;
- }
- return devConfigBuilder_;
- }
- @java.lang.Override
- public final Builder setUnknownFields(
- final com.google.protobuf.UnknownFieldSet unknownFields) {
- return super.setUnknownFields(unknownFields);
- }
-
- @java.lang.Override
- public final Builder mergeUnknownFields(
- final com.google.protobuf.UnknownFieldSet unknownFields) {
- return super.mergeUnknownFields(unknownFields);
- }
-
-
- // @@protoc_insertion_point(builder_scope:automation.DeviceRoleConfig)
- }
-
- // @@protoc_insertion_point(class_scope:automation.DeviceRoleConfig)
- private static final automation.Automation.DeviceRoleConfig DEFAULT_INSTANCE;
- static {
- DEFAULT_INSTANCE = new automation.Automation.DeviceRoleConfig();
- }
-
- public static automation.Automation.DeviceRoleConfig getDefaultInstance() {
- return DEFAULT_INSTANCE;
- }
-
- private static final com.google.protobuf.Parser
- PARSER = new com.google.protobuf.AbstractParser() {
- @java.lang.Override
- public DeviceRoleConfig parsePartialFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return new DeviceRoleConfig(input, extensionRegistry);
- }
- };
-
- public static com.google.protobuf.Parser parser() {
- return PARSER;
- }
-
- @java.lang.Override
- public com.google.protobuf.Parser getParserForType() {
- return PARSER;
- }
-
- @java.lang.Override
- public automation.Automation.DeviceRoleConfig getDefaultInstanceForType() {
- return DEFAULT_INSTANCE;
- }
-
- }
-
- public interface DeviceRoleListOrBuilder extends
- // @@protoc_insertion_point(interface_extends:automation.DeviceRoleList)
- com.google.protobuf.MessageOrBuilder {
-
- /**
- * repeated .automation.DeviceRole devRole = 1;
- */
- java.util.List
- getDevRoleList();
- /**
- * repeated .automation.DeviceRole devRole = 1;
- */
- automation.Automation.DeviceRole getDevRole(int index);
- /**
- * repeated .automation.DeviceRole devRole = 1;
- */
- int getDevRoleCount();
- /**
- * repeated .automation.DeviceRole devRole = 1;
- */
- java.util.List extends automation.Automation.DeviceRoleOrBuilder>
- getDevRoleOrBuilderList();
- /**
- * repeated .automation.DeviceRole devRole = 1;
- */
- automation.Automation.DeviceRoleOrBuilder getDevRoleOrBuilder(
- int index);
- }
- /**
- * Protobuf type {@code automation.DeviceRoleList}
- */
- public static final class DeviceRoleList extends
- com.google.protobuf.GeneratedMessageV3 implements
- // @@protoc_insertion_point(message_implements:automation.DeviceRoleList)
- DeviceRoleListOrBuilder {
- private static final long serialVersionUID = 0L;
- // Use DeviceRoleList.newBuilder() to construct.
- private DeviceRoleList(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
- super(builder);
- }
- private DeviceRoleList() {
- devRole_ = java.util.Collections.emptyList();
- }
-
- @java.lang.Override
- @SuppressWarnings({"unused"})
- protected java.lang.Object newInstance(
- UnusedPrivateParameter unused) {
- return new DeviceRoleList();
- }
-
- @java.lang.Override
- public final com.google.protobuf.UnknownFieldSet
- getUnknownFields() {
- return this.unknownFields;
- }
- private DeviceRoleList(
- 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)) {
- devRole_ = new java.util.ArrayList();
- mutable_bitField0_ |= 0x00000001;
- }
- devRole_.add(
- input.readMessage(automation.Automation.DeviceRole.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)) {
- devRole_ = java.util.Collections.unmodifiableList(devRole_);
- }
- this.unknownFields = unknownFields.build();
- makeExtensionsImmutable();
- }
- }
- public static final com.google.protobuf.Descriptors.Descriptor
- getDescriptor() {
- return automation.Automation.internal_static_automation_DeviceRoleList_descriptor;
- }
-
- @java.lang.Override
- protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
- internalGetFieldAccessorTable() {
- return automation.Automation.internal_static_automation_DeviceRoleList_fieldAccessorTable
- .ensureFieldAccessorsInitialized(
- automation.Automation.DeviceRoleList.class, automation.Automation.DeviceRoleList.Builder.class);
- }
-
- public static final int DEVROLE_FIELD_NUMBER = 1;
- private java.util.List devRole_;
- /**
- * repeated .automation.DeviceRole devRole = 1;
- */
- @java.lang.Override
- public java.util.List getDevRoleList() {
- return devRole_;
- }
- /**
- * repeated .automation.DeviceRole devRole = 1;
- */
- @java.lang.Override
- public java.util.List extends automation.Automation.DeviceRoleOrBuilder>
- getDevRoleOrBuilderList() {
- return devRole_;
- }
- /**
- * repeated .automation.DeviceRole devRole = 1;
- */
- @java.lang.Override
- public int getDevRoleCount() {
- return devRole_.size();
- }
- /**
- * repeated .automation.DeviceRole devRole = 1;
- */
- @java.lang.Override
- public automation.Automation.DeviceRole getDevRole(int index) {
- return devRole_.get(index);
- }
- /**
- * repeated .automation.DeviceRole devRole = 1;
- */
- @java.lang.Override
- public automation.Automation.DeviceRoleOrBuilder getDevRoleOrBuilder(
- int index) {
- return devRole_.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 < devRole_.size(); i++) {
- output.writeMessage(1, devRole_.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 < devRole_.size(); i++) {
- size += com.google.protobuf.CodedOutputStream
- .computeMessageSize(1, devRole_.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 automation.Automation.DeviceRoleList)) {
- return super.equals(obj);
- }
- automation.Automation.DeviceRoleList other = (automation.Automation.DeviceRoleList) obj;
-
- if (!getDevRoleList()
- .equals(other.getDevRoleList())) 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 (getDevRoleCount() > 0) {
- hash = (37 * hash) + DEVROLE_FIELD_NUMBER;
- hash = (53 * hash) + getDevRoleList().hashCode();
- }
- hash = (29 * hash) + unknownFields.hashCode();
- memoizedHashCode = hash;
- return hash;
- }
-
- public static automation.Automation.DeviceRoleList parseFrom(
- java.nio.ByteBuffer data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data);
- }
- public static automation.Automation.DeviceRoleList parseFrom(
- java.nio.ByteBuffer data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data, extensionRegistry);
- }
- public static automation.Automation.DeviceRoleList parseFrom(
- com.google.protobuf.ByteString data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data);
- }
- public static automation.Automation.DeviceRoleList parseFrom(
- com.google.protobuf.ByteString data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data, extensionRegistry);
- }
- public static automation.Automation.DeviceRoleList parseFrom(byte[] data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data);
- }
- public static automation.Automation.DeviceRoleList parseFrom(
- byte[] data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data, extensionRegistry);
- }
- public static automation.Automation.DeviceRoleList parseFrom(java.io.InputStream input)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input);
- }
- public static automation.Automation.DeviceRoleList parseFrom(
- java.io.InputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input, extensionRegistry);
- }
- public static automation.Automation.DeviceRoleList parseDelimitedFrom(java.io.InputStream input)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseDelimitedWithIOException(PARSER, input);
- }
- public static automation.Automation.DeviceRoleList parseDelimitedFrom(
- java.io.InputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
- }
- public static automation.Automation.DeviceRoleList parseFrom(
- com.google.protobuf.CodedInputStream input)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input);
- }
- public static automation.Automation.DeviceRoleList parseFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input, extensionRegistry);
- }
-
- @java.lang.Override
- public Builder newBuilderForType() { return newBuilder(); }
- public static Builder newBuilder() {
- return DEFAULT_INSTANCE.toBuilder();
- }
- public static Builder newBuilder(automation.Automation.DeviceRoleList prototype) {
- return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
- }
- @java.lang.Override
- public Builder toBuilder() {
- return this == DEFAULT_INSTANCE
- ? new Builder() : new Builder().mergeFrom(this);
- }
-
- @java.lang.Override
- protected Builder newBuilderForType(
- com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
- Builder builder = new Builder(parent);
- return builder;
- }
- /**
- * Protobuf type {@code automation.DeviceRoleList}
- */
- public static final class Builder extends
- com.google.protobuf.GeneratedMessageV3.Builder implements
- // @@protoc_insertion_point(builder_implements:automation.DeviceRoleList)
- automation.Automation.DeviceRoleListOrBuilder {
- public static final com.google.protobuf.Descriptors.Descriptor
- getDescriptor() {
- return automation.Automation.internal_static_automation_DeviceRoleList_descriptor;
- }
-
- @java.lang.Override
- protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
- internalGetFieldAccessorTable() {
- return automation.Automation.internal_static_automation_DeviceRoleList_fieldAccessorTable
- .ensureFieldAccessorsInitialized(
- automation.Automation.DeviceRoleList.class, automation.Automation.DeviceRoleList.Builder.class);
- }
-
- // Construct using automation.Automation.DeviceRoleList.newBuilder()
- private Builder() {
- maybeForceBuilderInitialization();
- }
-
- private Builder(
- com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
- super(parent);
- maybeForceBuilderInitialization();
- }
- private void maybeForceBuilderInitialization() {
- if (com.google.protobuf.GeneratedMessageV3
- .alwaysUseFieldBuilders) {
- getDevRoleFieldBuilder();
- }
- }
- @java.lang.Override
- public Builder clear() {
- super.clear();
- if (devRoleBuilder_ == null) {
- devRole_ = java.util.Collections.emptyList();
- bitField0_ = (bitField0_ & ~0x00000001);
- } else {
- devRoleBuilder_.clear();
- }
- return this;
- }
-
- @java.lang.Override
- public com.google.protobuf.Descriptors.Descriptor
- getDescriptorForType() {
- return automation.Automation.internal_static_automation_DeviceRoleList_descriptor;
- }
-
- @java.lang.Override
- public automation.Automation.DeviceRoleList getDefaultInstanceForType() {
- return automation.Automation.DeviceRoleList.getDefaultInstance();
- }
-
- @java.lang.Override
- public automation.Automation.DeviceRoleList build() {
- automation.Automation.DeviceRoleList result = buildPartial();
- if (!result.isInitialized()) {
- throw newUninitializedMessageException(result);
- }
- return result;
- }
-
- @java.lang.Override
- public automation.Automation.DeviceRoleList buildPartial() {
- automation.Automation.DeviceRoleList result = new automation.Automation.DeviceRoleList(this);
- int from_bitField0_ = bitField0_;
- if (devRoleBuilder_ == null) {
- if (((bitField0_ & 0x00000001) != 0)) {
- devRole_ = java.util.Collections.unmodifiableList(devRole_);
- bitField0_ = (bitField0_ & ~0x00000001);
- }
- result.devRole_ = devRole_;
- } else {
- result.devRole_ = devRoleBuilder_.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 automation.Automation.DeviceRoleList) {
- return mergeFrom((automation.Automation.DeviceRoleList)other);
- } else {
- super.mergeFrom(other);
- return this;
- }
- }
-
- public Builder mergeFrom(automation.Automation.DeviceRoleList other) {
- if (other == automation.Automation.DeviceRoleList.getDefaultInstance()) return this;
- if (devRoleBuilder_ == null) {
- if (!other.devRole_.isEmpty()) {
- if (devRole_.isEmpty()) {
- devRole_ = other.devRole_;
- bitField0_ = (bitField0_ & ~0x00000001);
- } else {
- ensureDevRoleIsMutable();
- devRole_.addAll(other.devRole_);
- }
- onChanged();
- }
- } else {
- if (!other.devRole_.isEmpty()) {
- if (devRoleBuilder_.isEmpty()) {
- devRoleBuilder_.dispose();
- devRoleBuilder_ = null;
- devRole_ = other.devRole_;
- bitField0_ = (bitField0_ & ~0x00000001);
- devRoleBuilder_ =
- com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
- getDevRoleFieldBuilder() : null;
- } else {
- devRoleBuilder_.addAllMessages(other.devRole_);
- }
- }
- }
- this.mergeUnknownFields(other.unknownFields);
- onChanged();
- return this;
- }
-
- @java.lang.Override
- public final boolean isInitialized() {
- return true;
- }
-
- @java.lang.Override
- public Builder mergeFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- automation.Automation.DeviceRoleList parsedMessage = null;
- try {
- parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
- } catch (com.google.protobuf.InvalidProtocolBufferException e) {
- parsedMessage = (automation.Automation.DeviceRoleList) e.getUnfinishedMessage();
- throw e.unwrapIOException();
- } finally {
- if (parsedMessage != null) {
- mergeFrom(parsedMessage);
- }
- }
- return this;
- }
- private int bitField0_;
-
- private java.util.List devRole_ =
- java.util.Collections.emptyList();
- private void ensureDevRoleIsMutable() {
- if (!((bitField0_ & 0x00000001) != 0)) {
- devRole_ = new java.util.ArrayList(devRole_);
- bitField0_ |= 0x00000001;
- }
- }
-
- private com.google.protobuf.RepeatedFieldBuilderV3<
- automation.Automation.DeviceRole, automation.Automation.DeviceRole.Builder, automation.Automation.DeviceRoleOrBuilder> devRoleBuilder_;
-
- /**
- * repeated .automation.DeviceRole devRole = 1;
- */
- public java.util.List getDevRoleList() {
- if (devRoleBuilder_ == null) {
- return java.util.Collections.unmodifiableList(devRole_);
- } else {
- return devRoleBuilder_.getMessageList();
- }
- }
- /**
- * repeated .automation.DeviceRole devRole = 1;
- */
- public int getDevRoleCount() {
- if (devRoleBuilder_ == null) {
- return devRole_.size();
- } else {
- return devRoleBuilder_.getCount();
- }
- }
- /**
- * repeated .automation.DeviceRole devRole = 1;
- */
- public automation.Automation.DeviceRole getDevRole(int index) {
- if (devRoleBuilder_ == null) {
- return devRole_.get(index);
- } else {
- return devRoleBuilder_.getMessage(index);
- }
- }
- /**
- * repeated .automation.DeviceRole devRole = 1;
- */
- public Builder setDevRole(
- int index, automation.Automation.DeviceRole value) {
- if (devRoleBuilder_ == null) {
- if (value == null) {
- throw new NullPointerException();
- }
- ensureDevRoleIsMutable();
- devRole_.set(index, value);
- onChanged();
- } else {
- devRoleBuilder_.setMessage(index, value);
- }
- return this;
- }
- /**
- * repeated .automation.DeviceRole devRole = 1;
- */
- public Builder setDevRole(
- int index, automation.Automation.DeviceRole.Builder builderForValue) {
- if (devRoleBuilder_ == null) {
- ensureDevRoleIsMutable();
- devRole_.set(index, builderForValue.build());
- onChanged();
- } else {
- devRoleBuilder_.setMessage(index, builderForValue.build());
- }
- return this;
- }
- /**
- * repeated .automation.DeviceRole devRole = 1;
- */
- public Builder addDevRole(automation.Automation.DeviceRole value) {
- if (devRoleBuilder_ == null) {
- if (value == null) {
- throw new NullPointerException();
- }
- ensureDevRoleIsMutable();
- devRole_.add(value);
- onChanged();
- } else {
- devRoleBuilder_.addMessage(value);
- }
- return this;
- }
- /**
- * repeated .automation.DeviceRole devRole = 1;
- */
- public Builder addDevRole(
- int index, automation.Automation.DeviceRole value) {
- if (devRoleBuilder_ == null) {
- if (value == null) {
- throw new NullPointerException();
- }
- ensureDevRoleIsMutable();
- devRole_.add(index, value);
- onChanged();
- } else {
- devRoleBuilder_.addMessage(index, value);
- }
- return this;
- }
- /**
- * repeated .automation.DeviceRole devRole = 1;
- */
- public Builder addDevRole(
- automation.Automation.DeviceRole.Builder builderForValue) {
- if (devRoleBuilder_ == null) {
- ensureDevRoleIsMutable();
- devRole_.add(builderForValue.build());
- onChanged();
- } else {
- devRoleBuilder_.addMessage(builderForValue.build());
- }
- return this;
- }
- /**
- * repeated .automation.DeviceRole devRole = 1;
- */
- public Builder addDevRole(
- int index, automation.Automation.DeviceRole.Builder builderForValue) {
- if (devRoleBuilder_ == null) {
- ensureDevRoleIsMutable();
- devRole_.add(index, builderForValue.build());
- onChanged();
- } else {
- devRoleBuilder_.addMessage(index, builderForValue.build());
- }
- return this;
- }
- /**
- * repeated .automation.DeviceRole devRole = 1;
- */
- public Builder addAllDevRole(
- java.lang.Iterable extends automation.Automation.DeviceRole> values) {
- if (devRoleBuilder_ == null) {
- ensureDevRoleIsMutable();
- com.google.protobuf.AbstractMessageLite.Builder.addAll(
- values, devRole_);
- onChanged();
- } else {
- devRoleBuilder_.addAllMessages(values);
- }
- return this;
- }
- /**
- * repeated .automation.DeviceRole devRole = 1;
- */
- public Builder clearDevRole() {
- if (devRoleBuilder_ == null) {
- devRole_ = java.util.Collections.emptyList();
- bitField0_ = (bitField0_ & ~0x00000001);
- onChanged();
- } else {
- devRoleBuilder_.clear();
- }
- return this;
- }
- /**
- * repeated .automation.DeviceRole devRole = 1;
- */
- public Builder removeDevRole(int index) {
- if (devRoleBuilder_ == null) {
- ensureDevRoleIsMutable();
- devRole_.remove(index);
- onChanged();
- } else {
- devRoleBuilder_.remove(index);
- }
- return this;
- }
- /**
- * repeated .automation.DeviceRole devRole = 1;
- */
- public automation.Automation.DeviceRole.Builder getDevRoleBuilder(
- int index) {
- return getDevRoleFieldBuilder().getBuilder(index);
- }
- /**
- * repeated .automation.DeviceRole devRole = 1;
- */
- public automation.Automation.DeviceRoleOrBuilder getDevRoleOrBuilder(
- int index) {
- if (devRoleBuilder_ == null) {
- return devRole_.get(index); } else {
- return devRoleBuilder_.getMessageOrBuilder(index);
- }
- }
- /**
- * repeated .automation.DeviceRole devRole = 1;
- */
- public java.util.List extends automation.Automation.DeviceRoleOrBuilder>
- getDevRoleOrBuilderList() {
- if (devRoleBuilder_ != null) {
- return devRoleBuilder_.getMessageOrBuilderList();
- } else {
- return java.util.Collections.unmodifiableList(devRole_);
- }
- }
- /**
- * repeated .automation.DeviceRole devRole = 1;
- */
- public automation.Automation.DeviceRole.Builder addDevRoleBuilder() {
- return getDevRoleFieldBuilder().addBuilder(
- automation.Automation.DeviceRole.getDefaultInstance());
- }
- /**
- * repeated .automation.DeviceRole devRole = 1;
- */
- public automation.Automation.DeviceRole.Builder addDevRoleBuilder(
- int index) {
- return getDevRoleFieldBuilder().addBuilder(
- index, automation.Automation.DeviceRole.getDefaultInstance());
- }
- /**
- * repeated .automation.DeviceRole devRole = 1;
- */
- public java.util.List
- getDevRoleBuilderList() {
- return getDevRoleFieldBuilder().getBuilderList();
- }
- private com.google.protobuf.RepeatedFieldBuilderV3<
- automation.Automation.DeviceRole, automation.Automation.DeviceRole.Builder, automation.Automation.DeviceRoleOrBuilder>
- getDevRoleFieldBuilder() {
- if (devRoleBuilder_ == null) {
- devRoleBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
- automation.Automation.DeviceRole, automation.Automation.DeviceRole.Builder, automation.Automation.DeviceRoleOrBuilder>(
- devRole_,
- ((bitField0_ & 0x00000001) != 0),
- getParentForChildren(),
- isClean());
- devRole_ = null;
- }
- return devRoleBuilder_;
- }
- @java.lang.Override
- public final Builder setUnknownFields(
- final com.google.protobuf.UnknownFieldSet unknownFields) {
- return super.setUnknownFields(unknownFields);
- }
-
- @java.lang.Override
- public final Builder mergeUnknownFields(
- final com.google.protobuf.UnknownFieldSet unknownFields) {
- return super.mergeUnknownFields(unknownFields);
- }
-
-
- // @@protoc_insertion_point(builder_scope:automation.DeviceRoleList)
- }
-
- // @@protoc_insertion_point(class_scope:automation.DeviceRoleList)
- private static final automation.Automation.DeviceRoleList DEFAULT_INSTANCE;
- static {
- DEFAULT_INSTANCE = new automation.Automation.DeviceRoleList();
- }
-
- public static automation.Automation.DeviceRoleList getDefaultInstance() {
- return DEFAULT_INSTANCE;
- }
-
- private static final com.google.protobuf.Parser
- PARSER = new com.google.protobuf.AbstractParser() {
- @java.lang.Override
- public DeviceRoleList parsePartialFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return new DeviceRoleList(input, extensionRegistry);
- }
- };
-
- public static com.google.protobuf.Parser parser() {
- return PARSER;
- }
-
- @java.lang.Override
- public com.google.protobuf.Parser getParserForType() {
- return PARSER;
- }
-
- @java.lang.Override
- public automation.Automation.DeviceRoleList getDefaultInstanceForType() {
- return DEFAULT_INSTANCE;
- }
-
- }
-
- public interface DeviceRoleStateOrBuilder extends
- // @@protoc_insertion_point(interface_extends:automation.DeviceRoleState)
- com.google.protobuf.MessageOrBuilder {
-
- /**
- * .automation.DeviceRoleId devRoleId = 1;
- * @return Whether the devRoleId field is set.
- */
- boolean hasDevRoleId();
- /**
- * .automation.DeviceRoleId devRoleId = 1;
- * @return The devRoleId.
- */
- automation.Automation.DeviceRoleId getDevRoleId();
- /**
- * .automation.DeviceRoleId devRoleId = 1;
- */
- automation.Automation.DeviceRoleIdOrBuilder getDevRoleIdOrBuilder();
-
- /**
- * .automation.ZtpDeviceState devRoleState = 2;
- * @return The enum numeric value on the wire for devRoleState.
- */
- int getDevRoleStateValue();
- /**
- * .automation.ZtpDeviceState devRoleState = 2;
- * @return The devRoleState.
- */
- automation.Automation.ZtpDeviceState getDevRoleState();
- }
- /**
- * Protobuf type {@code automation.DeviceRoleState}
- */
- public static final class DeviceRoleState extends
- com.google.protobuf.GeneratedMessageV3 implements
- // @@protoc_insertion_point(message_implements:automation.DeviceRoleState)
- DeviceRoleStateOrBuilder {
- private static final long serialVersionUID = 0L;
- // Use DeviceRoleState.newBuilder() to construct.
- private DeviceRoleState(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
- super(builder);
- }
- private DeviceRoleState() {
- devRoleState_ = 0;
- }
-
- @java.lang.Override
- @SuppressWarnings({"unused"})
- protected java.lang.Object newInstance(
- UnusedPrivateParameter unused) {
- return new DeviceRoleState();
- }
-
- @java.lang.Override
- public final com.google.protobuf.UnknownFieldSet
- getUnknownFields() {
- return this.unknownFields;
- }
- private DeviceRoleState(
- 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: {
- automation.Automation.DeviceRoleId.Builder subBuilder = null;
- if (devRoleId_ != null) {
- subBuilder = devRoleId_.toBuilder();
- }
- devRoleId_ = input.readMessage(automation.Automation.DeviceRoleId.parser(), extensionRegistry);
- if (subBuilder != null) {
- subBuilder.mergeFrom(devRoleId_);
- devRoleId_ = subBuilder.buildPartial();
- }
-
- break;
- }
- case 16: {
- int rawValue = input.readEnum();
-
- devRoleState_ = 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 automation.Automation.internal_static_automation_DeviceRoleState_descriptor;
- }
-
- @java.lang.Override
- protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
- internalGetFieldAccessorTable() {
- return automation.Automation.internal_static_automation_DeviceRoleState_fieldAccessorTable
- .ensureFieldAccessorsInitialized(
- automation.Automation.DeviceRoleState.class, automation.Automation.DeviceRoleState.Builder.class);
- }
-
- public static final int DEVROLEID_FIELD_NUMBER = 1;
- private automation.Automation.DeviceRoleId devRoleId_;
- /**
- * .automation.DeviceRoleId devRoleId = 1;
- * @return Whether the devRoleId field is set.
- */
- @java.lang.Override
- public boolean hasDevRoleId() {
- return devRoleId_ != null;
- }
- /**
- * .automation.DeviceRoleId devRoleId = 1;
- * @return The devRoleId.
- */
- @java.lang.Override
- public automation.Automation.DeviceRoleId getDevRoleId() {
- return devRoleId_ == null ? automation.Automation.DeviceRoleId.getDefaultInstance() : devRoleId_;
- }
- /**
- * .automation.DeviceRoleId devRoleId = 1;
- */
- @java.lang.Override
- public automation.Automation.DeviceRoleIdOrBuilder getDevRoleIdOrBuilder() {
- return getDevRoleId();
- }
-
- public static final int DEVROLESTATE_FIELD_NUMBER = 2;
- private int devRoleState_;
- /**
- * .automation.ZtpDeviceState devRoleState = 2;
- * @return The enum numeric value on the wire for devRoleState.
- */
- @java.lang.Override public int getDevRoleStateValue() {
- return devRoleState_;
- }
- /**
- * .automation.ZtpDeviceState devRoleState = 2;
- * @return The devRoleState.
- */
- @java.lang.Override public automation.Automation.ZtpDeviceState getDevRoleState() {
- @SuppressWarnings("deprecation")
- automation.Automation.ZtpDeviceState result = automation.Automation.ZtpDeviceState.valueOf(devRoleState_);
- return result == null ? automation.Automation.ZtpDeviceState.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 (devRoleId_ != null) {
- output.writeMessage(1, getDevRoleId());
- }
- if (devRoleState_ != automation.Automation.ZtpDeviceState.ZTP_DEV_STATE_UNDEFINED.getNumber()) {
- output.writeEnum(2, devRoleState_);
- }
- unknownFields.writeTo(output);
- }
-
- @java.lang.Override
- public int getSerializedSize() {
- int size = memoizedSize;
- if (size != -1) return size;
-
- size = 0;
- if (devRoleId_ != null) {
- size += com.google.protobuf.CodedOutputStream
- .computeMessageSize(1, getDevRoleId());
- }
- if (devRoleState_ != automation.Automation.ZtpDeviceState.ZTP_DEV_STATE_UNDEFINED.getNumber()) {
- size += com.google.protobuf.CodedOutputStream
- .computeEnumSize(2, devRoleState_);
- }
- size += unknownFields.getSerializedSize();
- memoizedSize = size;
- return size;
- }
-
- @java.lang.Override
- public boolean equals(final java.lang.Object obj) {
- if (obj == this) {
- return true;
- }
- if (!(obj instanceof automation.Automation.DeviceRoleState)) {
- return super.equals(obj);
- }
- automation.Automation.DeviceRoleState other = (automation.Automation.DeviceRoleState) obj;
-
- if (hasDevRoleId() != other.hasDevRoleId()) return false;
- if (hasDevRoleId()) {
- if (!getDevRoleId()
- .equals(other.getDevRoleId())) return false;
- }
- if (devRoleState_ != other.devRoleState_) 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 (hasDevRoleId()) {
- hash = (37 * hash) + DEVROLEID_FIELD_NUMBER;
- hash = (53 * hash) + getDevRoleId().hashCode();
- }
- hash = (37 * hash) + DEVROLESTATE_FIELD_NUMBER;
- hash = (53 * hash) + devRoleState_;
- hash = (29 * hash) + unknownFields.hashCode();
- memoizedHashCode = hash;
- return hash;
- }
-
- public static automation.Automation.DeviceRoleState parseFrom(
- java.nio.ByteBuffer data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data);
- }
- public static automation.Automation.DeviceRoleState parseFrom(
- java.nio.ByteBuffer data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data, extensionRegistry);
- }
- public static automation.Automation.DeviceRoleState parseFrom(
- com.google.protobuf.ByteString data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data);
- }
- public static automation.Automation.DeviceRoleState parseFrom(
- com.google.protobuf.ByteString data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data, extensionRegistry);
- }
- public static automation.Automation.DeviceRoleState parseFrom(byte[] data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data);
- }
- public static automation.Automation.DeviceRoleState parseFrom(
- byte[] data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data, extensionRegistry);
- }
- public static automation.Automation.DeviceRoleState parseFrom(java.io.InputStream input)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input);
- }
- public static automation.Automation.DeviceRoleState parseFrom(
- java.io.InputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input, extensionRegistry);
- }
- public static automation.Automation.DeviceRoleState parseDelimitedFrom(java.io.InputStream input)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseDelimitedWithIOException(PARSER, input);
- }
- public static automation.Automation.DeviceRoleState parseDelimitedFrom(
- java.io.InputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
- }
- public static automation.Automation.DeviceRoleState parseFrom(
- com.google.protobuf.CodedInputStream input)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input);
- }
- public static automation.Automation.DeviceRoleState parseFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input, extensionRegistry);
- }
-
- @java.lang.Override
- public Builder newBuilderForType() { return newBuilder(); }
- public static Builder newBuilder() {
- return DEFAULT_INSTANCE.toBuilder();
- }
- public static Builder newBuilder(automation.Automation.DeviceRoleState prototype) {
- return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
- }
- @java.lang.Override
- public Builder toBuilder() {
- return this == DEFAULT_INSTANCE
- ? new Builder() : new Builder().mergeFrom(this);
- }
-
- @java.lang.Override
- protected Builder newBuilderForType(
- com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
- Builder builder = new Builder(parent);
- return builder;
- }
- /**
- * Protobuf type {@code automation.DeviceRoleState}
- */
- public static final class Builder extends
- com.google.protobuf.GeneratedMessageV3.Builder implements
- // @@protoc_insertion_point(builder_implements:automation.DeviceRoleState)
- automation.Automation.DeviceRoleStateOrBuilder {
- public static final com.google.protobuf.Descriptors.Descriptor
- getDescriptor() {
- return automation.Automation.internal_static_automation_DeviceRoleState_descriptor;
- }
-
- @java.lang.Override
- protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
- internalGetFieldAccessorTable() {
- return automation.Automation.internal_static_automation_DeviceRoleState_fieldAccessorTable
- .ensureFieldAccessorsInitialized(
- automation.Automation.DeviceRoleState.class, automation.Automation.DeviceRoleState.Builder.class);
- }
-
- // Construct using automation.Automation.DeviceRoleState.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 (devRoleIdBuilder_ == null) {
- devRoleId_ = null;
- } else {
- devRoleId_ = null;
- devRoleIdBuilder_ = null;
- }
- devRoleState_ = 0;
-
- return this;
- }
-
- @java.lang.Override
- public com.google.protobuf.Descriptors.Descriptor
- getDescriptorForType() {
- return automation.Automation.internal_static_automation_DeviceRoleState_descriptor;
- }
-
- @java.lang.Override
- public automation.Automation.DeviceRoleState getDefaultInstanceForType() {
- return automation.Automation.DeviceRoleState.getDefaultInstance();
- }
-
- @java.lang.Override
- public automation.Automation.DeviceRoleState build() {
- automation.Automation.DeviceRoleState result = buildPartial();
- if (!result.isInitialized()) {
- throw newUninitializedMessageException(result);
- }
- return result;
- }
-
- @java.lang.Override
- public automation.Automation.DeviceRoleState buildPartial() {
- automation.Automation.DeviceRoleState result = new automation.Automation.DeviceRoleState(this);
- if (devRoleIdBuilder_ == null) {
- result.devRoleId_ = devRoleId_;
- } else {
- result.devRoleId_ = devRoleIdBuilder_.build();
- }
- result.devRoleState_ = devRoleState_;
- onBuilt();
- return result;
- }
-
- @java.lang.Override
- public Builder clone() {
- return super.clone();
- }
- @java.lang.Override
- public Builder setField(
- com.google.protobuf.Descriptors.FieldDescriptor field,
- java.lang.Object value) {
- return super.setField(field, value);
- }
- @java.lang.Override
- public Builder clearField(
- com.google.protobuf.Descriptors.FieldDescriptor field) {
- return super.clearField(field);
- }
- @java.lang.Override
- public Builder clearOneof(
- com.google.protobuf.Descriptors.OneofDescriptor oneof) {
- return super.clearOneof(oneof);
- }
- @java.lang.Override
- public Builder setRepeatedField(
- com.google.protobuf.Descriptors.FieldDescriptor field,
- int index, java.lang.Object value) {
- return super.setRepeatedField(field, index, value);
- }
- @java.lang.Override
- public Builder addRepeatedField(
- com.google.protobuf.Descriptors.FieldDescriptor field,
- java.lang.Object value) {
- return super.addRepeatedField(field, value);
- }
- @java.lang.Override
- public Builder mergeFrom(com.google.protobuf.Message other) {
- if (other instanceof automation.Automation.DeviceRoleState) {
- return mergeFrom((automation.Automation.DeviceRoleState)other);
- } else {
- super.mergeFrom(other);
- return this;
- }
- }
-
- public Builder mergeFrom(automation.Automation.DeviceRoleState other) {
- if (other == automation.Automation.DeviceRoleState.getDefaultInstance()) return this;
- if (other.hasDevRoleId()) {
- mergeDevRoleId(other.getDevRoleId());
- }
- if (other.devRoleState_ != 0) {
- setDevRoleStateValue(other.getDevRoleStateValue());
- }
- this.mergeUnknownFields(other.unknownFields);
- onChanged();
- return this;
- }
-
- @java.lang.Override
- public final boolean isInitialized() {
- return true;
- }
-
- @java.lang.Override
- public Builder mergeFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- automation.Automation.DeviceRoleState parsedMessage = null;
- try {
- parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
- } catch (com.google.protobuf.InvalidProtocolBufferException e) {
- parsedMessage = (automation.Automation.DeviceRoleState) e.getUnfinishedMessage();
- throw e.unwrapIOException();
- } finally {
- if (parsedMessage != null) {
- mergeFrom(parsedMessage);
- }
- }
- return this;
- }
-
- private automation.Automation.DeviceRoleId devRoleId_;
- private com.google.protobuf.SingleFieldBuilderV3<
- automation.Automation.DeviceRoleId, automation.Automation.DeviceRoleId.Builder, automation.Automation.DeviceRoleIdOrBuilder> devRoleIdBuilder_;
- /**
- * .automation.DeviceRoleId devRoleId = 1;
- * @return Whether the devRoleId field is set.
- */
- public boolean hasDevRoleId() {
- return devRoleIdBuilder_ != null || devRoleId_ != null;
- }
- /**
- * .automation.DeviceRoleId devRoleId = 1;
- * @return The devRoleId.
- */
- public automation.Automation.DeviceRoleId getDevRoleId() {
- if (devRoleIdBuilder_ == null) {
- return devRoleId_ == null ? automation.Automation.DeviceRoleId.getDefaultInstance() : devRoleId_;
- } else {
- return devRoleIdBuilder_.getMessage();
- }
- }
- /**
- * .automation.DeviceRoleId devRoleId = 1;
- */
- public Builder setDevRoleId(automation.Automation.DeviceRoleId value) {
- if (devRoleIdBuilder_ == null) {
- if (value == null) {
- throw new NullPointerException();
- }
- devRoleId_ = value;
- onChanged();
- } else {
- devRoleIdBuilder_.setMessage(value);
- }
-
- return this;
- }
- /**
- * .automation.DeviceRoleId devRoleId = 1;
- */
- public Builder setDevRoleId(
- automation.Automation.DeviceRoleId.Builder builderForValue) {
- if (devRoleIdBuilder_ == null) {
- devRoleId_ = builderForValue.build();
- onChanged();
- } else {
- devRoleIdBuilder_.setMessage(builderForValue.build());
- }
-
- return this;
- }
- /**
- * .automation.DeviceRoleId devRoleId = 1;
- */
- public Builder mergeDevRoleId(automation.Automation.DeviceRoleId value) {
- if (devRoleIdBuilder_ == null) {
- if (devRoleId_ != null) {
- devRoleId_ =
- automation.Automation.DeviceRoleId.newBuilder(devRoleId_).mergeFrom(value).buildPartial();
- } else {
- devRoleId_ = value;
- }
- onChanged();
- } else {
- devRoleIdBuilder_.mergeFrom(value);
- }
-
- return this;
- }
- /**
- * .automation.DeviceRoleId devRoleId = 1;
- */
- public Builder clearDevRoleId() {
- if (devRoleIdBuilder_ == null) {
- devRoleId_ = null;
- onChanged();
- } else {
- devRoleId_ = null;
- devRoleIdBuilder_ = null;
- }
-
- return this;
- }
- /**
- * .automation.DeviceRoleId devRoleId = 1;
- */
- public automation.Automation.DeviceRoleId.Builder getDevRoleIdBuilder() {
-
- onChanged();
- return getDevRoleIdFieldBuilder().getBuilder();
- }
- /**
- * .automation.DeviceRoleId devRoleId = 1;
- */
- public automation.Automation.DeviceRoleIdOrBuilder getDevRoleIdOrBuilder() {
- if (devRoleIdBuilder_ != null) {
- return devRoleIdBuilder_.getMessageOrBuilder();
- } else {
- return devRoleId_ == null ?
- automation.Automation.DeviceRoleId.getDefaultInstance() : devRoleId_;
- }
- }
- /**
- * .automation.DeviceRoleId devRoleId = 1;
- */
- private com.google.protobuf.SingleFieldBuilderV3<
- automation.Automation.DeviceRoleId, automation.Automation.DeviceRoleId.Builder, automation.Automation.DeviceRoleIdOrBuilder>
- getDevRoleIdFieldBuilder() {
- if (devRoleIdBuilder_ == null) {
- devRoleIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
- automation.Automation.DeviceRoleId, automation.Automation.DeviceRoleId.Builder, automation.Automation.DeviceRoleIdOrBuilder>(
- getDevRoleId(),
- getParentForChildren(),
- isClean());
- devRoleId_ = null;
- }
- return devRoleIdBuilder_;
- }
-
- private int devRoleState_ = 0;
- /**
- * .automation.ZtpDeviceState devRoleState = 2;
- * @return The enum numeric value on the wire for devRoleState.
- */
- @java.lang.Override public int getDevRoleStateValue() {
- return devRoleState_;
- }
- /**
- * .automation.ZtpDeviceState devRoleState = 2;
- * @param value The enum numeric value on the wire for devRoleState to set.
- * @return This builder for chaining.
- */
- public Builder setDevRoleStateValue(int value) {
-
- devRoleState_ = value;
- onChanged();
- return this;
- }
- /**
- * .automation.ZtpDeviceState devRoleState = 2;
- * @return The devRoleState.
- */
- @java.lang.Override
- public automation.Automation.ZtpDeviceState getDevRoleState() {
- @SuppressWarnings("deprecation")
- automation.Automation.ZtpDeviceState result = automation.Automation.ZtpDeviceState.valueOf(devRoleState_);
- return result == null ? automation.Automation.ZtpDeviceState.UNRECOGNIZED : result;
- }
- /**
- * .automation.ZtpDeviceState devRoleState = 2;
- * @param value The devRoleState to set.
- * @return This builder for chaining.
- */
- public Builder setDevRoleState(automation.Automation.ZtpDeviceState value) {
- if (value == null) {
- throw new NullPointerException();
- }
-
- devRoleState_ = value.getNumber();
- onChanged();
- return this;
- }
- /**
- * .automation.ZtpDeviceState devRoleState = 2;
- * @return This builder for chaining.
- */
- public Builder clearDevRoleState() {
-
- devRoleState_ = 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:automation.DeviceRoleState)
- }
-
- // @@protoc_insertion_point(class_scope:automation.DeviceRoleState)
- private static final automation.Automation.DeviceRoleState DEFAULT_INSTANCE;
- static {
- DEFAULT_INSTANCE = new automation.Automation.DeviceRoleState();
- }
-
- public static automation.Automation.DeviceRoleState getDefaultInstance() {
- return DEFAULT_INSTANCE;
- }
-
- private static final com.google.protobuf.Parser
- PARSER = new com.google.protobuf.AbstractParser() {
- @java.lang.Override
- public DeviceRoleState parsePartialFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return new DeviceRoleState(input, extensionRegistry);
- }
- };
-
- public static com.google.protobuf.Parser parser() {
- return PARSER;
- }
-
- @java.lang.Override
- public com.google.protobuf.Parser getParserForType() {
- return PARSER;
- }
-
- @java.lang.Override
- public automation.Automation.DeviceRoleState getDefaultInstanceForType() {
- return DEFAULT_INSTANCE;
- }
-
- }
-
- public interface DeviceDeletionResultOrBuilder extends
- // @@protoc_insertion_point(interface_extends:automation.DeviceDeletionResult)
- com.google.protobuf.MessageOrBuilder {
-
- /**
- * repeated string deleted = 1;
- * @return A list containing the deleted.
- */
- java.util.List
- getDeletedList();
- /**
- * repeated string deleted = 1;
- * @return The count of deleted.
- */
- int getDeletedCount();
- /**
- * repeated string deleted = 1;
- * @param index The index of the element to return.
- * @return The deleted at the given index.
- */
- java.lang.String getDeleted(int index);
- /**
- * repeated string deleted = 1;
- * @param index The index of the value to return.
- * @return The bytes of the deleted at the given index.
- */
- com.google.protobuf.ByteString
- getDeletedBytes(int index);
- }
- /**
- * Protobuf type {@code automation.DeviceDeletionResult}
- */
- public static final class DeviceDeletionResult extends
- com.google.protobuf.GeneratedMessageV3 implements
- // @@protoc_insertion_point(message_implements:automation.DeviceDeletionResult)
- DeviceDeletionResultOrBuilder {
- private static final long serialVersionUID = 0L;
- // Use DeviceDeletionResult.newBuilder() to construct.
- private DeviceDeletionResult(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
- super(builder);
- }
- private DeviceDeletionResult() {
- deleted_ = com.google.protobuf.LazyStringArrayList.EMPTY;
- }
-
- @java.lang.Override
- @SuppressWarnings({"unused"})
- protected java.lang.Object newInstance(
- UnusedPrivateParameter unused) {
- return new DeviceDeletionResult();
- }
-
- @java.lang.Override
- public final com.google.protobuf.UnknownFieldSet
- getUnknownFields() {
- return this.unknownFields;
- }
- private DeviceDeletionResult(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- this();
- if (extensionRegistry == null) {
- throw new java.lang.NullPointerException();
- }
- int mutable_bitField0_ = 0;
- com.google.protobuf.UnknownFieldSet.Builder unknownFields =
- com.google.protobuf.UnknownFieldSet.newBuilder();
- try {
- boolean done = false;
- while (!done) {
- int tag = input.readTag();
- switch (tag) {
- case 0:
- done = true;
- break;
- case 10: {
- java.lang.String s = input.readStringRequireUtf8();
- if (!((mutable_bitField0_ & 0x00000001) != 0)) {
- deleted_ = new com.google.protobuf.LazyStringArrayList();
- mutable_bitField0_ |= 0x00000001;
- }
- deleted_.add(s);
- break;
- }
- default: {
- if (!parseUnknownField(
- input, unknownFields, extensionRegistry, tag)) {
- done = true;
- }
- break;
- }
- }
- }
- } catch (com.google.protobuf.InvalidProtocolBufferException e) {
- throw e.setUnfinishedMessage(this);
- } catch (java.io.IOException e) {
- throw new com.google.protobuf.InvalidProtocolBufferException(
- e).setUnfinishedMessage(this);
- } finally {
- if (((mutable_bitField0_ & 0x00000001) != 0)) {
- deleted_ = deleted_.getUnmodifiableView();
- }
- this.unknownFields = unknownFields.build();
- makeExtensionsImmutable();
- }
- }
- public static final com.google.protobuf.Descriptors.Descriptor
- getDescriptor() {
- return automation.Automation.internal_static_automation_DeviceDeletionResult_descriptor;
- }
-
- @java.lang.Override
- protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
- internalGetFieldAccessorTable() {
- return automation.Automation.internal_static_automation_DeviceDeletionResult_fieldAccessorTable
- .ensureFieldAccessorsInitialized(
- automation.Automation.DeviceDeletionResult.class, automation.Automation.DeviceDeletionResult.Builder.class);
- }
-
- public static final int DELETED_FIELD_NUMBER = 1;
- private com.google.protobuf.LazyStringList deleted_;
- /**
- * repeated string deleted = 1;
- * @return A list containing the deleted.
- */
- public com.google.protobuf.ProtocolStringList
- getDeletedList() {
- return deleted_;
- }
- /**
- * repeated string deleted = 1;
- * @return The count of deleted.
- */
- public int getDeletedCount() {
- return deleted_.size();
- }
- /**
- * repeated string deleted = 1;
- * @param index The index of the element to return.
- * @return The deleted at the given index.
- */
- public java.lang.String getDeleted(int index) {
- return deleted_.get(index);
- }
- /**
- * repeated string deleted = 1;
- * @param index The index of the value to return.
- * @return The bytes of the deleted at the given index.
- */
- public com.google.protobuf.ByteString
- getDeletedBytes(int index) {
- return deleted_.getByteString(index);
- }
-
- private byte memoizedIsInitialized = -1;
- @java.lang.Override
- public final boolean isInitialized() {
- byte isInitialized = memoizedIsInitialized;
- if (isInitialized == 1) return true;
- if (isInitialized == 0) return false;
-
- memoizedIsInitialized = 1;
- return true;
- }
-
- @java.lang.Override
- public void writeTo(com.google.protobuf.CodedOutputStream output)
- throws java.io.IOException {
- for (int i = 0; i < deleted_.size(); i++) {
- com.google.protobuf.GeneratedMessageV3.writeString(output, 1, deleted_.getRaw(i));
- }
- unknownFields.writeTo(output);
- }
-
- @java.lang.Override
- public int getSerializedSize() {
- int size = memoizedSize;
- if (size != -1) return size;
-
- size = 0;
- {
- int dataSize = 0;
- for (int i = 0; i < deleted_.size(); i++) {
- dataSize += computeStringSizeNoTag(deleted_.getRaw(i));
- }
- size += dataSize;
- size += 1 * getDeletedList().size();
- }
- size += unknownFields.getSerializedSize();
- memoizedSize = size;
- return size;
- }
-
- @java.lang.Override
- public boolean equals(final java.lang.Object obj) {
- if (obj == this) {
- return true;
- }
- if (!(obj instanceof automation.Automation.DeviceDeletionResult)) {
- return super.equals(obj);
- }
- automation.Automation.DeviceDeletionResult other = (automation.Automation.DeviceDeletionResult) obj;
-
- if (!getDeletedList()
- .equals(other.getDeletedList())) 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 (getDeletedCount() > 0) {
- hash = (37 * hash) + DELETED_FIELD_NUMBER;
- hash = (53 * hash) + getDeletedList().hashCode();
- }
- hash = (29 * hash) + unknownFields.hashCode();
- memoizedHashCode = hash;
- return hash;
- }
-
- public static automation.Automation.DeviceDeletionResult parseFrom(
- java.nio.ByteBuffer data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data);
- }
- public static automation.Automation.DeviceDeletionResult parseFrom(
- java.nio.ByteBuffer data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data, extensionRegistry);
- }
- public static automation.Automation.DeviceDeletionResult parseFrom(
- com.google.protobuf.ByteString data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data);
- }
- public static automation.Automation.DeviceDeletionResult parseFrom(
- com.google.protobuf.ByteString data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data, extensionRegistry);
- }
- public static automation.Automation.DeviceDeletionResult parseFrom(byte[] data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data);
- }
- public static automation.Automation.DeviceDeletionResult parseFrom(
- byte[] data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data, extensionRegistry);
- }
- public static automation.Automation.DeviceDeletionResult parseFrom(java.io.InputStream input)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input);
- }
- public static automation.Automation.DeviceDeletionResult parseFrom(
- java.io.InputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input, extensionRegistry);
- }
- public static automation.Automation.DeviceDeletionResult parseDelimitedFrom(java.io.InputStream input)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseDelimitedWithIOException(PARSER, input);
- }
- public static automation.Automation.DeviceDeletionResult parseDelimitedFrom(
- java.io.InputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
- }
- public static automation.Automation.DeviceDeletionResult parseFrom(
- com.google.protobuf.CodedInputStream input)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input);
- }
- public static automation.Automation.DeviceDeletionResult parseFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input, extensionRegistry);
- }
-
- @java.lang.Override
- public Builder newBuilderForType() { return newBuilder(); }
- public static Builder newBuilder() {
- return DEFAULT_INSTANCE.toBuilder();
- }
- public static Builder newBuilder(automation.Automation.DeviceDeletionResult prototype) {
- return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
- }
- @java.lang.Override
- public Builder toBuilder() {
- return this == DEFAULT_INSTANCE
- ? new Builder() : new Builder().mergeFrom(this);
- }
-
- @java.lang.Override
- protected Builder newBuilderForType(
- com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
- Builder builder = new Builder(parent);
- return builder;
- }
- /**
- * Protobuf type {@code automation.DeviceDeletionResult}
- */
- public static final class Builder extends
- com.google.protobuf.GeneratedMessageV3.Builder implements
- // @@protoc_insertion_point(builder_implements:automation.DeviceDeletionResult)
- automation.Automation.DeviceDeletionResultOrBuilder {
- public static final com.google.protobuf.Descriptors.Descriptor
- getDescriptor() {
- return automation.Automation.internal_static_automation_DeviceDeletionResult_descriptor;
- }
-
- @java.lang.Override
- protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
- internalGetFieldAccessorTable() {
- return automation.Automation.internal_static_automation_DeviceDeletionResult_fieldAccessorTable
- .ensureFieldAccessorsInitialized(
- automation.Automation.DeviceDeletionResult.class, automation.Automation.DeviceDeletionResult.Builder.class);
- }
-
- // Construct using automation.Automation.DeviceDeletionResult.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();
- deleted_ = com.google.protobuf.LazyStringArrayList.EMPTY;
- bitField0_ = (bitField0_ & ~0x00000001);
- return this;
- }
-
- @java.lang.Override
- public com.google.protobuf.Descriptors.Descriptor
- getDescriptorForType() {
- return automation.Automation.internal_static_automation_DeviceDeletionResult_descriptor;
- }
-
- @java.lang.Override
- public automation.Automation.DeviceDeletionResult getDefaultInstanceForType() {
- return automation.Automation.DeviceDeletionResult.getDefaultInstance();
- }
-
- @java.lang.Override
- public automation.Automation.DeviceDeletionResult build() {
- automation.Automation.DeviceDeletionResult result = buildPartial();
- if (!result.isInitialized()) {
- throw newUninitializedMessageException(result);
- }
- return result;
- }
-
- @java.lang.Override
- public automation.Automation.DeviceDeletionResult buildPartial() {
- automation.Automation.DeviceDeletionResult result = new automation.Automation.DeviceDeletionResult(this);
- int from_bitField0_ = bitField0_;
- if (((bitField0_ & 0x00000001) != 0)) {
- deleted_ = deleted_.getUnmodifiableView();
- bitField0_ = (bitField0_ & ~0x00000001);
- }
- result.deleted_ = deleted_;
- onBuilt();
- return result;
- }
-
- @java.lang.Override
- public Builder clone() {
- return super.clone();
- }
- @java.lang.Override
- public Builder setField(
- com.google.protobuf.Descriptors.FieldDescriptor field,
- java.lang.Object value) {
- return super.setField(field, value);
- }
- @java.lang.Override
- public Builder clearField(
- com.google.protobuf.Descriptors.FieldDescriptor field) {
- return super.clearField(field);
- }
- @java.lang.Override
- public Builder clearOneof(
- com.google.protobuf.Descriptors.OneofDescriptor oneof) {
- return super.clearOneof(oneof);
- }
- @java.lang.Override
- public Builder setRepeatedField(
- com.google.protobuf.Descriptors.FieldDescriptor field,
- int index, java.lang.Object value) {
- return super.setRepeatedField(field, index, value);
- }
- @java.lang.Override
- public Builder addRepeatedField(
- com.google.protobuf.Descriptors.FieldDescriptor field,
- java.lang.Object value) {
- return super.addRepeatedField(field, value);
- }
- @java.lang.Override
- public Builder mergeFrom(com.google.protobuf.Message other) {
- if (other instanceof automation.Automation.DeviceDeletionResult) {
- return mergeFrom((automation.Automation.DeviceDeletionResult)other);
- } else {
- super.mergeFrom(other);
- return this;
- }
- }
-
- public Builder mergeFrom(automation.Automation.DeviceDeletionResult other) {
- if (other == automation.Automation.DeviceDeletionResult.getDefaultInstance()) return this;
- if (!other.deleted_.isEmpty()) {
- if (deleted_.isEmpty()) {
- deleted_ = other.deleted_;
- bitField0_ = (bitField0_ & ~0x00000001);
- } else {
- ensureDeletedIsMutable();
- deleted_.addAll(other.deleted_);
- }
- onChanged();
- }
- this.mergeUnknownFields(other.unknownFields);
- onChanged();
- return this;
- }
-
- @java.lang.Override
- public final boolean isInitialized() {
- return true;
- }
-
- @java.lang.Override
- public Builder mergeFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- automation.Automation.DeviceDeletionResult parsedMessage = null;
- try {
- parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
- } catch (com.google.protobuf.InvalidProtocolBufferException e) {
- parsedMessage = (automation.Automation.DeviceDeletionResult) e.getUnfinishedMessage();
- throw e.unwrapIOException();
- } finally {
- if (parsedMessage != null) {
- mergeFrom(parsedMessage);
- }
- }
- return this;
- }
- private int bitField0_;
-
- private com.google.protobuf.LazyStringList deleted_ = com.google.protobuf.LazyStringArrayList.EMPTY;
- private void ensureDeletedIsMutable() {
- if (!((bitField0_ & 0x00000001) != 0)) {
- deleted_ = new com.google.protobuf.LazyStringArrayList(deleted_);
- bitField0_ |= 0x00000001;
- }
- }
- /**
- * repeated string deleted = 1;
- * @return A list containing the deleted.
- */
- public com.google.protobuf.ProtocolStringList
- getDeletedList() {
- return deleted_.getUnmodifiableView();
- }
- /**
- * repeated string deleted = 1;
- * @return The count of deleted.
- */
- public int getDeletedCount() {
- return deleted_.size();
- }
- /**
- * repeated string deleted = 1;
- * @param index The index of the element to return.
- * @return The deleted at the given index.
- */
- public java.lang.String getDeleted(int index) {
- return deleted_.get(index);
- }
- /**
- * repeated string deleted = 1;
- * @param index The index of the value to return.
- * @return The bytes of the deleted at the given index.
- */
- public com.google.protobuf.ByteString
- getDeletedBytes(int index) {
- return deleted_.getByteString(index);
- }
- /**
- * repeated string deleted = 1;
- * @param index The index to set the value at.
- * @param value The deleted to set.
- * @return This builder for chaining.
- */
- public Builder setDeleted(
- int index, java.lang.String value) {
- if (value == null) {
- throw new NullPointerException();
- }
- ensureDeletedIsMutable();
- deleted_.set(index, value);
- onChanged();
- return this;
- }
- /**
- * repeated string deleted = 1;
- * @param value The deleted to add.
- * @return This builder for chaining.
- */
- public Builder addDeleted(
- java.lang.String value) {
- if (value == null) {
- throw new NullPointerException();
- }
- ensureDeletedIsMutable();
- deleted_.add(value);
- onChanged();
- return this;
- }
- /**
- * repeated string deleted = 1;
- * @param values The deleted to add.
- * @return This builder for chaining.
- */
- public Builder addAllDeleted(
- java.lang.Iterable values) {
- ensureDeletedIsMutable();
- com.google.protobuf.AbstractMessageLite.Builder.addAll(
- values, deleted_);
- onChanged();
- return this;
- }
- /**
- * repeated string deleted = 1;
- * @return This builder for chaining.
- */
- public Builder clearDeleted() {
- deleted_ = com.google.protobuf.LazyStringArrayList.EMPTY;
- bitField0_ = (bitField0_ & ~0x00000001);
- onChanged();
- return this;
- }
- /**
- * repeated string deleted = 1;
- * @param value The bytes of the deleted to add.
- * @return This builder for chaining.
- */
- public Builder addDeletedBytes(
- com.google.protobuf.ByteString value) {
- if (value == null) {
- throw new NullPointerException();
- }
- checkByteStringIsUtf8(value);
- ensureDeletedIsMutable();
- deleted_.add(value);
- onChanged();
- return this;
- }
- @java.lang.Override
- public final Builder setUnknownFields(
- final com.google.protobuf.UnknownFieldSet unknownFields) {
- return super.setUnknownFields(unknownFields);
- }
-
- @java.lang.Override
- public final Builder mergeUnknownFields(
- final com.google.protobuf.UnknownFieldSet unknownFields) {
- return super.mergeUnknownFields(unknownFields);
- }
-
-
- // @@protoc_insertion_point(builder_scope:automation.DeviceDeletionResult)
- }
-
- // @@protoc_insertion_point(class_scope:automation.DeviceDeletionResult)
- private static final automation.Automation.DeviceDeletionResult DEFAULT_INSTANCE;
- static {
- DEFAULT_INSTANCE = new automation.Automation.DeviceDeletionResult();
- }
-
- public static automation.Automation.DeviceDeletionResult getDefaultInstance() {
- return DEFAULT_INSTANCE;
- }
-
- private static final com.google.protobuf.Parser
- PARSER = new com.google.protobuf.AbstractParser() {
- @java.lang.Override
- public DeviceDeletionResult parsePartialFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return new DeviceDeletionResult(input, extensionRegistry);
- }
- };
-
- public static com.google.protobuf.Parser parser() {
- return PARSER;
- }
-
- @java.lang.Override
- public com.google.protobuf.Parser getParserForType() {
- return PARSER;
- }
-
- @java.lang.Override
- public automation.Automation.DeviceDeletionResult getDefaultInstanceForType() {
- return DEFAULT_INSTANCE;
- }
-
- }
-
- private static final com.google.protobuf.Descriptors.Descriptor
- internal_static_automation_DeviceRoleId_descriptor;
- private static final
- com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
- internal_static_automation_DeviceRoleId_fieldAccessorTable;
- private static final com.google.protobuf.Descriptors.Descriptor
- internal_static_automation_DeviceRole_descriptor;
- private static final
- com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
- internal_static_automation_DeviceRole_fieldAccessorTable;
- private static final com.google.protobuf.Descriptors.Descriptor
- internal_static_automation_DeviceRoleConfig_descriptor;
- private static final
- com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
- internal_static_automation_DeviceRoleConfig_fieldAccessorTable;
- private static final com.google.protobuf.Descriptors.Descriptor
- internal_static_automation_DeviceRoleList_descriptor;
- private static final
- com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
- internal_static_automation_DeviceRoleList_fieldAccessorTable;
- private static final com.google.protobuf.Descriptors.Descriptor
- internal_static_automation_DeviceRoleState_descriptor;
- private static final
- com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
- internal_static_automation_DeviceRoleState_fieldAccessorTable;
- private static final com.google.protobuf.Descriptors.Descriptor
- internal_static_automation_DeviceDeletionResult_descriptor;
- private static final
- com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
- internal_static_automation_DeviceDeletionResult_fieldAccessorTable;
-
- public static com.google.protobuf.Descriptors.FileDescriptor
- getDescriptor() {
- return descriptor;
- }
- private static com.google.protobuf.Descriptors.FileDescriptor
- descriptor;
- static {
- java.lang.String[] descriptorData = {
- "\n\020automation.proto\022\nautomation\032\rcontext." +
- "proto\"R\n\014DeviceRoleId\022 \n\tdevRoleId\030\001 \001(\013" +
- "2\r.context.Uuid\022 \n\005devId\030\002 \001(\0132\021.context" +
- ".DeviceId\"j\n\nDeviceRole\022+\n\tdevRoleId\030\001 \001" +
- "(\0132\030.automation.DeviceRoleId\022/\n\013devRoleT" +
- "ype\030\002 \001(\0162\032.automation.DeviceRoleType\"e\n" +
- "\020DeviceRoleConfig\022\'\n\007devRole\030\001 \001(\0132\026.aut" +
- "omation.DeviceRole\022(\n\tdevConfig\030\002 \001(\0132\025." +
- "context.DeviceConfig\"9\n\016DeviceRoleList\022\'" +
- "\n\007devRole\030\001 \003(\0132\026.automation.DeviceRole\"" +
- "p\n\017DeviceRoleState\022+\n\tdevRoleId\030\001 \001(\0132\030." +
- "automation.DeviceRoleId\0220\n\014devRoleState\030" +
- "\002 \001(\0162\032.automation.ZtpDeviceState\"\'\n\024Dev" +
- "iceDeletionResult\022\017\n\007deleted\030\001 \003(\t*H\n\016De" +
- "viceRoleType\022\010\n\004NONE\020\000\022\013\n\007DEV_OPS\020\001\022\014\n\010D" +
- "EV_CONF\020\002\022\021\n\rPIPELINE_CONF\020\003*~\n\016ZtpDevic" +
- "eState\022\033\n\027ZTP_DEV_STATE_UNDEFINED\020\000\022\031\n\025Z" +
- "TP_DEV_STATE_CREATED\020\001\022\031\n\025ZTP_DEV_STATE_" +
- "UPDATED\020\002\022\031\n\025ZTP_DEV_STATE_DELETED\020\0032\276\003\n" +
- "\021AutomationService\022F\n\020ZtpGetDeviceRole\022\030" +
- ".automation.DeviceRoleId\032\026.automation.De" +
- "viceRole\"\000\022N\n\033ZtpGetDeviceRolesByDeviceI" +
- "d\022\021.context.DeviceId\032\032.automation.Device" +
- "RoleList\"\000\022?\n\006ZtpAdd\022\026.automation.Device" +
- "Role\032\033.automation.DeviceRoleState\"\000\022H\n\tZ" +
- "tpUpdate\022\034.automation.DeviceRoleConfig\032\033" +
- ".automation.DeviceRoleState\"\000\022B\n\tZtpDele" +
- "te\022\026.automation.DeviceRole\032\033.automation." +
- "DeviceRoleState\"\000\022B\n\014ZtpDeleteAll\022\016.cont" +
- "ext.Empty\032 .automation.DeviceDeletionRes" +
- "ult\"\000b\006proto3"
- };
- descriptor = com.google.protobuf.Descriptors.FileDescriptor
- .internalBuildGeneratedFileFrom(descriptorData,
- new com.google.protobuf.Descriptors.FileDescriptor[] {
- context.ContextOuterClass.getDescriptor(),
- });
- internal_static_automation_DeviceRoleId_descriptor =
- getDescriptor().getMessageTypes().get(0);
- internal_static_automation_DeviceRoleId_fieldAccessorTable = new
- com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
- internal_static_automation_DeviceRoleId_descriptor,
- new java.lang.String[] { "DevRoleId", "DevId", });
- internal_static_automation_DeviceRole_descriptor =
- getDescriptor().getMessageTypes().get(1);
- internal_static_automation_DeviceRole_fieldAccessorTable = new
- com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
- internal_static_automation_DeviceRole_descriptor,
- new java.lang.String[] { "DevRoleId", "DevRoleType", });
- internal_static_automation_DeviceRoleConfig_descriptor =
- getDescriptor().getMessageTypes().get(2);
- internal_static_automation_DeviceRoleConfig_fieldAccessorTable = new
- com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
- internal_static_automation_DeviceRoleConfig_descriptor,
- new java.lang.String[] { "DevRole", "DevConfig", });
- internal_static_automation_DeviceRoleList_descriptor =
- getDescriptor().getMessageTypes().get(3);
- internal_static_automation_DeviceRoleList_fieldAccessorTable = new
- com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
- internal_static_automation_DeviceRoleList_descriptor,
- new java.lang.String[] { "DevRole", });
- internal_static_automation_DeviceRoleState_descriptor =
- getDescriptor().getMessageTypes().get(4);
- internal_static_automation_DeviceRoleState_fieldAccessorTable = new
- com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
- internal_static_automation_DeviceRoleState_descriptor,
- new java.lang.String[] { "DevRoleId", "DevRoleState", });
- internal_static_automation_DeviceDeletionResult_descriptor =
- getDescriptor().getMessageTypes().get(5);
- internal_static_automation_DeviceDeletionResult_fieldAccessorTable = new
- com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
- internal_static_automation_DeviceDeletionResult_descriptor,
- new java.lang.String[] { "Deleted", });
- context.ContextOuterClass.getDescriptor();
- }
-
- // @@protoc_insertion_point(outer_class_scope)
-}
diff --git a/src/automation/target/generated-sources/grpc/automation/AutomationService.java b/src/automation/target/generated-sources/grpc/automation/AutomationService.java
deleted file mode 100644
index 8ef5784815a7b8bb6d51b05f89f6ca3a4b23f2e5..0000000000000000000000000000000000000000
--- a/src/automation/target/generated-sources/grpc/automation/AutomationService.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package automation;
-
-import io.quarkus.grpc.runtime.MutinyService;
-
-@javax.annotation.Generated(
-value = "by Mutiny Grpc generator",
-comments = "Source: automation.proto")
-public interface AutomationService extends MutinyService {
-
-
- io.smallrye.mutiny.Uni ztpGetDeviceRole(automation.Automation.DeviceRoleId request);
-
- io.smallrye.mutiny.Uni ztpGetDeviceRolesByDeviceId(context.ContextOuterClass.DeviceId request);
-
- io.smallrye.mutiny.Uni ztpAdd(automation.Automation.DeviceRole request);
-
- io.smallrye.mutiny.Uni ztpUpdate(automation.Automation.DeviceRoleConfig request);
-
- io.smallrye.mutiny.Uni ztpDelete(automation.Automation.DeviceRole request);
-
- io.smallrye.mutiny.Uni ztpDeleteAll(context.ContextOuterClass.Empty request);
-
-
-
-
-}
\ No newline at end of file
diff --git a/src/automation/target/generated-sources/grpc/automation/AutomationServiceBean.java b/src/automation/target/generated-sources/grpc/automation/AutomationServiceBean.java
deleted file mode 100644
index 3c7923a0ce8a1501689d1bb567c915590376cf5f..0000000000000000000000000000000000000000
--- a/src/automation/target/generated-sources/grpc/automation/AutomationServiceBean.java
+++ /dev/null
@@ -1,67 +0,0 @@
-package automation;
-
-import io.grpc.BindableService;
-import io.quarkus.grpc.GrpcService;
-import io.quarkus.grpc.runtime.MutinyBean;
-
-@javax.annotation.Generated(
-value = "by Mutiny Grpc generator",
-comments = "Source: automation.proto")
-public class AutomationServiceBean extends MutinyAutomationServiceGrpc.AutomationServiceImplBase implements BindableService, MutinyBean {
-
- private final AutomationService delegate;
-
- AutomationServiceBean(@GrpcService AutomationService delegate) {
- this.delegate = delegate;
- }
-
- @Override
- public io.smallrye.mutiny.Uni ztpGetDeviceRole(automation.Automation.DeviceRoleId request) {
- try {
- return delegate.ztpGetDeviceRole(request);
- } catch (UnsupportedOperationException e) {
- throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED);
- }
- }
- @Override
- public io.smallrye.mutiny.Uni ztpGetDeviceRolesByDeviceId(context.ContextOuterClass.DeviceId request) {
- try {
- return delegate.ztpGetDeviceRolesByDeviceId(request);
- } catch (UnsupportedOperationException e) {
- throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED);
- }
- }
- @Override
- public io.smallrye.mutiny.Uni ztpAdd(automation.Automation.DeviceRole request) {
- try {
- return delegate.ztpAdd(request);
- } catch (UnsupportedOperationException e) {
- throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED);
- }
- }
- @Override
- public io.smallrye.mutiny.Uni ztpUpdate(automation.Automation.DeviceRoleConfig request) {
- try {
- return delegate.ztpUpdate(request);
- } catch (UnsupportedOperationException e) {
- throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED);
- }
- }
- @Override
- public io.smallrye.mutiny.Uni ztpDelete(automation.Automation.DeviceRole request) {
- try {
- return delegate.ztpDelete(request);
- } catch (UnsupportedOperationException e) {
- throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED);
- }
- }
- @Override
- public io.smallrye.mutiny.Uni ztpDeleteAll(context.ContextOuterClass.Empty request) {
- try {
- return delegate.ztpDeleteAll(request);
- } catch (UnsupportedOperationException e) {
- throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED);
- }
- }
-
-}
\ No newline at end of file
diff --git a/src/automation/target/generated-sources/grpc/automation/AutomationServiceClient.java b/src/automation/target/generated-sources/grpc/automation/AutomationServiceClient.java
deleted file mode 100644
index 13d13c431b63baebd22ed7fd566b6b25395977e3..0000000000000000000000000000000000000000
--- a/src/automation/target/generated-sources/grpc/automation/AutomationServiceClient.java
+++ /dev/null
@@ -1,48 +0,0 @@
-package automation;
-
-import java.util.function.BiFunction;
-
-import io.quarkus.grpc.runtime.MutinyClient;
-
-@javax.annotation.Generated(
-value = "by Mutiny Grpc generator",
-comments = "Source: automation.proto")
-public class AutomationServiceClient implements AutomationService, MutinyClient {
-
- private final MutinyAutomationServiceGrpc.MutinyAutomationServiceStub stub;
-
- public AutomationServiceClient(String name, io.grpc.Channel channel, BiFunction stubConfigurator) {
- this.stub = stubConfigurator.apply(name,MutinyAutomationServiceGrpc.newMutinyStub(channel));
- }
-
- @Override
- public MutinyAutomationServiceGrpc.MutinyAutomationServiceStub getStub() {
- return stub;
- }
-
- @Override
- public io.smallrye.mutiny.Uni ztpGetDeviceRole(automation.Automation.DeviceRoleId request) {
- return stub.ztpGetDeviceRole(request);
- }
- @Override
- public io.smallrye.mutiny.Uni ztpGetDeviceRolesByDeviceId(context.ContextOuterClass.DeviceId request) {
- return stub.ztpGetDeviceRolesByDeviceId(request);
- }
- @Override
- public io.smallrye.mutiny.Uni ztpAdd(automation.Automation.DeviceRole request) {
- return stub.ztpAdd(request);
- }
- @Override
- public io.smallrye.mutiny.Uni ztpUpdate(automation.Automation.DeviceRoleConfig request) {
- return stub.ztpUpdate(request);
- }
- @Override
- public io.smallrye.mutiny.Uni ztpDelete(automation.Automation.DeviceRole request) {
- return stub.ztpDelete(request);
- }
- @Override
- public io.smallrye.mutiny.Uni ztpDeleteAll(context.ContextOuterClass.Empty request) {
- return stub.ztpDeleteAll(request);
- }
-
-}
\ No newline at end of file
diff --git a/src/automation/target/generated-sources/grpc/automation/AutomationServiceGrpc.java b/src/automation/target/generated-sources/grpc/automation/AutomationServiceGrpc.java
deleted file mode 100644
index 841994ea713bb9d1c0223689386d6cae35c6d014..0000000000000000000000000000000000000000
--- a/src/automation/target/generated-sources/grpc/automation/AutomationServiceGrpc.java
+++ /dev/null
@@ -1,645 +0,0 @@
-package automation;
-
-import static io.grpc.MethodDescriptor.generateFullMethodName;
-
-/**
- */
-@javax.annotation.Generated(
- value = "by gRPC proto compiler (version 1.38.1)",
- comments = "Source: automation.proto")
-public final class AutomationServiceGrpc {
-
- private AutomationServiceGrpc() {}
-
- public static final String SERVICE_NAME = "automation.AutomationService";
-
- // Static method descriptors that strictly reflect the proto.
- private static volatile io.grpc.MethodDescriptor getZtpGetDeviceRoleMethod;
-
- @io.grpc.stub.annotations.RpcMethod(
- fullMethodName = SERVICE_NAME + '/' + "ZtpGetDeviceRole",
- requestType = automation.Automation.DeviceRoleId.class,
- responseType = automation.Automation.DeviceRole.class,
- methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
- public static io.grpc.MethodDescriptor getZtpGetDeviceRoleMethod() {
- io.grpc.MethodDescriptor getZtpGetDeviceRoleMethod;
- if ((getZtpGetDeviceRoleMethod = AutomationServiceGrpc.getZtpGetDeviceRoleMethod) == null) {
- synchronized (AutomationServiceGrpc.class) {
- if ((getZtpGetDeviceRoleMethod = AutomationServiceGrpc.getZtpGetDeviceRoleMethod) == null) {
- AutomationServiceGrpc.getZtpGetDeviceRoleMethod = getZtpGetDeviceRoleMethod =
- io.grpc.MethodDescriptor.newBuilder()
- .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
- .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ZtpGetDeviceRole"))
- .setSampledToLocalTracing(true)
- .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
- automation.Automation.DeviceRoleId.getDefaultInstance()))
- .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
- automation.Automation.DeviceRole.getDefaultInstance()))
- .setSchemaDescriptor(new AutomationServiceMethodDescriptorSupplier("ZtpGetDeviceRole"))
- .build();
- }
- }
- }
- return getZtpGetDeviceRoleMethod;
- }
-
- private static volatile io.grpc.MethodDescriptor getZtpGetDeviceRolesByDeviceIdMethod;
-
- @io.grpc.stub.annotations.RpcMethod(
- fullMethodName = SERVICE_NAME + '/' + "ZtpGetDeviceRolesByDeviceId",
- requestType = context.ContextOuterClass.DeviceId.class,
- responseType = automation.Automation.DeviceRoleList.class,
- methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
- public static io.grpc.MethodDescriptor getZtpGetDeviceRolesByDeviceIdMethod() {
- io.grpc.MethodDescriptor getZtpGetDeviceRolesByDeviceIdMethod;
- if ((getZtpGetDeviceRolesByDeviceIdMethod = AutomationServiceGrpc.getZtpGetDeviceRolesByDeviceIdMethod) == null) {
- synchronized (AutomationServiceGrpc.class) {
- if ((getZtpGetDeviceRolesByDeviceIdMethod = AutomationServiceGrpc.getZtpGetDeviceRolesByDeviceIdMethod) == null) {
- AutomationServiceGrpc.getZtpGetDeviceRolesByDeviceIdMethod = getZtpGetDeviceRolesByDeviceIdMethod =
- io.grpc.MethodDescriptor.newBuilder()
- .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
- .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ZtpGetDeviceRolesByDeviceId"))
- .setSampledToLocalTracing(true)
- .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
- context.ContextOuterClass.DeviceId.getDefaultInstance()))
- .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
- automation.Automation.DeviceRoleList.getDefaultInstance()))
- .setSchemaDescriptor(new AutomationServiceMethodDescriptorSupplier("ZtpGetDeviceRolesByDeviceId"))
- .build();
- }
- }
- }
- return getZtpGetDeviceRolesByDeviceIdMethod;
- }
-
- private static volatile io.grpc.MethodDescriptor getZtpAddMethod;
-
- @io.grpc.stub.annotations.RpcMethod(
- fullMethodName = SERVICE_NAME + '/' + "ZtpAdd",
- requestType = automation.Automation.DeviceRole.class,
- responseType = automation.Automation.DeviceRoleState.class,
- methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
- public static io.grpc.MethodDescriptor getZtpAddMethod() {
- io.grpc.MethodDescriptor getZtpAddMethod;
- if ((getZtpAddMethod = AutomationServiceGrpc.getZtpAddMethod) == null) {
- synchronized (AutomationServiceGrpc.class) {
- if ((getZtpAddMethod = AutomationServiceGrpc.getZtpAddMethod) == null) {
- AutomationServiceGrpc.getZtpAddMethod = getZtpAddMethod =
- io.grpc.MethodDescriptor.newBuilder()
- .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
- .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ZtpAdd"))
- .setSampledToLocalTracing(true)
- .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
- automation.Automation.DeviceRole.getDefaultInstance()))
- .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
- automation.Automation.DeviceRoleState.getDefaultInstance()))
- .setSchemaDescriptor(new AutomationServiceMethodDescriptorSupplier("ZtpAdd"))
- .build();
- }
- }
- }
- return getZtpAddMethod;
- }
-
- private static volatile io.grpc.MethodDescriptor getZtpUpdateMethod;
-
- @io.grpc.stub.annotations.RpcMethod(
- fullMethodName = SERVICE_NAME + '/' + "ZtpUpdate",
- requestType = automation.Automation.DeviceRoleConfig.class,
- responseType = automation.Automation.DeviceRoleState.class,
- methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
- public static io.grpc.MethodDescriptor getZtpUpdateMethod() {
- io.grpc.MethodDescriptor getZtpUpdateMethod;
- if ((getZtpUpdateMethod = AutomationServiceGrpc.getZtpUpdateMethod) == null) {
- synchronized (AutomationServiceGrpc.class) {
- if ((getZtpUpdateMethod = AutomationServiceGrpc.getZtpUpdateMethod) == null) {
- AutomationServiceGrpc.getZtpUpdateMethod = getZtpUpdateMethod =
- io.grpc.MethodDescriptor.newBuilder()
- .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
- .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ZtpUpdate"))
- .setSampledToLocalTracing(true)
- .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
- automation.Automation.DeviceRoleConfig.getDefaultInstance()))
- .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
- automation.Automation.DeviceRoleState.getDefaultInstance()))
- .setSchemaDescriptor(new AutomationServiceMethodDescriptorSupplier("ZtpUpdate"))
- .build();
- }
- }
- }
- return getZtpUpdateMethod;
- }
-
- private static volatile io.grpc.MethodDescriptor getZtpDeleteMethod;
-
- @io.grpc.stub.annotations.RpcMethod(
- fullMethodName = SERVICE_NAME + '/' + "ZtpDelete",
- requestType = automation.Automation.DeviceRole.class,
- responseType = automation.Automation.DeviceRoleState.class,
- methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
- public static io.grpc.MethodDescriptor getZtpDeleteMethod() {
- io.grpc.MethodDescriptor getZtpDeleteMethod;
- if ((getZtpDeleteMethod = AutomationServiceGrpc.getZtpDeleteMethod) == null) {
- synchronized (AutomationServiceGrpc.class) {
- if ((getZtpDeleteMethod = AutomationServiceGrpc.getZtpDeleteMethod) == null) {
- AutomationServiceGrpc.getZtpDeleteMethod = getZtpDeleteMethod =
- io.grpc.MethodDescriptor.newBuilder()
- .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
- .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ZtpDelete"))
- .setSampledToLocalTracing(true)
- .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
- automation.Automation.DeviceRole.getDefaultInstance()))
- .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
- automation.Automation.DeviceRoleState.getDefaultInstance()))
- .setSchemaDescriptor(new AutomationServiceMethodDescriptorSupplier("ZtpDelete"))
- .build();
- }
- }
- }
- return getZtpDeleteMethod;
- }
-
- private static volatile io.grpc.MethodDescriptor getZtpDeleteAllMethod;
-
- @io.grpc.stub.annotations.RpcMethod(
- fullMethodName = SERVICE_NAME + '/' + "ZtpDeleteAll",
- requestType = context.ContextOuterClass.Empty.class,
- responseType = automation.Automation.DeviceDeletionResult.class,
- methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
- public static io.grpc.MethodDescriptor getZtpDeleteAllMethod() {
- io.grpc.MethodDescriptor getZtpDeleteAllMethod;
- if ((getZtpDeleteAllMethod = AutomationServiceGrpc.getZtpDeleteAllMethod) == null) {
- synchronized (AutomationServiceGrpc.class) {
- if ((getZtpDeleteAllMethod = AutomationServiceGrpc.getZtpDeleteAllMethod) == null) {
- AutomationServiceGrpc.getZtpDeleteAllMethod = getZtpDeleteAllMethod =
- io.grpc.MethodDescriptor.newBuilder()
- .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
- .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ZtpDeleteAll"))
- .setSampledToLocalTracing(true)
- .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
- context.ContextOuterClass.Empty.getDefaultInstance()))
- .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
- automation.Automation.DeviceDeletionResult.getDefaultInstance()))
- .setSchemaDescriptor(new AutomationServiceMethodDescriptorSupplier("ZtpDeleteAll"))
- .build();
- }
- }
- }
- return getZtpDeleteAllMethod;
- }
-
- /**
- * Creates a new async stub that supports all call types for the service
- */
- public static AutomationServiceStub newStub(io.grpc.Channel channel) {
- io.grpc.stub.AbstractStub.StubFactory factory =
- new io.grpc.stub.AbstractStub.StubFactory() {
- @java.lang.Override
- public AutomationServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
- return new AutomationServiceStub(channel, callOptions);
- }
- };
- return AutomationServiceStub.newStub(factory, channel);
- }
-
- /**
- * Creates a new blocking-style stub that supports unary and streaming output calls on the service
- */
- public static AutomationServiceBlockingStub newBlockingStub(
- io.grpc.Channel channel) {
- io.grpc.stub.AbstractStub.StubFactory factory =
- new io.grpc.stub.AbstractStub.StubFactory() {
- @java.lang.Override
- public AutomationServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
- return new AutomationServiceBlockingStub(channel, callOptions);
- }
- };
- return AutomationServiceBlockingStub.newStub(factory, channel);
- }
-
- /**
- * Creates a new ListenableFuture-style stub that supports unary calls on the service
- */
- public static AutomationServiceFutureStub newFutureStub(
- io.grpc.Channel channel) {
- io.grpc.stub.AbstractStub.StubFactory factory =
- new io.grpc.stub.AbstractStub.StubFactory() {
- @java.lang.Override
- public AutomationServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
- return new AutomationServiceFutureStub(channel, callOptions);
- }
- };
- return AutomationServiceFutureStub.newStub(factory, channel);
- }
-
- /**
- */
- public static abstract class AutomationServiceImplBase implements io.grpc.BindableService {
-
- /**
- */
- public void ztpGetDeviceRole(automation.Automation.DeviceRoleId request,
- io.grpc.stub.StreamObserver responseObserver) {
- io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getZtpGetDeviceRoleMethod(), responseObserver);
- }
-
- /**
- */
- public void ztpGetDeviceRolesByDeviceId(context.ContextOuterClass.DeviceId request,
- io.grpc.stub.StreamObserver responseObserver) {
- io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getZtpGetDeviceRolesByDeviceIdMethod(), responseObserver);
- }
-
- /**
- */
- public void ztpAdd(automation.Automation.DeviceRole request,
- io.grpc.stub.StreamObserver responseObserver) {
- io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getZtpAddMethod(), responseObserver);
- }
-
- /**
- */
- public void ztpUpdate(automation.Automation.DeviceRoleConfig request,
- io.grpc.stub.StreamObserver responseObserver) {
- io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getZtpUpdateMethod(), responseObserver);
- }
-
- /**
- */
- public void ztpDelete(automation.Automation.DeviceRole request,
- io.grpc.stub.StreamObserver responseObserver) {
- io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getZtpDeleteMethod(), responseObserver);
- }
-
- /**
- */
- public void ztpDeleteAll(context.ContextOuterClass.Empty request,
- io.grpc.stub.StreamObserver responseObserver) {
- io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getZtpDeleteAllMethod(), responseObserver);
- }
-
- @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
- return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
- .addMethod(
- getZtpGetDeviceRoleMethod(),
- io.grpc.stub.ServerCalls.asyncUnaryCall(
- new MethodHandlers<
- automation.Automation.DeviceRoleId,
- automation.Automation.DeviceRole>(
- this, METHODID_ZTP_GET_DEVICE_ROLE)))
- .addMethod(
- getZtpGetDeviceRolesByDeviceIdMethod(),
- io.grpc.stub.ServerCalls.asyncUnaryCall(
- new MethodHandlers<
- context.ContextOuterClass.DeviceId,
- automation.Automation.DeviceRoleList>(
- this, METHODID_ZTP_GET_DEVICE_ROLES_BY_DEVICE_ID)))
- .addMethod(
- getZtpAddMethod(),
- io.grpc.stub.ServerCalls.asyncUnaryCall(
- new MethodHandlers<
- automation.Automation.DeviceRole,
- automation.Automation.DeviceRoleState>(
- this, METHODID_ZTP_ADD)))
- .addMethod(
- getZtpUpdateMethod(),
- io.grpc.stub.ServerCalls.asyncUnaryCall(
- new MethodHandlers<
- automation.Automation.DeviceRoleConfig,
- automation.Automation.DeviceRoleState>(
- this, METHODID_ZTP_UPDATE)))
- .addMethod(
- getZtpDeleteMethod(),
- io.grpc.stub.ServerCalls.asyncUnaryCall(
- new MethodHandlers<
- automation.Automation.DeviceRole,
- automation.Automation.DeviceRoleState>(
- this, METHODID_ZTP_DELETE)))
- .addMethod(
- getZtpDeleteAllMethod(),
- io.grpc.stub.ServerCalls.asyncUnaryCall(
- new MethodHandlers<
- context.ContextOuterClass.Empty,
- automation.Automation.DeviceDeletionResult>(
- this, METHODID_ZTP_DELETE_ALL)))
- .build();
- }
- }
-
- /**
- */
- public static final class AutomationServiceStub extends io.grpc.stub.AbstractAsyncStub {
- private AutomationServiceStub(
- io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
- super(channel, callOptions);
- }
-
- @java.lang.Override
- protected AutomationServiceStub build(
- io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
- return new AutomationServiceStub(channel, callOptions);
- }
-
- /**
- */
- public void ztpGetDeviceRole(automation.Automation.DeviceRoleId request,
- io.grpc.stub.StreamObserver responseObserver) {
- io.grpc.stub.ClientCalls.asyncUnaryCall(
- getChannel().newCall(getZtpGetDeviceRoleMethod(), getCallOptions()), request, responseObserver);
- }
-
- /**
- */
- public void ztpGetDeviceRolesByDeviceId(context.ContextOuterClass.DeviceId request,
- io.grpc.stub.StreamObserver responseObserver) {
- io.grpc.stub.ClientCalls.asyncUnaryCall(
- getChannel().newCall(getZtpGetDeviceRolesByDeviceIdMethod(), getCallOptions()), request, responseObserver);
- }
-
- /**
- */
- public void ztpAdd(automation.Automation.DeviceRole request,
- io.grpc.stub.StreamObserver responseObserver) {
- io.grpc.stub.ClientCalls.asyncUnaryCall(
- getChannel().newCall(getZtpAddMethod(), getCallOptions()), request, responseObserver);
- }
-
- /**
- */
- public void ztpUpdate(automation.Automation.DeviceRoleConfig request,
- io.grpc.stub.StreamObserver responseObserver) {
- io.grpc.stub.ClientCalls.asyncUnaryCall(
- getChannel().newCall(getZtpUpdateMethod(), getCallOptions()), request, responseObserver);
- }
-
- /**
- */
- public void ztpDelete(automation.Automation.DeviceRole request,
- io.grpc.stub.StreamObserver responseObserver) {
- io.grpc.stub.ClientCalls.asyncUnaryCall(
- getChannel().newCall(getZtpDeleteMethod(), getCallOptions()), request, responseObserver);
- }
-
- /**
- */
- public void ztpDeleteAll(context.ContextOuterClass.Empty request,
- io.grpc.stub.StreamObserver responseObserver) {
- io.grpc.stub.ClientCalls.asyncUnaryCall(
- getChannel().newCall(getZtpDeleteAllMethod(), getCallOptions()), request, responseObserver);
- }
- }
-
- /**
- */
- public static final class AutomationServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub {
- private AutomationServiceBlockingStub(
- io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
- super(channel, callOptions);
- }
-
- @java.lang.Override
- protected AutomationServiceBlockingStub build(
- io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
- return new AutomationServiceBlockingStub(channel, callOptions);
- }
-
- /**
- */
- public automation.Automation.DeviceRole ztpGetDeviceRole(automation.Automation.DeviceRoleId request) {
- return io.grpc.stub.ClientCalls.blockingUnaryCall(
- getChannel(), getZtpGetDeviceRoleMethod(), getCallOptions(), request);
- }
-
- /**
- */
- public automation.Automation.DeviceRoleList ztpGetDeviceRolesByDeviceId(context.ContextOuterClass.DeviceId request) {
- return io.grpc.stub.ClientCalls.blockingUnaryCall(
- getChannel(), getZtpGetDeviceRolesByDeviceIdMethod(), getCallOptions(), request);
- }
-
- /**
- */
- public automation.Automation.DeviceRoleState ztpAdd(automation.Automation.DeviceRole request) {
- return io.grpc.stub.ClientCalls.blockingUnaryCall(
- getChannel(), getZtpAddMethod(), getCallOptions(), request);
- }
-
- /**
- */
- public automation.Automation.DeviceRoleState ztpUpdate(automation.Automation.DeviceRoleConfig request) {
- return io.grpc.stub.ClientCalls.blockingUnaryCall(
- getChannel(), getZtpUpdateMethod(), getCallOptions(), request);
- }
-
- /**
- */
- public automation.Automation.DeviceRoleState ztpDelete(automation.Automation.DeviceRole request) {
- return io.grpc.stub.ClientCalls.blockingUnaryCall(
- getChannel(), getZtpDeleteMethod(), getCallOptions(), request);
- }
-
- /**
- */
- public automation.Automation.DeviceDeletionResult ztpDeleteAll(context.ContextOuterClass.Empty request) {
- return io.grpc.stub.ClientCalls.blockingUnaryCall(
- getChannel(), getZtpDeleteAllMethod(), getCallOptions(), request);
- }
- }
-
- /**
- */
- public static final class AutomationServiceFutureStub extends io.grpc.stub.AbstractFutureStub {
- private AutomationServiceFutureStub(
- io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
- super(channel, callOptions);
- }
-
- @java.lang.Override
- protected AutomationServiceFutureStub build(
- io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
- return new AutomationServiceFutureStub(channel, callOptions);
- }
-
- /**
- */
- public com.google.common.util.concurrent.ListenableFuture ztpGetDeviceRole(
- automation.Automation.DeviceRoleId request) {
- return io.grpc.stub.ClientCalls.futureUnaryCall(
- getChannel().newCall(getZtpGetDeviceRoleMethod(), getCallOptions()), request);
- }
-
- /**
- */
- public com.google.common.util.concurrent.ListenableFuture ztpGetDeviceRolesByDeviceId(
- context.ContextOuterClass.DeviceId request) {
- return io.grpc.stub.ClientCalls.futureUnaryCall(
- getChannel().newCall(getZtpGetDeviceRolesByDeviceIdMethod(), getCallOptions()), request);
- }
-
- /**
- */
- public com.google.common.util.concurrent.ListenableFuture ztpAdd(
- automation.Automation.DeviceRole request) {
- return io.grpc.stub.ClientCalls.futureUnaryCall(
- getChannel().newCall(getZtpAddMethod(), getCallOptions()), request);
- }
-
- /**
- */
- public com.google.common.util.concurrent.ListenableFuture ztpUpdate(
- automation.Automation.DeviceRoleConfig request) {
- return io.grpc.stub.ClientCalls.futureUnaryCall(
- getChannel().newCall(getZtpUpdateMethod(), getCallOptions()), request);
- }
-
- /**
- */
- public com.google.common.util.concurrent.ListenableFuture ztpDelete(
- automation.Automation.DeviceRole request) {
- return io.grpc.stub.ClientCalls.futureUnaryCall(
- getChannel().newCall(getZtpDeleteMethod(), getCallOptions()), request);
- }
-
- /**
- */
- public com.google.common.util.concurrent.ListenableFuture ztpDeleteAll(
- context.ContextOuterClass.Empty request) {
- return io.grpc.stub.ClientCalls.futureUnaryCall(
- getChannel().newCall(getZtpDeleteAllMethod(), getCallOptions()), request);
- }
- }
-
- private static final int METHODID_ZTP_GET_DEVICE_ROLE = 0;
- private static final int METHODID_ZTP_GET_DEVICE_ROLES_BY_DEVICE_ID = 1;
- private static final int METHODID_ZTP_ADD = 2;
- private static final int METHODID_ZTP_UPDATE = 3;
- private static final int METHODID_ZTP_DELETE = 4;
- private static final int METHODID_ZTP_DELETE_ALL = 5;
-
- private static final class MethodHandlers implements
- io.grpc.stub.ServerCalls.UnaryMethod,
- io.grpc.stub.ServerCalls.ServerStreamingMethod,
- io.grpc.stub.ServerCalls.ClientStreamingMethod,
- io.grpc.stub.ServerCalls.BidiStreamingMethod {
- private final AutomationServiceImplBase serviceImpl;
- private final int methodId;
-
- MethodHandlers(AutomationServiceImplBase serviceImpl, int methodId) {
- this.serviceImpl = serviceImpl;
- this.methodId = methodId;
- }
-
- @java.lang.Override
- @java.lang.SuppressWarnings("unchecked")
- public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) {
- switch (methodId) {
- case METHODID_ZTP_GET_DEVICE_ROLE:
- serviceImpl.ztpGetDeviceRole((automation.Automation.DeviceRoleId) request,
- (io.grpc.stub.StreamObserver) responseObserver);
- break;
- case METHODID_ZTP_GET_DEVICE_ROLES_BY_DEVICE_ID:
- serviceImpl.ztpGetDeviceRolesByDeviceId((context.ContextOuterClass.DeviceId) request,
- (io.grpc.stub.StreamObserver) responseObserver);
- break;
- case METHODID_ZTP_ADD:
- serviceImpl.ztpAdd((automation.Automation.DeviceRole) request,
- (io.grpc.stub.StreamObserver) responseObserver);
- break;
- case METHODID_ZTP_UPDATE:
- serviceImpl.ztpUpdate((automation.Automation.DeviceRoleConfig) request,
- (io.grpc.stub.StreamObserver) responseObserver);
- break;
- case METHODID_ZTP_DELETE:
- serviceImpl.ztpDelete((automation.Automation.DeviceRole) request,
- (io.grpc.stub.StreamObserver) responseObserver);
- break;
- case METHODID_ZTP_DELETE_ALL:
- serviceImpl.ztpDeleteAll((context.ContextOuterClass.Empty) request,
- (io.grpc.stub.StreamObserver) responseObserver);
- break;
- default:
- throw new AssertionError();
- }
- }
-
- @java.lang.Override
- @java.lang.SuppressWarnings("unchecked")
- public io.grpc.stub.StreamObserver invoke(
- io.grpc.stub.StreamObserver responseObserver) {
- switch (methodId) {
- default:
- throw new AssertionError();
- }
- }
- }
-
- private static abstract class AutomationServiceBaseDescriptorSupplier
- implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
- AutomationServiceBaseDescriptorSupplier() {}
-
- @java.lang.Override
- public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
- return automation.Automation.getDescriptor();
- }
-
- @java.lang.Override
- public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
- return getFileDescriptor().findServiceByName("AutomationService");
- }
- }
-
- private static final class AutomationServiceFileDescriptorSupplier
- extends AutomationServiceBaseDescriptorSupplier {
- AutomationServiceFileDescriptorSupplier() {}
- }
-
- private static final class AutomationServiceMethodDescriptorSupplier
- extends AutomationServiceBaseDescriptorSupplier
- implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
- private final String methodName;
-
- AutomationServiceMethodDescriptorSupplier(String methodName) {
- this.methodName = methodName;
- }
-
- @java.lang.Override
- public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() {
- return getServiceDescriptor().findMethodByName(methodName);
- }
- }
-
- private static volatile io.grpc.ServiceDescriptor serviceDescriptor;
-
- public static io.grpc.ServiceDescriptor getServiceDescriptor() {
- io.grpc.ServiceDescriptor result = serviceDescriptor;
- if (result == null) {
- synchronized (AutomationServiceGrpc.class) {
- result = serviceDescriptor;
- if (result == null) {
- serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
- .setSchemaDescriptor(new AutomationServiceFileDescriptorSupplier())
- .addMethod(getZtpGetDeviceRoleMethod())
- .addMethod(getZtpGetDeviceRolesByDeviceIdMethod())
- .addMethod(getZtpAddMethod())
- .addMethod(getZtpUpdateMethod())
- .addMethod(getZtpDeleteMethod())
- .addMethod(getZtpDeleteAllMethod())
- .build();
- }
- }
- }
- return result;
- }
-}
diff --git a/src/automation/target/generated-sources/grpc/automation/MutinyAutomationServiceGrpc.java b/src/automation/target/generated-sources/grpc/automation/MutinyAutomationServiceGrpc.java
deleted file mode 100644
index 64565286ca36fd0b820c000e466954144207ab0b..0000000000000000000000000000000000000000
--- a/src/automation/target/generated-sources/grpc/automation/MutinyAutomationServiceGrpc.java
+++ /dev/null
@@ -1,240 +0,0 @@
-package automation;
-
-import static automation.AutomationServiceGrpc.getServiceDescriptor;
-import static io.grpc.stub.ServerCalls.asyncUnaryCall;
-import static io.grpc.stub.ServerCalls.asyncServerStreamingCall;
-import static io.grpc.stub.ServerCalls.asyncClientStreamingCall;
-import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall;
-
-@javax.annotation.Generated(
-value = "by Mutiny Grpc generator",
-comments = "Source: automation.proto")
-public final class MutinyAutomationServiceGrpc implements io.quarkus.grpc.runtime.MutinyGrpc {
- private MutinyAutomationServiceGrpc() {}
-
- public static MutinyAutomationServiceStub newMutinyStub(io.grpc.Channel channel) {
- return new MutinyAutomationServiceStub(channel);
- }
-
-
- public static final class MutinyAutomationServiceStub extends io.grpc.stub.AbstractStub implements io.quarkus.grpc.runtime.MutinyStub {
- private AutomationServiceGrpc.AutomationServiceStub delegateStub;
-
- private MutinyAutomationServiceStub(io.grpc.Channel channel) {
- super(channel);
- delegateStub = AutomationServiceGrpc.newStub(channel);
- }
-
- private MutinyAutomationServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
- super(channel, callOptions);
- delegateStub = AutomationServiceGrpc.newStub(channel).build(channel, callOptions);
- }
-
- @Override
- protected MutinyAutomationServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
- return new MutinyAutomationServiceStub(channel, callOptions);
- }
-
-
- public io.smallrye.mutiny.Uni ztpGetDeviceRole(automation.Automation.DeviceRoleId request) {
- return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::ztpGetDeviceRole);
- }
-
-
- public io.smallrye.mutiny.Uni ztpGetDeviceRolesByDeviceId(context.ContextOuterClass.DeviceId request) {
- return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::ztpGetDeviceRolesByDeviceId);
- }
-
-
- public io.smallrye.mutiny.Uni ztpAdd(automation.Automation.DeviceRole request) {
- return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::ztpAdd);
- }
-
-
- public io.smallrye.mutiny.Uni ztpUpdate(automation.Automation.DeviceRoleConfig request) {
- return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::ztpUpdate);
- }
-
-
- public io.smallrye.mutiny.Uni ztpDelete(automation.Automation.DeviceRole request) {
- return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::ztpDelete);
- }
-
-
- public io.smallrye.mutiny.Uni ztpDeleteAll(context.ContextOuterClass.Empty request) {
- return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::ztpDeleteAll);
- }
-
- }
-
-
- public static abstract class AutomationServiceImplBase implements io.grpc.BindableService {
-
- private String compression;
- /**
- * Set whether the server will try to use a compressed response.
- *
- * @param compression the compression, e.g {@code gzip}
- */
- public AutomationServiceImplBase withCompression(String compression) {
- this.compression = compression;
- return this;
- }
-
-
-
- public io.smallrye.mutiny.Uni ztpGetDeviceRole(automation.Automation.DeviceRoleId request) {
- throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED);
- }
-
-
- public io.smallrye.mutiny.Uni ztpGetDeviceRolesByDeviceId(context.ContextOuterClass.DeviceId request) {
- throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED);
- }
-
-
- public io.smallrye.mutiny.Uni ztpAdd(automation.Automation.DeviceRole request) {
- throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED);
- }
-
-
- public io.smallrye.mutiny.Uni ztpUpdate(automation.Automation.DeviceRoleConfig request) {
- throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED);
- }
-
-
- public io.smallrye.mutiny.Uni