diff --git a/.gencode_hash.txt b/.gencode_hash.txt index 2be502986..3598b824a 100644 --- a/.gencode_hash.txt +++ b/.gencode_hash.txt @@ -7,14 +7,14 @@ d6a260ed6dca30f85d18ca7c96421d1a70204816b4fd382cca1716e18ed506e8 gencode/docs/c 11b21f73b6a4065102968a4c09979639b8a7ea6efb20e40d52cd21b2a60167bb gencode/docs/configuration_pod.html 01495c82f15040bb307cbfd39e0bbc7af21ce0d70008cbd19878a9046dcda814 gencode/docs/configuration_pubber.html 1057fa40fb7a31a23bb2773d21c38cf4590a935bd8b5ea4218e695c6204f5dd9 gencode/docs/data_template.html -23948cddb6c580547ec8731414d814256cb1c2488d362b1fabc5a88cada3ab85 gencode/docs/events.html -39f92aeb39f5be8c152389664315de9e54a070022956a88e048cff892addb485 gencode/docs/events_discovery.html +95be7481d8c86d9ec32bdc70b1ad26cba2beab9e97c4b49a1e67191e10b2e41f gencode/docs/events.html +0c4e28c46a1bcb3f8450ae1aa7b176b119569e4053e569710092cfb34eeccad4 gencode/docs/events_discovery.html e550539d52ce1f63b35247d425c038e5d5ba33f997eedd09e486a3bd9838c2c2 gencode/docs/events_mapping.html 66e19faae60f9502749391889dbe24bd709963e658b61d989c7ba780672fa447 gencode/docs/events_pointset.html cac253f57c5c92ef32e2a5f91b6cec8229e8db1dcffcc96a58f06da068e741e7 gencode/docs/events_system.html 151c1b62db35e84e51d5ff2a7464f61ced4d7fb0c7eb795715c245ee0a1b3436 gencode/docs/events_udmi.html 73dbe799e7943ec20ac58b544998e986a39539d4ef0cb4f5023e92e7634d3124 gencode/docs/events_validation.html -f282f7756318e544254c94055f68abfc7e78a0cf37e10bca4314d6e5e75b23a7 gencode/docs/metadata.html +c5d9a49a05be86365ffca744fe81b4336769d049c612d4cd1617ee2462f55b5b gencode/docs/metadata.html 123276c35494a06b615642da3de61aa9a54cf76d16da795e4b20dd711d57f837 gencode/docs/monitoring.html 474ca16edc9f3cad2bb3ab40b6993cbced90263f762f66ee6cd246a6c4a0d18f gencode/docs/persistent_device.html e11595fd11477947a27461f8ef4fb6facb5f60e2abd6212193f7581ab123ff84 gencode/docs/properties.html @@ -36,13 +36,13 @@ fa94295bc0c97518634c7232e7e55e1c923d7eb42bfa3004651ed183e1ccbb40 gencode/java/u 14055abcc28b9dccc8807ff0e3de201a3fa94cd57b879c22bd7f4fab40d109d9 gencode/java/udmi/schema/BlobBlobsetState.java 1fe0e6cd4b82a54a0d696f0dd43998c3b08cf7d8b78f63b53fcd9c06d49f589c gencode/java/udmi/schema/BlobsetConfig.java 8c8e8941e34da08cddb0401ec296828d8b7aac1810dbfab6ae9ba5d7019c0dd0 gencode/java/udmi/schema/BlobsetState.java -31cc92287358c87acfbc41d24c71f000b23a3e96b0f18fed9331f1c349efab91 gencode/java/udmi/schema/BridgePodConfiguration.java +1110d57d04d4e5da14f6b02d40053cc9b9dabf8e24e44b7441a4a7c66cb546ac gencode/java/udmi/schema/BridgePodConfiguration.java 2e7c0912c6f43b8dae9e9149b7361d3640bde4f01de6e13d8e487fe01be2c2c0 gencode/java/udmi/schema/Bucket.java -79b678b524b3edce833fe56691dcd8c47b53a12f7491e761121408e6e7ceb5e3 gencode/java/udmi/schema/BuildingTranslation.java +519ead2ee2fe3e6fe48547266dec9a545521d52d262646f261ebfbbf8500d25f gencode/java/udmi/schema/BuildingTranslation.java 27ca4f61bd43beca0871b465f3906785a1030a4526605f1fa9b10e3adda8df05 gencode/java/udmi/schema/CapabilityValidationState.java 224c6be2cb6d90a47d181fa30ba1418cf6cc5385ec1c010fe112728382a70216 gencode/java/udmi/schema/Category.java 65a892c39e687a00e66e02f7ace2e17f07d3633a1b20b3dfd1e4ac3ec72a8788 gencode/java/udmi/schema/CloudConfigModel.java -5fcf687fa0167889a63a1fbaafc8c3f2d9ac16609c8e804fdce8171903c37a1f gencode/java/udmi/schema/CloudModel.java +d35424caf30021b9480bd7f73039b32dfb0c528bc748f86db20467d0c202b069 gencode/java/udmi/schema/CloudModel.java 051b4a7c85a2f1a310787f88f336be2fc9b87c99a94ac2f970955d2fe1daa931 gencode/java/udmi/schema/CloudQuery.java 3e6572b16184bde7557eb67334405e7c5b58446e64802658cf0d5ef3b0018909 gencode/java/udmi/schema/Common.java c44f25ab2b9f17ea18c7cd5b78e4c5565ba4ecc20d426105d778c28bb6b32263 gencode/java/udmi/schema/Config.java @@ -55,16 +55,16 @@ fd289a9a132a880bf0a14b80ed082ab1dcd77caab54175f8d6ccfc381d2d21ab gencode/java/u 6869d00b063748e9995ba6940f6a323916074a7af28ab1d227772b86a39600bb gencode/java/udmi/schema/DeviceValidationEvents.java ec863d0b69880bd2c3030abcdce1d2b8992a475908ead979cc30722b25c1ead2 gencode/java/udmi/schema/Dimension.java 09c9d674ffdde05f00878924a00ef81dc18d1135d5969e8ab9a8db80038198b7 gencode/java/udmi/schema/DiscoveryCommand.java -600a630adbaad68fe5f912f871c145ea13f5b9d5a5495591b84aa8cd93c04b83 gencode/java/udmi/schema/DiscoveryConfig.java +62d5f97b1664651b3d2791e73e3727e46cce045ba330c12d55be6ad483ca0c3a gencode/java/udmi/schema/DiscoveryConfig.java f72c9f04a8d25dc25854254eb6711040c47cd09942ed9c1ee885be4e1d729b10 gencode/java/udmi/schema/DiscoveryEvents.java 1a04079116f4032b17108e873719bbb2c60c19f392136e7c906122199b472227 gencode/java/udmi/schema/DiscoveryModel.java b41f59d0c1aa74bb9abbdc7525d726f45a4ba8df3866c2dd40458601ffab60fb gencode/java/udmi/schema/DiscoveryState.java 7019b8a1522261a69d708e2e7725b8bc44510c5c80f5c056543af2b7728bfa42 gencode/java/udmi/schema/Electricity.java -695ba089a30cbcb6b101147031e0546cef728322bad349392462cb57688d473a gencode/java/udmi/schema/EndpointConfiguration.java +a9ab0b95408ee04fc98cbc2363bead24c67e64e279e6088e0dd3e4b97154c65d gencode/java/udmi/schema/EndpointConfiguration.java d2e7afd6e1a9250480144c114ee8877afb9b0dd7048495fe96a821d9e6c80475 gencode/java/udmi/schema/Entry.java d4bfd2c997937cd1b0f9b1c73ed46b0133b2b264d367ca9001b7d84ecd598611 gencode/java/udmi/schema/Enumerations.java e0ca9b52b4cfb4be9d6c911a549a9f2f69f5f948f05a9e3a7b224c988f932ae3 gencode/java/udmi/schema/Envelope.java -4163478ed17191461b0a65abd11c4ddf912cbc104f040a734efd290306fab7b7 gencode/java/udmi/schema/Events.java +b8542a0908719901405220783e85be33197cf16ef5be6458cec5ae92c274e88f gencode/java/udmi/schema/Events.java 3347e406bb6e65bf0b7f3f811729f8e1be3eadc3e1a37a1523b233fe7c06879e gencode/java/udmi/schema/ExecutionConfiguration.java bd8350cd05a4091851cf0361cb3a8eb98701ba30df21ff14414e2dabf1289b7f gencode/java/udmi/schema/FamilyDiscovery.java c8358eb137e72cb92cd6979105fda299346ae5b2950af6f7ea9bf582698117d6 gencode/java/udmi/schema/FamilyDiscoveryConfig.java @@ -77,7 +77,7 @@ b39e12241d1bdabe0db583dc01a7a6b87efb5b57957dae5a3571cfec077b397c gencode/java/u 7206888cd092db347e7e92168987798eb0a3f290f2ed307427d971f15b18c49a gencode/java/udmi/schema/FeatureValidationState.java e256275d840d94c6e61316e756b0dad6d823db8900e35e785f6ef5001fdb5fc9 gencode/java/udmi/schema/Gas.java b63fed8a190948ee3924946c1ad3bc9cf06fdeafc7cea0886bfe52e390448ddf gencode/java/udmi/schema/GatewayConfig.java -0d2e02095e119ecdf4b35fb827f560c89f4f9e9ae8bdcf8648cb07432ff234c8 gencode/java/udmi/schema/GatewayModel.java +0e842669c4ca03cc2b938b6d2b4eea50bf54e13937130d1ab1fa7bc70883e728 gencode/java/udmi/schema/GatewayModel.java 1f7f6809e143e9e3e13e6fa73776a893b62b0c05f8802087b1e276dc0ab83e19 gencode/java/udmi/schema/GatewayState.java 175bdf9cc0b376b7f6c6b21174cb0ec568c49a1026e99bbdbc264b3cea7e7702 gencode/java/udmi/schema/IotAccess.java d0858bd7ba306176f4e3c19eeb69ef2467afec0832b6917b72d3ab87469e4974 gencode/java/udmi/schema/Jwt.java @@ -92,7 +92,7 @@ ca932e3a0d0da213950aa89ad7a19d94505dd478bf196946aa93436c5c8b7512 gencode/java/u edbb091621a6f5e3f7e6804c7c30c0877fab0b0455661186f37b303ed108ff26 gencode/java/udmi/schema/MappingEvents.java 2742b162c3524152f3f5fce62015139295fab7cbf8f58beb7f8287ea5d294e7c gencode/java/udmi/schema/MappingState.java 8b15a8982ccadc52d52a8083cb9e101c73f2a48e069c4d41d6e59ea914352507 gencode/java/udmi/schema/MessageTemplateData.java -cdbe66f2fe5e02bfcf37729e407a66ec2c942f763d61054462f37f258eee9c4e gencode/java/udmi/schema/Metadata.java +df82ad3f7d4229e41c39dde105a90e33732330ee2131b1f8e6907b69e62a69a3 gencode/java/udmi/schema/Metadata.java a64167bfcec809442cff132bb59ae0600055731407858656cc7147c3a38bb7cc gencode/java/udmi/schema/Metrics.java e986aff1efca08188441a246392f8c524c2cdaae107e475657402872a9a01561 gencode/java/udmi/schema/Monitoring.java 25210c7f94b6369c43c68ed1fefba1ab3dedfe3201352055c536fd5225a4c590 gencode/java/udmi/schema/MonitoringMetric.java @@ -114,14 +114,14 @@ c73ad6dde0db8a520f3fee5a563c55a79fc7e6d1cd7875723b10c3d34036a46b gencode/java/u d87deaba67bb3272c528e3491d378bde059b626964a4a2aed15f5643305c2463 gencode/java/udmi/schema/Properties.java 4cdd5dc6b2e054a43f2e70adeb46ef8e3ff78288d4315923a925415f87e871aa gencode/java/udmi/schema/PubberConfiguration.java 3bf0638ae4606ba3c3a1daf477d41c19d88c2a07a3700da7a6a61a3eeb4b2c32 gencode/java/udmi/schema/PubberOptions.java -9b208315dae017c35f2c31234348413dd8f569fd3d9922ea46259959662cc7fc gencode/java/udmi/schema/RefDiscovery.java +cd2c7580a75391393c2f761f4434e4e7e83e2d2d1f35e9e62d69c19e65ea2557 gencode/java/udmi/schema/RefDiscovery.java 14faa115d13ee46d10935b13753bff85758f3b64b5136a59f60d36b5b541687c gencode/java/udmi/schema/SchemaValidationState.java fadf083200e73d46cfdec2f710d40e3d2bc4dbf05196e4d0900186e72b62d95e gencode/java/udmi/schema/Scoring.java ad70168de2e1801e26f2c1a8c33a6169e236682de59fd3f6038a77ac264aca14 gencode/java/udmi/schema/SequenceValidationState.java 72e3a07ce890c73fccd3d0cf757d073746b60b722c94edd5425dc066951a048f gencode/java/udmi/schema/SetupUdmiConfig.java e5ce202bcf889287faa7d2d262d2f53f2241a10c659a83687de478803bdab127 gencode/java/udmi/schema/SetupUdmiState.java -2f802c738dd4c19211af8b6dec71b7659c51177c2774cfd34fc07e617bbe5b3e gencode/java/udmi/schema/SiteLinks.java -a3dc7f14d4270ea370db2015785ad12d4bd61825213ab7ac4ee03dda21dde4f2 gencode/java/udmi/schema/SiteLocation.java +7774221174299a7f137576a591d4ae76aaaec5a1950804e73403acf0157b31b5 gencode/java/udmi/schema/SiteLinks.java +956c8af0bb83a33d05bcbcd211d161f9a76723c270372cd443838e31f97c09e3 gencode/java/udmi/schema/SiteLocation.java 376a30d35d87827c356fd4ce8b071eaf739bbbdaa24d39be5c0f23a503d435ea gencode/java/udmi/schema/SiteMetadata.java dc2fd582fffefbdeaf3bf7724ca34e94475c3cc820891ea4cc829847eb9ba79d gencode/java/udmi/schema/State.java a371232810e8a2ffb380384ca717da1ee5cc0b2e1129df9b5d8faa07ab4b1f46 gencode/java/udmi/schema/StateSystemHardware.java @@ -151,7 +151,7 @@ dab4f5fca272ec48c2881bca2b6bc43786ada47fa1f6dd935c35f7ce0eb6b0f6 gencode/python 470b688984b89b25fcdfa8e08bd95b0c5d8c551d53a6ab5512503ee39419e6fa gencode/python/udmi/schema/category.py cfaeca16d0420f4553acf594f85a80ceb149487f1c41d02ee6e73a6ce5e1ac5b gencode/python/udmi/schema/commands_discovery.py 69dac232428f6c79855cd5a13b24d341679133068a707d1281e1922168cabf93 gencode/python/udmi/schema/commands_mapping.py -7be9cf5102de91953662a3e42a202482fa34404be2e1beb9d330fe91454c15ff gencode/python/udmi/schema/common.py +8d752fde86eb65450284f80711b631ee0d6c45ffbad913bc63f0f958e7bc6a24 gencode/python/udmi/schema/common.py 53961cd8a6ddd118143457ca60d765e12b21bcdf98fc2d648ebac0172ffca880 gencode/python/udmi/schema/config.py 79eb0299b3751d93c01a5de65eacc717283e99caf0996f3db48a15247f69c8eb gencode/python/udmi/schema/config_blobset.py 59039eaf2812392329c641ad387f7e27790cf804fc94a014626d2da5ab426e3d gencode/python/udmi/schema/config_blobset_blob.py @@ -192,7 +192,7 @@ dc4bef0026ac8d9b0e5b13fe675b16df889e38671a7946371fe47d0443d82e4d gencode/python 0423bfd2158a71a1ce3961054aceacbe6603ad1f65a707b586d17bfabb2a99cb gencode/python/udmi/schema/events_udmi.py 8f4ec5b4d717a0c497e914a2e15c72d96bfd3bbb119fa3b1e21ac96243c195bd gencode/python/udmi/schema/events_validation.py 3707a9a5a07b7cf80e4ce6b0ca81584de74a9d5fe361214a4d3b6f22dd30cad8 gencode/python/udmi/schema/events_validation_device.py -4e4cd57d7688873b1751e72abe1cd715b92374ff2325ac5e15e6e620022c1a69 gencode/python/udmi/schema/metadata.py +08b264888144afa79f36b02cd3b855bf938afee5f519e84a37e4b8f18c94d6d5 gencode/python/udmi/schema/metadata.py 375fe28a8f98a1644b2b58d3e204b934b1a5d60e6eb3cfa1a7cb85e375b2cbae gencode/python/udmi/schema/model_cloud.py 2ec91522178789a3d5ec27ad8ed13a94b8619139359dc3dcad9601b9adc1582d gencode/python/udmi/schema/model_cloud_config.py 387e3f68dad9ddd6211a4e10d25c35026a4c0083b606819fdb4e338be9e135ca gencode/python/udmi/schema/model_discovery.py diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index a29079703..d47b7e8f3 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -32,7 +32,7 @@ jobs: - uses: actions/setup-java@v4 with: distribution: 'temurin' - java-version: '17' + java-version: '21' - name: Log in to the github registry uses: docker/login-action@v3 with: @@ -85,7 +85,7 @@ jobs: - uses: actions/setup-java@v4 with: distribution: 'temurin' - java-version: '17' + java-version: '21' - name: Publish maven package run: pubber/bin/publish diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index ba72a0618..89fe6280d 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -22,7 +22,7 @@ jobs: - uses: actions/setup-java@v4 with: distribution: 'temurin' - java-version: '17' + java-version: '21' - uses: actions/setup-python@v5 with: python-version: '3.10' @@ -78,7 +78,7 @@ jobs: - uses: actions/setup-java@v4 with: distribution: 'temurin' - java-version: '17' + java-version: '21' - name: base setup run: | bin/setup_base @@ -129,7 +129,7 @@ jobs: - uses: actions/setup-java@v4 with: distribution: 'temurin' - java-version: '17' + java-version: '21' - name: base setup run: bin/run_tests install_dependencies - name: local setup @@ -184,7 +184,7 @@ jobs: - uses: actions/setup-java@v4 with: distribution: 'temurin' - java-version: '17' + java-version: '21' - name: base setup run: bin/run_tests install_dependencies - name: local setup @@ -236,7 +236,7 @@ jobs: - uses: actions/setup-java@v4 with: distribution: 'temurin' - java-version: '17' + java-version: '21' - name: base setup run: | bin/setup_base @@ -291,7 +291,7 @@ jobs: - uses: actions/setup-java@v4 with: distribution: 'temurin' - java-version: '17' + java-version: '21' - name: base setup run: bin/run_tests install_dependencies - name: local setup @@ -369,7 +369,7 @@ jobs: - uses: actions/setup-java@v4 with: distribution: 'temurin' - java-version: '17' + java-version: '21' - name: Setup prerequisites run: | bin/setup_base diff --git a/bin/test_runlocal b/bin/test_runlocal index a72c5ac8d..dbd59227b 100755 --- a/bin/test_runlocal +++ b/bin/test_runlocal @@ -15,13 +15,13 @@ echo Captured $(wc -l out/message_capture.log) messages. systems=$(find out/registries/ -name \*update_model.json | xargs jq .system | fgrep -v null | wc -l) || true [[ $systems == 269 ]] || fail Expected 269 system operations, found $systems -deletes=$(find out/registries/ -name \*update_model.json | xargs jq .cloud.operation | fgrep DELETE | wc -l) || true +deletes=$(find out/registries/ -name \*update_model.json | xargs jq .operation | fgrep DELETE | wc -l) || true [[ $deletes == 1 ]] || fail Expected 1 delete operations, found $deletes -binds=$(find out/registries/ -name \*update_model.json | xargs jq .cloud.operation | fgrep BIND | wc -l) || true +binds=$(find out/registries/ -name \*update_model.json | xargs jq .operation | fgrep BIND | wc -l) || true [[ $binds == 3 ]] || fail Expected 3 bind operations, found $binds -blocks=$(find out/registries/ -name \*update_model.json | xargs jq .cloud.operation | fgrep BLOCK | wc -l) || true +blocks=$(find out/registries/ -name \*update_model.json | xargs jq .operation | fgrep BLOCK | wc -l) || true [[ $blocks == 1 ]] || fail Expected 1 block operations, found $blocks echo Done with successful runlocal validation. diff --git a/gencode/docs/events.html b/gencode/docs/events.html index 613b4f6cb..d13e90a6b 100644 --- a/gencode/docs/events.html +++ b/gencode/docs/events.html @@ -7829,8 +7829,10 @@

d="M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8z" /> - operationType: enum (of string)
-
+ operation

Model Operation

Type: enum (of string)
+ + +

Must be one of:

@@ -9677,8 +9679,10 @@

d="M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8z" /> - operationType: enum (of string)
-
+ operation

Model Operation

Type: enum (of string)
+ + +

Must be one of:

@@ -21534,8 +21538,10 @@

d="M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8z" /> - operationType: enum (of string)
-
+ operation

Model Operation

Type: enum (of string)
+ + +

Must be one of:

diff --git a/gencode/docs/events_discovery.html b/gencode/docs/events_discovery.html index aeeca3f60..0ae1e22b2 100644 --- a/gencode/docs/events_discovery.html +++ b/gencode/docs/events_discovery.html @@ -3792,8 +3792,10 @@

d="M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8z" /> - operationType: enum (of string)
-
+ operation

Model Operation

Type: enum (of string)
+ + +

Must be one of:

@@ -5423,8 +5425,10 @@

d="M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8z" /> - operationType: enum (of string)
-
+ operation

Model Operation

Type: enum (of string)
+ + +

Must be one of:

@@ -16027,8 +16031,10 @@

d="M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8z" /> - operationType: enum (of string)
-
+ operation

Model Operation

Type: enum (of string)
+ + +

Must be one of:

diff --git a/gencode/docs/metadata.html b/gencode/docs/metadata.html index 939a1db7f..3c17b1a5a 100644 --- a/gencode/docs/metadata.html +++ b/gencode/docs/metadata.html @@ -165,6 +165,45 @@

+ + + + +
+
+
+

+ +

+
+ +
+
+ +

Model Operation

Type: enum (of string)
+

Used for model update operations (so not a model proper), e.g. DELETE or BIND operations

+
+ +
+

Must be one of:

+
  • "ERROR"
  • "CREATE"
  • "READ"
  • "REPLY"
  • "UPDATE"
  • "DELETE"
  • "MODIFY"
  • "PREVIEW"
  • "BIND"
  • "UNBIND"
  • "BOUND"
  • "ALLOW"
  • "BLOCK"
+
+ + + + + +
@@ -1398,8 +1437,10 @@

d="M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8z" /> - operation

Type: enum (of string)
-
+ operation

Model Operation

Type: enum (of string)
+ + +

Must be one of:

@@ -16438,8 +16479,10 @@

d="M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8z" /> - operationType: enum (of string)
-
+ operation

Model Operation

Type: enum (of string)
+ + +

Must be one of:

@@ -18503,8 +18546,10 @@

d="M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8z" /> - operationType: enum (of string)
-
+ operation

Model Operation

Type: enum (of string)
+ + +

Must be one of:

@@ -31613,8 +31658,10 @@

d="M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8z" /> - operationType: enum (of string)
-
+ operation

Model Operation

Type: enum (of string)
+ + +

Must be one of:

diff --git a/gencode/java/udmi/schema/BridgePodConfiguration.java b/gencode/java/udmi/schema/BridgePodConfiguration.java index 1d46d6914..09122ccf9 100644 --- a/gencode/java/udmi/schema/BridgePodConfiguration.java +++ b/gencode/java/udmi/schema/BridgePodConfiguration.java @@ -45,9 +45,9 @@ public class BridgePodConfiguration { @Override public int hashCode() { int result = 1; - result = ((result* 31)+((this.from == null)? 0 :this.from.hashCode())); result = ((result* 31)+((this.morf == null)? 0 :this.morf.hashCode())); result = ((result* 31)+((this.enabled == null)? 0 :this.enabled.hashCode())); + result = ((result* 31)+((this.from == null)? 0 :this.from.hashCode())); return result; } @@ -60,7 +60,7 @@ public boolean equals(Object other) { return false; } BridgePodConfiguration rhs = ((BridgePodConfiguration) other); - return ((((this.from == rhs.from)||((this.from!= null)&&this.from.equals(rhs.from)))&&((this.morf == rhs.morf)||((this.morf!= null)&&this.morf.equals(rhs.morf))))&&((this.enabled == rhs.enabled)||((this.enabled!= null)&&this.enabled.equals(rhs.enabled)))); + return ((((this.morf == rhs.morf)||((this.morf!= null)&&this.morf.equals(rhs.morf)))&&((this.enabled == rhs.enabled)||((this.enabled!= null)&&this.enabled.equals(rhs.enabled))))&&((this.from == rhs.from)||((this.from!= null)&&this.from.equals(rhs.from)))); } } diff --git a/gencode/java/udmi/schema/BuildingTranslation.java b/gencode/java/udmi/schema/BuildingTranslation.java index 3eb59f86c..871aa773f 100644 --- a/gencode/java/udmi/schema/BuildingTranslation.java +++ b/gencode/java/udmi/schema/BuildingTranslation.java @@ -36,8 +36,8 @@ public class BuildingTranslation { @Override public int hashCode() { int result = 1; - result = ((result* 31)+((this.units == null)? 0 :this.units.hashCode())); result = ((result* 31)+((this.present_value == null)? 0 :this.present_value.hashCode())); + result = ((result* 31)+((this.units == null)? 0 :this.units.hashCode())); result = ((result* 31)+((this.states == null)? 0 :this.states.hashCode())); return result; } @@ -51,7 +51,7 @@ public boolean equals(Object other) { return false; } BuildingTranslation rhs = ((BuildingTranslation) other); - return ((((this.units == rhs.units)||((this.units!= null)&&this.units.equals(rhs.units)))&&((this.present_value == rhs.present_value)||((this.present_value!= null)&&this.present_value.equals(rhs.present_value))))&&((this.states == rhs.states)||((this.states!= null)&&this.states.equals(rhs.states)))); + return ((((this.present_value == rhs.present_value)||((this.present_value!= null)&&this.present_value.equals(rhs.present_value)))&&((this.units == rhs.units)||((this.units!= null)&&this.units.equals(rhs.units))))&&((this.states == rhs.states)||((this.states!= null)&&this.states.equals(rhs.states)))); } } diff --git a/gencode/java/udmi/schema/CloudModel.java b/gencode/java/udmi/schema/CloudModel.java index 22aa26dd3..ea71c4cf0 100644 --- a/gencode/java/udmi/schema/CloudModel.java +++ b/gencode/java/udmi/schema/CloudModel.java @@ -134,8 +134,14 @@ public class CloudModel { public Date last_config_ack; @JsonProperty("num_id") public java.lang.String num_id; + /** + * Model Operation + *

+ * + * + */ @JsonProperty("operation") - public CloudModel.Operation operation; + public CloudModel.ModelOperation operation; @JsonProperty("metadata") public Map metadata; /** @@ -285,7 +291,14 @@ public static CloudModel.Connection_type fromValue(java.lang.String value) { } - public enum Operation { + + /** + * Model Operation + *

+ * + * + */ + public enum ModelOperation { ERROR("ERROR"), CREATE("CREATE"), @@ -301,15 +314,15 @@ public enum Operation { ALLOW("ALLOW"), BLOCK("BLOCK"); private final java.lang.String value; - private final static Map CONSTANTS = new HashMap(); + private final static Map CONSTANTS = new HashMap(); static { - for (CloudModel.Operation c: values()) { + for (CloudModel.ModelOperation c: values()) { CONSTANTS.put(c.value, c); } } - Operation(java.lang.String value) { + ModelOperation(java.lang.String value) { this.value = value; } @@ -324,8 +337,8 @@ public java.lang.String value() { } @JsonCreator - public static CloudModel.Operation fromValue(java.lang.String value) { - CloudModel.Operation constant = CONSTANTS.get(value); + public static CloudModel.ModelOperation fromValue(java.lang.String value) { + CloudModel.ModelOperation constant = CONSTANTS.get(value); if (constant == null) { throw new IllegalArgumentException(value); } else { diff --git a/gencode/java/udmi/schema/DiscoveryConfig.java b/gencode/java/udmi/schema/DiscoveryConfig.java index 7d37f46e6..97bf08dae 100644 --- a/gencode/java/udmi/schema/DiscoveryConfig.java +++ b/gencode/java/udmi/schema/DiscoveryConfig.java @@ -49,8 +49,8 @@ public class DiscoveryConfig { public int hashCode() { int result = 1; result = ((result* 31)+((this.generation == null)? 0 :this.generation.hashCode())); - result = ((result* 31)+((this.enumerations == null)? 0 :this.enumerations.hashCode())); result = ((result* 31)+((this.families == null)? 0 :this.families.hashCode())); + result = ((result* 31)+((this.enumerations == null)? 0 :this.enumerations.hashCode())); return result; } @@ -63,7 +63,7 @@ public boolean equals(Object other) { return false; } DiscoveryConfig rhs = ((DiscoveryConfig) other); - return ((((this.generation == rhs.generation)||((this.generation!= null)&&this.generation.equals(rhs.generation)))&&((this.enumerations == rhs.enumerations)||((this.enumerations!= null)&&this.enumerations.equals(rhs.enumerations))))&&((this.families == rhs.families)||((this.families!= null)&&this.families.equals(rhs.families)))); + return ((((this.generation == rhs.generation)||((this.generation!= null)&&this.generation.equals(rhs.generation)))&&((this.families == rhs.families)||((this.families!= null)&&this.families.equals(rhs.families))))&&((this.enumerations == rhs.enumerations)||((this.enumerations!= null)&&this.enumerations.equals(rhs.enumerations)))); } } diff --git a/gencode/java/udmi/schema/EndpointConfiguration.java b/gencode/java/udmi/schema/EndpointConfiguration.java index 40ec7da07..ebfba2835 100644 --- a/gencode/java/udmi/schema/EndpointConfiguration.java +++ b/gencode/java/udmi/schema/EndpointConfiguration.java @@ -184,30 +184,30 @@ public class EndpointConfiguration { @Override public int hashCode() { int result = 1; + result = ((result* 31)+((this.generation == null)? 0 :this.generation.hashCode())); result = ((result* 31)+((this.keyBytes == null)? 0 :this.keyBytes.hashCode())); result = ((result* 31)+((this.side_id == null)? 0 :this.side_id.hashCode())); + result = ((result* 31)+((this.transport == null)? 0 :this.transport.hashCode())); + result = ((result* 31)+((this.publish_delay_sec == null)? 0 :this.publish_delay_sec.hashCode())); result = ((result* 31)+((this.error == null)? 0 :this.error.hashCode())); + result = ((result* 31)+((this.config_sync_sec == null)? 0 :this.config_sync_sec.hashCode())); result = ((result* 31)+((this.deviceId == null)? 0 :this.deviceId.hashCode())); result = ((result* 31)+((this.client_id == null)? 0 :this.client_id.hashCode())); result = ((result* 31)+((this.enabled == null)? 0 :this.enabled.hashCode())); result = ((result* 31)+((this.capacity == null)? 0 :this.capacity.hashCode())); + result = ((result* 31)+((this.send_id == null)? 0 :this.send_id.hashCode())); result = ((result* 31)+((this.protocol == null)? 0 :this.protocol.hashCode())); result = ((result* 31)+((this.hostname == null)? 0 :this.hostname.hashCode())); result = ((result* 31)+((this.payload == null)? 0 :this.payload.hashCode())); - result = ((result* 31)+((this.topic_prefix == null)? 0 :this.topic_prefix.hashCode())); - result = ((result* 31)+((this.recv_id == null)? 0 :this.recv_id.hashCode())); - result = ((result* 31)+((this.algorithm == null)? 0 :this.algorithm.hashCode())); - result = ((result* 31)+((this.generation == null)? 0 :this.generation.hashCode())); - result = ((result* 31)+((this.transport == null)? 0 :this.transport.hashCode())); - result = ((result* 31)+((this.publish_delay_sec == null)? 0 :this.publish_delay_sec.hashCode())); - result = ((result* 31)+((this.config_sync_sec == null)? 0 :this.config_sync_sec.hashCode())); - result = ((result* 31)+((this.send_id == null)? 0 :this.send_id.hashCode())); result = ((result* 31)+((this.port == null)? 0 :this.port.hashCode())); + result = ((result* 31)+((this.topic_prefix == null)? 0 :this.topic_prefix.hashCode())); result = ((result* 31)+((this.name == null)? 0 :this.name.hashCode())); result = ((result* 31)+((this.periodic_sec == null)? 0 :this.periodic_sec.hashCode())); result = ((result* 31)+((this.noConfigAck == null)? 0 :this.noConfigAck.hashCode())); + result = ((result* 31)+((this.recv_id == null)? 0 :this.recv_id.hashCode())); result = ((result* 31)+((this.gatewayId == null)? 0 :this.gatewayId.hashCode())); result = ((result* 31)+((this.auth_provider == null)? 0 :this.auth_provider.hashCode())); + result = ((result* 31)+((this.algorithm == null)? 0 :this.algorithm.hashCode())); return result; } @@ -220,7 +220,7 @@ public boolean equals(Object other) { return false; } EndpointConfiguration rhs = ((EndpointConfiguration) other); - return (((((((((((((((((((((((((this.keyBytes == rhs.keyBytes)||((this.keyBytes!= null)&&this.keyBytes.equals(rhs.keyBytes)))&&((this.side_id == rhs.side_id)||((this.side_id!= null)&&this.side_id.equals(rhs.side_id))))&&((this.error == rhs.error)||((this.error!= null)&&this.error.equals(rhs.error))))&&((this.deviceId == rhs.deviceId)||((this.deviceId!= null)&&this.deviceId.equals(rhs.deviceId))))&&((this.client_id == rhs.client_id)||((this.client_id!= null)&&this.client_id.equals(rhs.client_id))))&&((this.enabled == rhs.enabled)||((this.enabled!= null)&&this.enabled.equals(rhs.enabled))))&&((this.capacity == rhs.capacity)||((this.capacity!= null)&&this.capacity.equals(rhs.capacity))))&&((this.protocol == rhs.protocol)||((this.protocol!= null)&&this.protocol.equals(rhs.protocol))))&&((this.hostname == rhs.hostname)||((this.hostname!= null)&&this.hostname.equals(rhs.hostname))))&&((this.payload == rhs.payload)||((this.payload!= null)&&this.payload.equals(rhs.payload))))&&((this.topic_prefix == rhs.topic_prefix)||((this.topic_prefix!= null)&&this.topic_prefix.equals(rhs.topic_prefix))))&&((this.recv_id == rhs.recv_id)||((this.recv_id!= null)&&this.recv_id.equals(rhs.recv_id))))&&((this.algorithm == rhs.algorithm)||((this.algorithm!= null)&&this.algorithm.equals(rhs.algorithm))))&&((this.generation == rhs.generation)||((this.generation!= null)&&this.generation.equals(rhs.generation))))&&((this.transport == rhs.transport)||((this.transport!= null)&&this.transport.equals(rhs.transport))))&&((this.publish_delay_sec == rhs.publish_delay_sec)||((this.publish_delay_sec!= null)&&this.publish_delay_sec.equals(rhs.publish_delay_sec))))&&((this.config_sync_sec == rhs.config_sync_sec)||((this.config_sync_sec!= null)&&this.config_sync_sec.equals(rhs.config_sync_sec))))&&((this.send_id == rhs.send_id)||((this.send_id!= null)&&this.send_id.equals(rhs.send_id))))&&((this.port == rhs.port)||((this.port!= null)&&this.port.equals(rhs.port))))&&((this.name == rhs.name)||((this.name!= null)&&this.name.equals(rhs.name))))&&((this.periodic_sec == rhs.periodic_sec)||((this.periodic_sec!= null)&&this.periodic_sec.equals(rhs.periodic_sec))))&&((this.noConfigAck == rhs.noConfigAck)||((this.noConfigAck!= null)&&this.noConfigAck.equals(rhs.noConfigAck))))&&((this.gatewayId == rhs.gatewayId)||((this.gatewayId!= null)&&this.gatewayId.equals(rhs.gatewayId))))&&((this.auth_provider == rhs.auth_provider)||((this.auth_provider!= null)&&this.auth_provider.equals(rhs.auth_provider)))); + return (((((((((((((((((((((((((this.generation == rhs.generation)||((this.generation!= null)&&this.generation.equals(rhs.generation)))&&((this.keyBytes == rhs.keyBytes)||((this.keyBytes!= null)&&this.keyBytes.equals(rhs.keyBytes))))&&((this.side_id == rhs.side_id)||((this.side_id!= null)&&this.side_id.equals(rhs.side_id))))&&((this.transport == rhs.transport)||((this.transport!= null)&&this.transport.equals(rhs.transport))))&&((this.publish_delay_sec == rhs.publish_delay_sec)||((this.publish_delay_sec!= null)&&this.publish_delay_sec.equals(rhs.publish_delay_sec))))&&((this.error == rhs.error)||((this.error!= null)&&this.error.equals(rhs.error))))&&((this.config_sync_sec == rhs.config_sync_sec)||((this.config_sync_sec!= null)&&this.config_sync_sec.equals(rhs.config_sync_sec))))&&((this.deviceId == rhs.deviceId)||((this.deviceId!= null)&&this.deviceId.equals(rhs.deviceId))))&&((this.client_id == rhs.client_id)||((this.client_id!= null)&&this.client_id.equals(rhs.client_id))))&&((this.enabled == rhs.enabled)||((this.enabled!= null)&&this.enabled.equals(rhs.enabled))))&&((this.capacity == rhs.capacity)||((this.capacity!= null)&&this.capacity.equals(rhs.capacity))))&&((this.send_id == rhs.send_id)||((this.send_id!= null)&&this.send_id.equals(rhs.send_id))))&&((this.protocol == rhs.protocol)||((this.protocol!= null)&&this.protocol.equals(rhs.protocol))))&&((this.hostname == rhs.hostname)||((this.hostname!= null)&&this.hostname.equals(rhs.hostname))))&&((this.payload == rhs.payload)||((this.payload!= null)&&this.payload.equals(rhs.payload))))&&((this.port == rhs.port)||((this.port!= null)&&this.port.equals(rhs.port))))&&((this.topic_prefix == rhs.topic_prefix)||((this.topic_prefix!= null)&&this.topic_prefix.equals(rhs.topic_prefix))))&&((this.name == rhs.name)||((this.name!= null)&&this.name.equals(rhs.name))))&&((this.periodic_sec == rhs.periodic_sec)||((this.periodic_sec!= null)&&this.periodic_sec.equals(rhs.periodic_sec))))&&((this.noConfigAck == rhs.noConfigAck)||((this.noConfigAck!= null)&&this.noConfigAck.equals(rhs.noConfigAck))))&&((this.recv_id == rhs.recv_id)||((this.recv_id!= null)&&this.recv_id.equals(rhs.recv_id))))&&((this.gatewayId == rhs.gatewayId)||((this.gatewayId!= null)&&this.gatewayId.equals(rhs.gatewayId))))&&((this.auth_provider == rhs.auth_provider)||((this.auth_provider!= null)&&this.auth_provider.equals(rhs.auth_provider))))&&((this.algorithm == rhs.algorithm)||((this.algorithm!= null)&&this.algorithm.equals(rhs.algorithm)))); } public enum Protocol { diff --git a/gencode/java/udmi/schema/Events.java b/gencode/java/udmi/schema/Events.java index 280293bc3..a431206d3 100644 --- a/gencode/java/udmi/schema/Events.java +++ b/gencode/java/udmi/schema/Events.java @@ -53,8 +53,8 @@ public class Events { public int hashCode() { int result = 1; result = ((result* 31)+((this.pointset == null)? 0 :this.pointset.hashCode())); - result = ((result* 31)+((this.system == null)? 0 :this.system.hashCode())); result = ((result* 31)+((this.discovery == null)? 0 :this.discovery.hashCode())); + result = ((result* 31)+((this.system == null)? 0 :this.system.hashCode())); return result; } @@ -67,7 +67,7 @@ public boolean equals(Object other) { return false; } Events rhs = ((Events) other); - return ((((this.pointset == rhs.pointset)||((this.pointset!= null)&&this.pointset.equals(rhs.pointset)))&&((this.system == rhs.system)||((this.system!= null)&&this.system.equals(rhs.system))))&&((this.discovery == rhs.discovery)||((this.discovery!= null)&&this.discovery.equals(rhs.discovery)))); + return ((((this.pointset == rhs.pointset)||((this.pointset!= null)&&this.pointset.equals(rhs.pointset)))&&((this.discovery == rhs.discovery)||((this.discovery!= null)&&this.discovery.equals(rhs.discovery))))&&((this.system == rhs.system)||((this.system!= null)&&this.system.equals(rhs.system)))); } } diff --git a/gencode/java/udmi/schema/GatewayModel.java b/gencode/java/udmi/schema/GatewayModel.java index 22876706e..f474d979a 100644 --- a/gencode/java/udmi/schema/GatewayModel.java +++ b/gencode/java/udmi/schema/GatewayModel.java @@ -49,8 +49,8 @@ public class GatewayModel { @Override public int hashCode() { int result = 1; - result = ((result* 31)+((this.proxy_ids == null)? 0 :this.proxy_ids.hashCode())); result = ((result* 31)+((this.gateway_id == null)? 0 :this.gateway_id.hashCode())); + result = ((result* 31)+((this.proxy_ids == null)? 0 :this.proxy_ids.hashCode())); result = ((result* 31)+((this.target == null)? 0 :this.target.hashCode())); return result; } @@ -64,7 +64,7 @@ public boolean equals(Object other) { return false; } GatewayModel rhs = ((GatewayModel) other); - return ((((this.proxy_ids == rhs.proxy_ids)||((this.proxy_ids!= null)&&this.proxy_ids.equals(rhs.proxy_ids)))&&((this.gateway_id == rhs.gateway_id)||((this.gateway_id!= null)&&this.gateway_id.equals(rhs.gateway_id))))&&((this.target == rhs.target)||((this.target!= null)&&this.target.equals(rhs.target)))); + return ((((this.gateway_id == rhs.gateway_id)||((this.gateway_id!= null)&&this.gateway_id.equals(rhs.gateway_id)))&&((this.proxy_ids == rhs.proxy_ids)||((this.proxy_ids!= null)&&this.proxy_ids.equals(rhs.proxy_ids))))&&((this.target == rhs.target)||((this.target!= null)&&this.target.equals(rhs.target)))); } } diff --git a/gencode/java/udmi/schema/Metadata.java b/gencode/java/udmi/schema/Metadata.java index cabbe1cc8..22c935307 100644 --- a/gencode/java/udmi/schema/Metadata.java +++ b/gencode/java/udmi/schema/Metadata.java @@ -22,6 +22,7 @@ "version", "upgraded_from", "hash", + "operation", "cloud", "system", "gateway", @@ -64,6 +65,14 @@ public class Metadata { @JsonProperty("hash") @JsonPropertyDescription("Automatically generated field that contains the hash of file contents.") public java.lang.String hash; + /** + * Model Operation + *

+ * + * + */ + @JsonProperty("operation") + public CloudModel.ModelOperation operation; /** * Cloud Model *

@@ -152,6 +161,7 @@ public int hashCode() { result = ((result* 31)+((this.discovery == null)? 0 :this.discovery.hashCode())); result = ((result* 31)+((this.upgraded_from == null)? 0 :this.upgraded_from.hashCode())); result = ((result* 31)+((this.pointset == null)? 0 :this.pointset.hashCode())); + result = ((result* 31)+((this.operation == null)? 0 :this.operation.hashCode())); result = ((result* 31)+((this.hash == null)? 0 :this.hash.hashCode())); result = ((result* 31)+((this.gateway == null)? 0 :this.gateway.hashCode())); result = ((result* 31)+((this.localnet == null)? 0 :this.localnet.hashCode())); @@ -168,7 +178,7 @@ public boolean equals(Object other) { return false; } Metadata rhs = ((Metadata) other); - return ((((((((((((((this.testing == rhs.testing)||((this.testing!= null)&&this.testing.equals(rhs.testing)))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.structure == rhs.structure)||((this.structure!= null)&&this.structure.equals(rhs.structure))))&&((this.cloud == rhs.cloud)||((this.cloud!= null)&&this.cloud.equals(rhs.cloud))))&&((this.features == rhs.features)||((this.features!= null)&&this.features.equals(rhs.features))))&&((this.system == rhs.system)||((this.system!= null)&&this.system.equals(rhs.system))))&&((this.discovery == rhs.discovery)||((this.discovery!= null)&&this.discovery.equals(rhs.discovery))))&&((this.upgraded_from == rhs.upgraded_from)||((this.upgraded_from!= null)&&this.upgraded_from.equals(rhs.upgraded_from))))&&((this.pointset == rhs.pointset)||((this.pointset!= null)&&this.pointset.equals(rhs.pointset))))&&((this.hash == rhs.hash)||((this.hash!= null)&&this.hash.equals(rhs.hash))))&&((this.gateway == rhs.gateway)||((this.gateway!= null)&&this.gateway.equals(rhs.gateway))))&&((this.localnet == rhs.localnet)||((this.localnet!= null)&&this.localnet.equals(rhs.localnet))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp)))); + return (((((((((((((((this.testing == rhs.testing)||((this.testing!= null)&&this.testing.equals(rhs.testing)))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.structure == rhs.structure)||((this.structure!= null)&&this.structure.equals(rhs.structure))))&&((this.cloud == rhs.cloud)||((this.cloud!= null)&&this.cloud.equals(rhs.cloud))))&&((this.features == rhs.features)||((this.features!= null)&&this.features.equals(rhs.features))))&&((this.system == rhs.system)||((this.system!= null)&&this.system.equals(rhs.system))))&&((this.discovery == rhs.discovery)||((this.discovery!= null)&&this.discovery.equals(rhs.discovery))))&&((this.upgraded_from == rhs.upgraded_from)||((this.upgraded_from!= null)&&this.upgraded_from.equals(rhs.upgraded_from))))&&((this.pointset == rhs.pointset)||((this.pointset!= null)&&this.pointset.equals(rhs.pointset))))&&((this.operation == rhs.operation)||((this.operation!= null)&&this.operation.equals(rhs.operation))))&&((this.hash == rhs.hash)||((this.hash!= null)&&this.hash.equals(rhs.hash))))&&((this.gateway == rhs.gateway)||((this.gateway!= null)&&this.gateway.equals(rhs.gateway))))&&((this.localnet == rhs.localnet)||((this.localnet!= null)&&this.localnet.equals(rhs.localnet))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp)))); } } diff --git a/gencode/java/udmi/schema/RefDiscovery.java b/gencode/java/udmi/schema/RefDiscovery.java index e50aeb6bf..7bdebeeda 100644 --- a/gencode/java/udmi/schema/RefDiscovery.java +++ b/gencode/java/udmi/schema/RefDiscovery.java @@ -113,17 +113,17 @@ public class RefDiscovery { @Override public int hashCode() { int result = 1; + result = ((result* 31)+((this.ref == null)? 0 :this.ref.hashCode())); + result = ((result* 31)+((this.possible_values == null)? 0 :this.possible_values.hashCode())); + result = ((result* 31)+((this.name == null)? 0 :this.name.hashCode())); result = ((result* 31)+((this.description == null)? 0 :this.description.hashCode())); result = ((result* 31)+((this.units == null)? 0 :this.units.hashCode())); result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.ancillary == null)? 0 :this.ancillary.hashCode())); + result = ((result* 31)+((this.adjunct == null)? 0 :this.adjunct.hashCode())); result = ((result* 31)+((this.point == null)? 0 :this.point.hashCode())); result = ((result* 31)+((this.structure == null)? 0 :this.structure.hashCode())); result = ((result* 31)+((this.writable == null)? 0 :this.writable.hashCode())); - result = ((result* 31)+((this.ref == null)? 0 :this.ref.hashCode())); - result = ((result* 31)+((this.possible_values == null)? 0 :this.possible_values.hashCode())); - result = ((result* 31)+((this.name == null)? 0 :this.name.hashCode())); - result = ((result* 31)+((this.ancillary == null)? 0 :this.ancillary.hashCode())); - result = ((result* 31)+((this.adjunct == null)? 0 :this.adjunct.hashCode())); result = ((result* 31)+((this.status == null)? 0 :this.status.hashCode())); return result; } @@ -137,7 +137,7 @@ public boolean equals(java.lang.Object other) { return false; } RefDiscovery rhs = ((RefDiscovery) other); - return (((((((((((((this.description == rhs.description)||((this.description!= null)&&this.description.equals(rhs.description)))&&((this.units == rhs.units)||((this.units!= null)&&this.units.equals(rhs.units))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.point == rhs.point)||((this.point!= null)&&this.point.equals(rhs.point))))&&((this.structure == rhs.structure)||((this.structure!= null)&&this.structure.equals(rhs.structure))))&&((this.writable == rhs.writable)||((this.writable!= null)&&this.writable.equals(rhs.writable))))&&((this.ref == rhs.ref)||((this.ref!= null)&&this.ref.equals(rhs.ref))))&&((this.possible_values == rhs.possible_values)||((this.possible_values!= null)&&this.possible_values.equals(rhs.possible_values))))&&((this.name == rhs.name)||((this.name!= null)&&this.name.equals(rhs.name))))&&((this.ancillary == rhs.ancillary)||((this.ancillary!= null)&&this.ancillary.equals(rhs.ancillary))))&&((this.adjunct == rhs.adjunct)||((this.adjunct!= null)&&this.adjunct.equals(rhs.adjunct))))&&((this.status == rhs.status)||((this.status!= null)&&this.status.equals(rhs.status)))); + return (((((((((((((this.ref == rhs.ref)||((this.ref!= null)&&this.ref.equals(rhs.ref)))&&((this.possible_values == rhs.possible_values)||((this.possible_values!= null)&&this.possible_values.equals(rhs.possible_values))))&&((this.name == rhs.name)||((this.name!= null)&&this.name.equals(rhs.name))))&&((this.description == rhs.description)||((this.description!= null)&&this.description.equals(rhs.description))))&&((this.units == rhs.units)||((this.units!= null)&&this.units.equals(rhs.units))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.ancillary == rhs.ancillary)||((this.ancillary!= null)&&this.ancillary.equals(rhs.ancillary))))&&((this.adjunct == rhs.adjunct)||((this.adjunct!= null)&&this.adjunct.equals(rhs.adjunct))))&&((this.point == rhs.point)||((this.point!= null)&&this.point.equals(rhs.point))))&&((this.structure == rhs.structure)||((this.structure!= null)&&this.structure.equals(rhs.structure))))&&((this.writable == rhs.writable)||((this.writable!= null)&&this.writable.equals(rhs.writable))))&&((this.status == rhs.status)||((this.status!= null)&&this.status.equals(rhs.status)))); } } diff --git a/gencode/java/udmi/schema/SiteLinks.java b/gencode/java/udmi/schema/SiteLinks.java index 41fc94ca6..3f3527402 100644 --- a/gencode/java/udmi/schema/SiteLinks.java +++ b/gencode/java/udmi/schema/SiteLinks.java @@ -71,11 +71,11 @@ public class SiteLinks { public int hashCode() { int result = 1; result = ((result* 31)+((this.image == null)? 0 :this.image.hashCode())); + result = ((result* 31)+((this.sheet == null)? 0 :this.sheet.hashCode())); result = ((result* 31)+((this.folder == null)? 0 :this.folder.hashCode())); result = ((result* 31)+((this.docs == null)? 0 :this.docs.hashCode())); - result = ((result* 31)+((this.repo == null)? 0 :this.repo.hashCode())); - result = ((result* 31)+((this.sheet == null)? 0 :this.sheet.hashCode())); result = ((result* 31)+((this.dashboard == null)? 0 :this.dashboard.hashCode())); + result = ((result* 31)+((this.repo == null)? 0 :this.repo.hashCode())); return result; } @@ -88,7 +88,7 @@ public boolean equals(Object other) { return false; } SiteLinks rhs = ((SiteLinks) other); - return (((((((this.image == rhs.image)||((this.image!= null)&&this.image.equals(rhs.image)))&&((this.folder == rhs.folder)||((this.folder!= null)&&this.folder.equals(rhs.folder))))&&((this.docs == rhs.docs)||((this.docs!= null)&&this.docs.equals(rhs.docs))))&&((this.repo == rhs.repo)||((this.repo!= null)&&this.repo.equals(rhs.repo))))&&((this.sheet == rhs.sheet)||((this.sheet!= null)&&this.sheet.equals(rhs.sheet))))&&((this.dashboard == rhs.dashboard)||((this.dashboard!= null)&&this.dashboard.equals(rhs.dashboard)))); + return (((((((this.image == rhs.image)||((this.image!= null)&&this.image.equals(rhs.image)))&&((this.sheet == rhs.sheet)||((this.sheet!= null)&&this.sheet.equals(rhs.sheet))))&&((this.folder == rhs.folder)||((this.folder!= null)&&this.folder.equals(rhs.folder))))&&((this.docs == rhs.docs)||((this.docs!= null)&&this.docs.equals(rhs.docs))))&&((this.dashboard == rhs.dashboard)||((this.dashboard!= null)&&this.dashboard.equals(rhs.dashboard))))&&((this.repo == rhs.repo)||((this.repo!= null)&&this.repo.equals(rhs.repo)))); } } diff --git a/gencode/java/udmi/schema/SiteLocation.java b/gencode/java/udmi/schema/SiteLocation.java index 1318d4e57..c49ba5728 100644 --- a/gencode/java/udmi/schema/SiteLocation.java +++ b/gencode/java/udmi/schema/SiteLocation.java @@ -46,9 +46,9 @@ public class SiteLocation { @Override public int hashCode() { int result = 1; - result = ((result* 31)+((this.address == null)? 0 :this.address.hashCode())); result = ((result* 31)+((this.lat == null)? 0 :this.lat.hashCode())); result = ((result* 31)+((this._long == null)? 0 :this._long.hashCode())); + result = ((result* 31)+((this.address == null)? 0 :this.address.hashCode())); return result; } @@ -61,7 +61,7 @@ public boolean equals(Object other) { return false; } SiteLocation rhs = ((SiteLocation) other); - return ((((this.address == rhs.address)||((this.address!= null)&&this.address.equals(rhs.address)))&&((this.lat == rhs.lat)||((this.lat!= null)&&this.lat.equals(rhs.lat))))&&((this._long == rhs._long)||((this._long!= null)&&this._long.equals(rhs._long)))); + return ((((this.lat == rhs.lat)||((this.lat!= null)&&this.lat.equals(rhs.lat)))&&((this._long == rhs._long)||((this._long!= null)&&this._long.equals(rhs._long))))&&((this.address == rhs.address)||((this.address!= null)&&this.address.equals(rhs.address)))); } } diff --git a/gencode/python/udmi/schema/common.py b/gencode/python/udmi/schema/common.py index c19a1db01..d1a54b0e2 100644 --- a/gencode/python/udmi/schema/common.py +++ b/gencode/python/udmi/schema/common.py @@ -8,6 +8,7 @@ class Common: SystemMode = SystemMode ProtocolFamily = ProtocolFamily IotProvider = IotProvider + ModelOperation = ModelOperation FeatureStage = FeatureStage BlobPhase = BlobPhase SystemBlobsets = SystemBlobsets diff --git a/gencode/python/udmi/schema/metadata.py b/gencode/python/udmi/schema/metadata.py index 7ae489d74..57ea6c507 100644 --- a/gencode/python/udmi/schema/metadata.py +++ b/gencode/python/udmi/schema/metadata.py @@ -18,6 +18,7 @@ def __init__(self): self.version = None self.upgraded_from = None self.hash = None + self.operation = None self.cloud = None self.system = None self.gateway = None @@ -37,6 +38,7 @@ def from_dict(source): result.version = source.get('version') result.upgraded_from = source.get('upgraded_from') result.hash = source.get('hash') + result.operation = source.get('operation') result.cloud = CloudModel.from_dict(source.get('cloud')) result.system = SystemModel.from_dict(source.get('system')) result.gateway = GatewayModel.from_dict(source.get('gateway')) @@ -74,6 +76,8 @@ def to_dict(self): result['upgraded_from'] = self.upgraded_from # 5 if self.hash: result['hash'] = self.hash # 5 + if self.operation: + result['operation'] = self.operation # 5 if self.cloud: result['cloud'] = self.cloud.to_dict() # 4 if self.system: diff --git a/schema/common.json b/schema/common.json index 0a61b2d59..04de8ec22 100644 --- a/schema/common.json +++ b/schema/common.json @@ -48,6 +48,24 @@ "clearblade" ] }, + "operation": { + "title": "Model Operation", + "enum": [ + "ERROR", + "CREATE", + "READ", + "REPLY", + "UPDATE", + "DELETE", + "MODIFY", + "PREVIEW", + "BIND", + "UNBIND", + "BOUND", + "ALLOW", + "BLOCK" + ] + }, "stage": { "title": "FeatureStage", "description": "Stage of a feature implemenation", diff --git a/schema/metadata.json b/schema/metadata.json index 9d72e518a..fae43d890 100644 --- a/schema/metadata.json +++ b/schema/metadata.json @@ -31,6 +31,10 @@ "type": "string", "pattern": "^[0-9a-z]{8}$" }, + "operation": { + "description": "Used for model update operations (so not a model proper), e.g. DELETE or BIND operations", + "$ref": "file:common.json#/definitions/operation" + }, "cloud": { "$ref": "file:model_cloud.json#" }, diff --git a/schema/model_cloud.json b/schema/model_cloud.json index 211348c0f..d699d3122 100644 --- a/schema/model_cloud.json +++ b/schema/model_cloud.json @@ -109,21 +109,7 @@ "type": "string" }, "operation": { - "enum": [ - "ERROR", - "CREATE", - "READ", - "REPLY", - "UPDATE", - "DELETE", - "MODIFY", - "PREVIEW", - "BIND", - "UNBIND", - "BOUND", - "ALLOW", - "BLOCK" - ] + "$ref": "file:common.json#/definitions/operation" }, "metadata": { "type": "object", diff --git a/tests/sites/downgrade/devices/DWN-2/expected/errors.map b/tests/sites/downgrade/devices/DWN-2/expected/errors.map index dc89501ed..2c430d233 100644 --- a/tests/sites/downgrade/devices/DWN-2/expected/errors.map +++ b/tests/sites/downgrade/devices/DWN-2/expected/errors.map @@ -2,4 +2,4 @@ Exceptions for DWN-2 While loading device metadata for DWN-2 While converting strict to udmi.schema.Metadata While converting string/string to udmi.schema.Metadata - Unrecognized field "grumpy" (class udmi.schema.Metadata), not marked as ignorable (13 known properties: "upgraded_from", "gateway", "hash", "system", "discovery", "localnet", "structure", "cloud", "timestamp", "version", "features", "testing", "pointset"]) at [Source: (String)"{ "cloud" : { "auth_type" : "RS256" }, "grumpy" : { "reason" : "This is an intentional schema violation to test the tools" }, "hash" : "da852d15", "localnet" : { "families" : { "vendor" : { "addr" : "0x65" } } }, "pointset" : { "exclude_units_from_config" : true, "points" : { "filter_alarm_pressure_status" : { "ref" : "BV11.present_value", "units" : "No-units" }, "filter_differential_pressure" : { "[truncated 667 chars]; line: 5, column: 15] (through reference chain: udmi.schema.Metadata["grumpy"]) + Unrecognized field "grumpy" (class udmi.schema.Metadata), not marked as ignorable (14 known properties: "upgraded_from", "gateway", "operation", "hash", "system", "discovery", "localnet", "structure", "cloud", "timestamp", "version", "features", "testing", "pointset"]) at [Source: (String)"{ "cloud" : { "auth_type" : "RS256" }, "grumpy" : { "reason" : "This is an intentional schema violation to test the tools" }, "hash" : "da852d15", "localnet" : { "families" : { "vendor" : { "addr" : "0x65" } } }, "pointset" : { "exclude_units_from_config" : true, "points" : { "filter_alarm_pressure_status" : { "ref" : "BV11.present_value", "units" : "No-units" }, "filter_differential_pressure" : { "[truncated 667 chars]; line: 5, column: 15] (through reference chain: udmi.schema.Metadata["grumpy"]) diff --git a/udmis/src/main/java/com/google/bos/udmi/service/access/ClearBladeIotAccessProvider.java b/udmis/src/main/java/com/google/bos/udmi/service/access/ClearBladeIotAccessProvider.java index 5ecbac323..56f628586 100644 --- a/udmis/src/main/java/com/google/bos/udmi/service/access/ClearBladeIotAccessProvider.java +++ b/udmis/src/main/java/com/google/bos/udmi/service/access/ClearBladeIotAccessProvider.java @@ -21,11 +21,11 @@ import static java.util.Objects.requireNonNull; import static java.util.Optional.ofNullable; import static java.util.stream.Collectors.toMap; -import static udmi.schema.CloudModel.Operation.BIND; -import static udmi.schema.CloudModel.Operation.BOUND; -import static udmi.schema.CloudModel.Operation.CREATE; -import static udmi.schema.CloudModel.Operation.DELETE; -import static udmi.schema.CloudModel.Operation.UPDATE; +import static udmi.schema.CloudModel.ModelOperation.BIND; +import static udmi.schema.CloudModel.ModelOperation.BOUND; +import static udmi.schema.CloudModel.ModelOperation.CREATE; +import static udmi.schema.CloudModel.ModelOperation.DELETE; +import static udmi.schema.CloudModel.ModelOperation.UPDATE; import static udmi.schema.CloudModel.Resource_type.DEVICE; import static udmi.schema.CloudModel.Resource_type.GATEWAY; import static udmi.schema.CloudModel.Resource_type.REGISTRY; @@ -95,7 +95,7 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import udmi.schema.CloudModel; -import udmi.schema.CloudModel.Operation; +import udmi.schema.CloudModel.ModelOperation; import udmi.schema.CloudModel.Resource_type; import udmi.schema.Credential; import udmi.schema.Credential.Key_format; @@ -288,7 +288,7 @@ private CloudModel blockDevice(String registryId, Device device) { .setUpdateMask(BLOCKED_FIELD_MASK).build(); requireNonNull(deviceManager.updateDevice(request), "Invalid RPC response"); CloudModel cloudModel = new CloudModel(); - cloudModel.operation = Operation.BLOCK; + cloudModel.operation = ModelOperation.BLOCK; cloudModel.num_id = hashedDeviceId(registryId, deviceId); return cloudModel; } catch (Exception e) { @@ -308,7 +308,7 @@ private Device convert(CloudModel cloudModel, String deviceId) { .build(); } - private CloudModel convert(Empty execute, Operation operation) { + private CloudModel convert(Empty execute, ModelOperation operation) { CloudModel cloudModel = new CloudModel(); cloudModel.operation = operation; cloudModel.num_id = EMPTY_RETURN_RECEIPT; @@ -563,7 +563,7 @@ private GatewayModel makeGatewayModel(HashMap boundDevices) public CloudModel modelDevice(String registryId, String deviceId, CloudModel cloudModel, Consumer progress) { String devicePath = getDeviceName(registryId, deviceId); - Operation operation = cloudModel.operation; + ModelOperation operation = cloudModel.operation; Resource_type type = ofNullable(cloudModel.resource_type).orElse(Resource_type.DEVICE); checkState(type == DEVICE || type == GATEWAY, "unexpected resource type " + type); try { @@ -592,7 +592,7 @@ private CloudModel getReply(String registryId, String deviceId, CloudModel reque @Override public CloudModel modelRegistry(String registryId, String deviceId, CloudModel cloudModel) { - Operation operation = cloudModel.operation; + ModelOperation operation = cloudModel.operation; String registryActual = registryId + deviceId; try { if (operation == UPDATE) { @@ -623,7 +623,7 @@ private CloudModel modifyDevice(String registryId, Device device) { model.metadata.putAll(builder.getMetadata()); builder.setMetadata(model.metadata); CloudModel cloudModel = updateDevice(registryId, builder.build(), METADATA_FIELD_MASK); - cloudModel.operation = Operation.MODIFY; + cloudModel.operation = ModelOperation.MODIFY; cloudModel.gateway = model.gateway; cloudModel.device_ids = model.device_ids; return cloudModel; @@ -805,7 +805,7 @@ public CloudModel fetchDevice(String registryId, String deviceId) { Device device = deviceManager.getDevice(request); requireNonNull(device, "GetDeviceRequest failed"); CloudModel cloudModel = convertFull(device); - cloudModel.operation = Operation.READ; + cloudModel.operation = ModelOperation.READ; cloudModel.gateway = fetchDeviceGatewayModel(registryId, deviceId, device); return cloudModel; } catch (Exception e) { diff --git a/udmis/src/main/java/com/google/bos/udmi/service/access/ImplicitIotAccessProvider.java b/udmis/src/main/java/com/google/bos/udmi/service/access/ImplicitIotAccessProvider.java index b37cc6a94..060773d30 100644 --- a/udmis/src/main/java/com/google/bos/udmi/service/access/ImplicitIotAccessProvider.java +++ b/udmis/src/main/java/com/google/bos/udmi/service/access/ImplicitIotAccessProvider.java @@ -21,8 +21,8 @@ import static java.util.Objects.requireNonNull; import static java.util.Optional.ofNullable; import static java.util.function.Predicate.not; -import static udmi.schema.CloudModel.Operation.DELETE; -import static udmi.schema.CloudModel.Operation.READ; +import static udmi.schema.CloudModel.ModelOperation.DELETE; +import static udmi.schema.CloudModel.ModelOperation.READ; import static udmi.schema.CloudModel.Resource_type.DEVICE; import static udmi.schema.CloudModel.Resource_type.GATEWAY; @@ -51,7 +51,7 @@ import java.util.function.Consumer; import java.util.stream.Collectors; import udmi.schema.CloudModel; -import udmi.schema.CloudModel.Operation; +import udmi.schema.CloudModel.ModelOperation; import udmi.schema.CloudModel.Resource_type; import udmi.schema.Credential; import udmi.schema.Credential.Key_format; @@ -327,7 +327,7 @@ private Map listBoundDevices(String registryId, String gatew @Override public CloudModel modelDevice(String registryId, String deviceId, CloudModel cloudModel, Consumer progress) { - Operation operation = cloudModel.operation; + ModelOperation operation = cloudModel.operation; Resource_type type = ofNullable(cloudModel.resource_type).orElse(Resource_type.DEVICE); checkState(type == DEVICE || type == GATEWAY, "unexpected resource type " + type); try { @@ -350,7 +350,7 @@ public CloudModel modelDevice(String registryId, String deviceId, CloudModel clo @Override public CloudModel modelRegistry(String registryId, String deviceId, CloudModel cloudModel) { - Operation operation = cloudModel.operation; + ModelOperation operation = cloudModel.operation; try { // TODO: Make this update the saved metadata for the registry. return getReply(registryId, deviceId, cloudModel, "registry"); diff --git a/udmis/src/main/java/com/google/bos/udmi/service/core/ProvisioningEngine.java b/udmis/src/main/java/com/google/bos/udmi/service/core/ProvisioningEngine.java index d95afd631..988d6f693 100644 --- a/udmis/src/main/java/com/google/bos/udmi/service/core/ProvisioningEngine.java +++ b/udmis/src/main/java/com/google/bos/udmi/service/core/ProvisioningEngine.java @@ -15,7 +15,7 @@ import static com.google.udmi.util.MetadataMapKeys.UDMI_UPDATED; import static java.lang.String.format; import static java.util.Objects.requireNonNull; -import static udmi.schema.CloudModel.Operation.BIND; +import static udmi.schema.CloudModel.ModelOperation.BIND; import java.util.Date; import java.util.HashMap; @@ -26,7 +26,7 @@ import java.util.function.Consumer; import java.util.function.Supplier; import udmi.schema.CloudModel; -import udmi.schema.CloudModel.Operation; +import udmi.schema.CloudModel.ModelOperation; import udmi.schema.CloudModel.Resource_type; import udmi.schema.DiscoveryEvents; import udmi.schema.EndpointConfiguration; @@ -58,7 +58,7 @@ private void bindDeviceToGateway(String registryId, String proxyId, String gatew private void createDeviceEntry(String registryId, String expectedId, String gatewayId, Envelope envelope, DiscoveryEvents discoveryEvent) { CloudModel cloudModel = new CloudModel(); - cloudModel.operation = Operation.CREATE; + cloudModel.operation = ModelOperation.CREATE; cloudModel.blocked = true; ifNullThen(cloudModel.metadata, () -> cloudModel.metadata = new HashMap<>()); cloudModel.metadata.put(UDMI_DISCOVERED_FROM, stringifyTerse(envelope)); diff --git a/udmis/src/main/java/com/google/bos/udmi/service/core/ReflectProcessor.java b/udmis/src/main/java/com/google/bos/udmi/service/core/ReflectProcessor.java index 23e3a3b64..4e9360e51 100644 --- a/udmis/src/main/java/com/google/bos/udmi/service/core/ReflectProcessor.java +++ b/udmis/src/main/java/com/google/bos/udmi/service/core/ReflectProcessor.java @@ -38,8 +38,8 @@ import static java.lang.String.format; import static java.util.Objects.requireNonNull; import static java.util.Optional.ofNullable; -import static udmi.schema.CloudModel.Operation.PREVIEW; -import static udmi.schema.CloudModel.Operation.READ; +import static udmi.schema.CloudModel.ModelOperation.PREVIEW; +import static udmi.schema.CloudModel.ModelOperation.READ; import static udmi.schema.CloudModel.Resource_type.REGISTRY; import static udmi.schema.Envelope.SubFolder.UPDATE; import static udmi.schema.IotAccess.IotProvider.IMPLICIT; @@ -59,7 +59,7 @@ import java.util.Objects; import java.util.stream.Collectors; import udmi.schema.CloudModel; -import udmi.schema.CloudModel.Operation; +import udmi.schema.CloudModel.ModelOperation; import udmi.schema.EndpointConfiguration; import udmi.schema.Entry; import udmi.schema.Envelope; @@ -323,7 +323,7 @@ private Envelope makeTargetEnvelope(Envelope attributes) { private ModelUpdate asModelUpdate(CloudModel request) { ModelUpdate modelUpdate = new ModelUpdate(); - modelUpdate.cloud = request; + modelUpdate.operation = request.operation; return modelUpdate; } @@ -342,7 +342,7 @@ private ModelUpdate asModelUpdate(String modelString) { private CloudModel reflectProcess(Envelope attributes, Object payload) { CloudModel reply = new CloudModel(); - reply.operation = Operation.REPLY; + reply.operation = ModelOperation.REPLY; if (payload == null) { return reply; } diff --git a/udmis/src/test/java/com/google/bos/udmi/service/core/ProvisioningEngineTest.java b/udmis/src/test/java/com/google/bos/udmi/service/core/ProvisioningEngineTest.java index fa18ec1bd..66e722a87 100644 --- a/udmis/src/test/java/com/google/bos/udmi/service/core/ProvisioningEngineTest.java +++ b/udmis/src/test/java/com/google/bos/udmi/service/core/ProvisioningEngineTest.java @@ -29,7 +29,7 @@ import org.mockito.ArgumentCaptor; import udmi.lib.ProtocolFamily; import udmi.schema.CloudModel; -import udmi.schema.CloudModel.Operation; +import udmi.schema.CloudModel.ModelOperation; import udmi.schema.CloudModel.Resource_type; import udmi.schema.DiscoveryEvents; import udmi.schema.Envelope; @@ -131,11 +131,11 @@ public void discoveryEventCreate() { List models = modelCaptor.getAllValues(); assertEquals(DISCOVERED_DEVICE, devices.get(0), "created device id"); - assertEquals(Operation.CREATE, models.get(0).operation, "operation mismatch"); + assertEquals(ModelOperation.CREATE, models.get(0).operation, "operation mismatch"); assertTrue(models.get(0).blocked, "device blocked"); assertEquals(TEST_GATEWAY, devices.get(1), "scanning gateway id"); - assertEquals(Operation.BIND, models.get(1).operation, "operation mismatch"); + assertEquals(ModelOperation.BIND, models.get(1).operation, "operation mismatch"); assertNotNull(models.get(1).device_ids.get(DISCOVERED_DEVICE), "binding device entry"); } diff --git a/udmis/src/test/java/com/google/bos/udmi/service/core/ReflectProcessorTest.java b/udmis/src/test/java/com/google/bos/udmi/service/core/ReflectProcessorTest.java index 1aae699ff..5e570aad8 100644 --- a/udmis/src/test/java/com/google/bos/udmi/service/core/ReflectProcessorTest.java +++ b/udmis/src/test/java/com/google/bos/udmi/service/core/ReflectProcessorTest.java @@ -29,7 +29,7 @@ import org.junit.jupiter.api.Test; import org.mockito.ArgumentCaptor; import udmi.schema.CloudModel; -import udmi.schema.CloudModel.Operation; +import udmi.schema.CloudModel.ModelOperation; import udmi.schema.CloudModel.Resource_type; import udmi.schema.Envelope; import udmi.schema.Envelope.SubFolder; @@ -152,12 +152,12 @@ public void invalidInitExchange() { @Test public void modelDeviceTest() { CloudModel returnModel = new CloudModel(); - returnModel.operation = Operation.CREATE; + returnModel.operation = ModelOperation.CREATE; returnModel.resource_type = Resource_type.DEVICE; when(provider.modelDevice(anyString(), anyString(), notNull(), any())).thenReturn(returnModel); CloudModel requestModel = new CloudModel(); - requestModel.operation = Operation.BIND; + requestModel.operation = ModelOperation.BIND; requestModel.resource_type = Resource_type.DEVICE; activeTestInstance(() -> getReverseDispatcher().publish(makeModelBundle(requestModel))); verify(provider, times(1)).modelDevice(eq(TEST_REGISTRY), eq(TEST_DEVICE), @@ -173,7 +173,7 @@ public void modelDeviceTest() { @Test public void modelRegistryUpdateTest() { CloudModel requestModel = new CloudModel(); - requestModel.operation = Operation.UPDATE; + requestModel.operation = ModelOperation.UPDATE; requestModel.resource_type = Resource_type.REGISTRY; activeTestInstance(() -> getReverseDispatcher().publish(makeModelBundle(requestModel))); verify(provider, times(1)).modelRegistry(eq(TEST_REGISTRY), any(), diff --git a/udmis/udmis.iml b/udmis/udmis.iml index 057b2445b..8d2fbc680 100644 --- a/udmis/udmis.iml +++ b/udmis/udmis.iml @@ -26,9 +26,12 @@ + + + @@ -47,12 +50,15 @@ + + + @@ -61,10 +67,12 @@ - - - + + + + + @@ -72,7 +80,12 @@ + + + + + @@ -98,8 +111,13 @@ + + + + + diff --git a/validator/src/main/java/com/google/daq/mqtt/mapping/MappingAgent.java b/validator/src/main/java/com/google/daq/mqtt/mapping/MappingAgent.java index 6cedd79a7..6840e07e9 100644 --- a/validator/src/main/java/com/google/daq/mqtt/mapping/MappingAgent.java +++ b/validator/src/main/java/com/google/daq/mqtt/mapping/MappingAgent.java @@ -34,7 +34,7 @@ import java.util.Map.Entry; import java.util.Set; import udmi.schema.CloudModel; -import udmi.schema.CloudModel.Operation; +import udmi.schema.CloudModel.ModelOperation; import udmi.schema.DiscoveryConfig; import udmi.schema.DiscoveryEvents; import udmi.schema.Enumerations.Depth; @@ -108,7 +108,7 @@ void process(List argsList) { private void setupProvision() { CloudModel cloudModel = new CloudModel(); cloudModel.metadata = ImmutableMap.of(UDMI_PROVISION_ENABLE, "true"); - cloudIotManager.updateDevice(deviceId, cloudModel, Operation.MODIFY); + cloudIotManager.updateDevice(deviceId, cloudModel, ModelOperation.MODIFY); } private void initiateDiscover() { @@ -120,7 +120,7 @@ private void initiateDiscover() { String generation = isoConvert(generationDate); CloudModel cloudModel = new CloudModel(); cloudModel.metadata = ImmutableMap.of(UDMI_PROVISION_GENERATION, generation); - cloudIotManager.updateDevice(deviceId, cloudModel, Operation.MODIFY); + cloudIotManager.updateDevice(deviceId, cloudModel, ModelOperation.MODIFY); System.err.printf("Initiating %s discovery on %s/%s at %s%n", families, siteModel.getRegistryId(), deviceId, generation); diff --git a/validator/src/main/java/com/google/daq/mqtt/registrar/Registrar.java b/validator/src/main/java/com/google/daq/mqtt/registrar/Registrar.java index 217381d63..c061d0f63 100644 --- a/validator/src/main/java/com/google/daq/mqtt/registrar/Registrar.java +++ b/validator/src/main/java/com/google/daq/mqtt/registrar/Registrar.java @@ -102,7 +102,7 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.VisibleForTesting; import udmi.schema.CloudModel; -import udmi.schema.CloudModel.Operation; +import udmi.schema.CloudModel.ModelOperation; import udmi.schema.CloudModel.Resource_type; import udmi.schema.Credential; import udmi.schema.Envelope.SubFolder; @@ -348,7 +348,7 @@ protected Map getWorkingDevices() { private void processSiteMetadata() { ifTrueThen(updateCloudIoT, - () -> cloudIotManager.updateRegistry(getSiteMetadata(), Operation.UPDATE)); + () -> cloudIotManager.updateRegistry(getSiteMetadata(), ModelOperation.UPDATE)); } private SiteMetadata getSiteMetadata() { @@ -755,7 +755,7 @@ private void deleteDevice(Set allDevices, String deviceId) { */ private void unbindDevicesFromGateways(Set allDevices, Set boundGateways) { boundGateways.forEach(gatewayId -> { - synchronized (Operation.UNBIND) { + synchronized (ModelOperation.UNBIND) { Map boundDevices = cloudIotManager.fetchDevice(gatewayId).device_ids; Set toUnbind = new HashSet<>(intersection(allDevices, boundDevices.keySet())); System.err.printf("Unbinding from gateway %s: %s%n", gatewayId, setOrSize(toUnbind)); @@ -930,9 +930,10 @@ private CloudModel processExtra(String extraName, AtomicInteger alreadyBlocked) cloudIotManager.blockDevice(extraName, true); cloudModel.blocked = true; } - cloudModel.operation = ifTrueGet(cloudModel.blocked, Operation.BLOCK, Operation.ALLOW); + cloudModel.operation = ifTrueGet(cloudModel.blocked, ModelOperation.BLOCK, + ModelOperation.ALLOW); } catch (Exception e) { - cloudModel.operation = Operation.ERROR; + cloudModel.operation = ModelOperation.ERROR; cloudModel.detail = friendlyStackTrace(e); System.err.printf("Blocking device %s: %s%n", extraName, cloudModel.detail); } @@ -1264,7 +1265,7 @@ private void previewModels(Map localDevices) { return; } - cloudIotManager.updateRegistry(getSiteMetadata(), Operation.PREVIEW); + cloudIotManager.updateRegistry(getSiteMetadata(), ModelOperation.PREVIEW); try { AtomicInteger previewCount = new AtomicInteger(); @@ -1273,7 +1274,7 @@ private void previewModels(Map localDevices) { ifTrueThen(baseCount % 100 == 0, () -> System.err.printf("Sending preview for device %d/%d...%n", baseCount + 1, localDevices.size())); - cloudIotManager.updateDevice(id, device.getSettings(), Operation.PREVIEW); + cloudIotManager.updateDevice(id, device.getSettings(), ModelOperation.PREVIEW); })); dynamicTerminate(localDevices.size()); System.err.printf("Finished sending device preview for %d devices.%n", localDevices.size()); diff --git a/validator/src/main/java/com/google/daq/mqtt/registrar/Summarizer.java b/validator/src/main/java/com/google/daq/mqtt/registrar/Summarizer.java index 56e8b42d3..31976262e 100644 --- a/validator/src/main/java/com/google/daq/mqtt/registrar/Summarizer.java +++ b/validator/src/main/java/com/google/daq/mqtt/registrar/Summarizer.java @@ -17,7 +17,7 @@ import java.util.Set; import java.util.TreeSet; import udmi.schema.CloudModel; -import udmi.schema.CloudModel.Operation; +import udmi.schema.CloudModel.ModelOperation; abstract class Summarizer { @@ -77,14 +77,14 @@ public void summarize(Map localDevices, Map private void correlateModels(LocalDevice localDevice, CloudModel cloudModel) { if (localDevice != null && cloudModel != null && localDevice.hasErrors()) { - cloudModel.operation = Operation.ERROR; + cloudModel.operation = ModelOperation.ERROR; } } private Map extractDeviceRow(CloudModel cloudModel) { return ImmutableMap.of( NUM_ID_HEADER, ofNullable(cloudModel.num_id).orElse(UNKNOWN_NUM_ID), - STATUS_HEADER, ofNullable(cloudModel.operation).orElse(Operation.READ).toString(), + STATUS_HEADER, ofNullable(cloudModel.operation).orElse(ModelOperation.READ).toString(), ACTIVE_HEADER, JsonUtil.isoConvert(cloudModel.last_event_time), DETAIL_HEADER, ofNullable(cloudModel.detail).orElse(NO_DETAIL)); } diff --git a/validator/src/main/java/com/google/daq/mqtt/sequencer/SequenceBase.java b/validator/src/main/java/com/google/daq/mqtt/sequencer/SequenceBase.java index e1c435ae8..7db160e58 100644 --- a/validator/src/main/java/com/google/daq/mqtt/sequencer/SequenceBase.java +++ b/validator/src/main/java/com/google/daq/mqtt/sequencer/SequenceBase.java @@ -60,7 +60,7 @@ import static udmi.schema.Category.VALIDATION_FEATURE_CAPABILITY; import static udmi.schema.Category.VALIDATION_FEATURE_SCHEMA; import static udmi.schema.Category.VALIDATION_FEATURE_SEQUENCE; -import static udmi.schema.CloudModel.Operation.REPLY; +import static udmi.schema.CloudModel.ModelOperation.REPLY; import static udmi.schema.Envelope.SubFolder.UPDATE; import static udmi.schema.FeatureDiscovery.FeatureStage.ALPHA; import static udmi.schema.FeatureDiscovery.FeatureStage.PREVIEW; diff --git a/validator/src/main/java/com/google/daq/mqtt/util/CloudIotManager.java b/validator/src/main/java/com/google/daq/mqtt/util/CloudIotManager.java index 8ce5817ad..abb557e29 100644 --- a/validator/src/main/java/com/google/daq/mqtt/util/CloudIotManager.java +++ b/validator/src/main/java/com/google/daq/mqtt/util/CloudIotManager.java @@ -30,7 +30,7 @@ import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import udmi.schema.CloudModel; -import udmi.schema.CloudModel.Operation; +import udmi.schema.CloudModel.ModelOperation; import udmi.schema.CloudModel.Resource_type; import udmi.schema.Credential; import udmi.schema.Credential.Key_format; @@ -311,18 +311,19 @@ private void createDevice(String deviceId, CloudDeviceSettings settings) { deviceMap.put(deviceId, newDevice); } - public void updateDevice(String deviceId, CloudDeviceSettings settings, Operation operation) { + public void updateDevice(String deviceId, CloudDeviceSettings settings, + ModelOperation operation) { updateDevice(deviceId, makeDevice(settings, null), operation); } public void updateDevice(String deviceId, CloudDeviceSettings settings, CloudModel oldDevice) { - updateDevice(deviceId, makeDevice(settings, oldDevice), Operation.UPDATE); + updateDevice(deviceId, makeDevice(settings, oldDevice), ModelOperation.UPDATE); } /** * Update a device using the given operation parameter. */ - public void updateDevice(String deviceId, CloudModel device, Operation operation) { + public void updateDevice(String deviceId, CloudModel device, ModelOperation operation) { limitValueSizes(device.metadata); device.operation = operation; getIotProvider().updateDevice(deviceId, device); @@ -440,7 +441,7 @@ public String createRegistry(String suffix) { /** * Update the cloud site metadata for the current registry. */ - public void updateRegistry(SiteMetadata siteMetadata, Operation operation) { + public void updateRegistry(SiteMetadata siteMetadata, ModelOperation operation) { CloudModel registryModel = new CloudModel(); registryModel.resource_type = Resource_type.REGISTRY; registryModel.operation = operation; diff --git a/validator/src/main/java/com/google/daq/mqtt/util/IotMockProvider.java b/validator/src/main/java/com/google/daq/mqtt/util/IotMockProvider.java index e5180ab9a..6c755b7c8 100644 --- a/validator/src/main/java/com/google/daq/mqtt/util/IotMockProvider.java +++ b/validator/src/main/java/com/google/daq/mqtt/util/IotMockProvider.java @@ -22,7 +22,7 @@ import java.util.Set; import java.util.stream.Collectors; import udmi.schema.CloudModel; -import udmi.schema.CloudModel.Operation; +import udmi.schema.CloudModel.ModelOperation; import udmi.schema.Envelope.SubFolder; import udmi.schema.ExecutionConfiguration; import udmi.schema.Metadata; @@ -127,7 +127,7 @@ public void bindGatewayDevices(String gatewayDeviceId, Set proxyDeviceId checkArgument(cloudDevices.containsKey(gatewayDeviceId), "missing gateway device"); checkArgument(populateCloudModel(gatewayDeviceId).resource_type == GATEWAY, "not a gateway"); mockAction(BIND_DEVICE_ACTION, proxyDeviceId, gatewayDeviceId, - (toBind ? Operation.BIND : Operation.UNBIND).value()); + (toBind ? ModelOperation.BIND : ModelOperation.UNBIND).value()); }); } diff --git a/validator/src/main/java/com/google/daq/mqtt/util/IotReflectorClient.java b/validator/src/main/java/com/google/daq/mqtt/util/IotReflectorClient.java index d6a4ed70e..91bb9657d 100644 --- a/validator/src/main/java/com/google/daq/mqtt/util/IotReflectorClient.java +++ b/validator/src/main/java/com/google/daq/mqtt/util/IotReflectorClient.java @@ -16,12 +16,12 @@ import static com.google.udmi.util.JsonUtil.stringifyTerse; import static java.lang.String.format; import static java.util.Optional.ofNullable; -import static udmi.schema.CloudModel.Operation.BIND; -import static udmi.schema.CloudModel.Operation.BLOCK; -import static udmi.schema.CloudModel.Operation.BOUND; -import static udmi.schema.CloudModel.Operation.DELETE; -import static udmi.schema.CloudModel.Operation.READ; -import static udmi.schema.CloudModel.Operation.UNBIND; +import static udmi.schema.CloudModel.ModelOperation.BIND; +import static udmi.schema.CloudModel.ModelOperation.BLOCK; +import static udmi.schema.CloudModel.ModelOperation.BOUND; +import static udmi.schema.CloudModel.ModelOperation.DELETE; +import static udmi.schema.CloudModel.ModelOperation.READ; +import static udmi.schema.CloudModel.ModelOperation.UNBIND; import com.google.common.base.Preconditions; import com.google.daq.mqtt.util.MessagePublisher.QuerySpeed; @@ -39,7 +39,7 @@ import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; import udmi.schema.CloudModel; -import udmi.schema.CloudModel.Operation; +import udmi.schema.CloudModel.ModelOperation; import udmi.schema.Credential; import udmi.schema.Envelope.SubFolder; import udmi.schema.ExecutionConfiguration; @@ -117,19 +117,19 @@ public void setBlocked(String deviceId, boolean blocked) { @Override public void updateDevice(String deviceId, CloudModel device) { - device.operation = ofNullable(device.operation).orElse(Operation.UPDATE); + device.operation = ofNullable(device.operation).orElse(ModelOperation.UPDATE); cloudModelTransaction(deviceId, CLOUD_MODEL_TOPIC, device); } @Override public void updateRegistry(CloudModel registry) { - registry.operation = ofNullable(registry.operation).orElse(Operation.UPDATE); + registry.operation = ofNullable(registry.operation).orElse(ModelOperation.UPDATE); cloudModelTransaction(null, CLOUD_MODEL_TOPIC, registry); } @Override public void createResource(String deviceId, CloudModel makeDevice) { - makeDevice.operation = Operation.CREATE; + makeDevice.operation = ModelOperation.CREATE; CloudModel created = cloudModelTransaction(deviceId, CLOUD_MODEL_TOPIC, makeDevice); ifNotNullThen(makeDevice.num_id, () -> ifTrueThen(!makeDevice.num_id.equals(created.num_id), () -> System.err.printf("created num_id %s does not match expected %s%n", created.num_id, @@ -140,7 +140,7 @@ public void createResource(String deviceId, CloudModel makeDevice) { @Override public void deleteDevice(String deviceId, Set unbindIds) { CloudModel deleteModel = new CloudModel(); - deleteModel.operation = Operation.DELETE; + deleteModel.operation = ModelOperation.DELETE; deleteModel.gateway = ifNotNullGet(unbindIds, this::proxyGatewayModel); cloudModelTransaction(deviceId, CLOUD_MODEL_TOPIC, deleteModel); } @@ -152,12 +152,12 @@ private GatewayModel proxyGatewayModel(Set unbindIds) { } private CloudModel cloudModelTransaction(String deviceId, String topic, CloudModel model) { - Operation operation = Preconditions.checkNotNull(model.operation, "no operation"); + ModelOperation operation = Preconditions.checkNotNull(model.operation, "no operation"); model.functions_ver = TOOLS_FUNCTIONS_VERSION; Map message = transaction(deviceId, topic, stringify(model), QuerySpeed.LONG); CloudModel cloudModel = convertTo(CloudModel.class, message); String cloudNumId = ifNotNullGet(cloudModel, result -> result.num_id); - Operation cloudOperation = ifNotNullGet(cloudModel, result -> result.operation); + ModelOperation cloudOperation = ifNotNullGet(cloudModel, result -> result.operation); // This happens with devices are bound to gateways, so explicitly capture the relevant info. if (operation == DELETE && cloudOperation == BOUND) { throw new DeviceGatewayBoundException(cloudModel); diff --git a/validator/src/main/java/com/google/daq/mqtt/validator/Validator.java b/validator/src/main/java/com/google/daq/mqtt/validator/Validator.java index 6e2ec1501..98308b1ed 100644 --- a/validator/src/main/java/com/google/daq/mqtt/validator/Validator.java +++ b/validator/src/main/java/com/google/daq/mqtt/validator/Validator.java @@ -110,7 +110,7 @@ import org.apache.commons.io.FileUtils; import org.slf4j.impl.SimpleLogger; import udmi.schema.Category; -import udmi.schema.CloudModel.Operation; +import udmi.schema.CloudModel.ModelOperation; import udmi.schema.DeviceValidationEvents; import udmi.schema.Envelope; import udmi.schema.Envelope.SubFolder; @@ -630,7 +630,7 @@ private boolean handleMetadataUpdate(Map attributes, Object mess requireNonNull(messageObject, "messageObject is null")); ReportingDevice device = reportingDevices.computeIfAbsent(deviceId, this::newReportingDevice); - if (catchToNull(() -> metadata.cloud.operation) == Operation.DELETE) { + if (catchToNull(() -> metadata.cloud.operation) == ModelOperation.DELETE) { reportingDevices.remove(deviceId); } else { ifNotNullThen(metadata.system, () -> { diff --git a/validator/src/test/java/com/google/daq/mqtt/validator/BasicTest.java b/validator/src/test/java/com/google/daq/mqtt/validator/BasicTest.java index 9847295b6..b5a298002 100644 --- a/validator/src/test/java/com/google/daq/mqtt/validator/BasicTest.java +++ b/validator/src/test/java/com/google/daq/mqtt/validator/BasicTest.java @@ -20,7 +20,7 @@ import java.util.Set; import org.junit.Test; import udmi.schema.CloudModel; -import udmi.schema.CloudModel.Operation; +import udmi.schema.CloudModel.ModelOperation; import udmi.schema.Config; import udmi.schema.DeviceValidationEvents; import udmi.schema.DiscoveryEvents; @@ -176,7 +176,7 @@ public void deviceDeleteMetadataUpdate() { messageObject.version = TestCommon.UDMI_VERSION; messageObject.system = new SystemModel(); messageObject.cloud = new CloudModel(); - messageObject.cloud.operation = Operation.DELETE; + messageObject.cloud.operation = ModelOperation.DELETE; MessageBundle messageBundle = getMessageBundle(MODEL_SUBTYPE, UPDATE_SUBFOLDER, messageObject); validator.validateMessage(messageBundle);