From fbbaf3fb69f2e8a1ab50e139f42cd61fbb059cbb Mon Sep 17 00:00:00 2001 From: Trevor Date: Fri, 1 Mar 2024 14:32:12 -0800 Subject: [PATCH] Refactor distributor and add cron capability (#822) --- .gencode_hash.txt | 25 +- .github/workflows/testing.yml | 30 +- bin/sequencer | 3 - bin/sequencer_cache | 3 - bin/start_hivemq | 3 + bin/support_process | 3 + bin/test_regclean | 3 - bin/test_sequencer | 3 - bin/test_validator | 3 - .../com/google/udmi/util/GeneralUtils.java | 4 + gencode/docs/configuration_endpoint.html | 86 +- gencode/docs/configuration_execution.html | 200 +- gencode/docs/configuration_pod.html | 2026 +++++++++++++++-- gencode/docs/configuration_pubber.html | 100 +- gencode/docs/persistent_device.html | 100 +- gencode/docs/query_cloud.html | 108 + gencode/docs/readme.md | 1 + gencode/java/udmi/schema/CloudQuery.java | 61 + .../udmi/schema/EndpointConfiguration.java | 32 +- .../java/udmi/schema/PodConfiguration.java | 6 +- gencode/python/udmi/schema/__init__.py | 1 + .../udmi/schema/configuration_endpoint.py | 16 +- .../python/udmi/schema/configuration_pod.py | 5 + gencode/python/udmi/schema/query_cloud.py | 42 + .../main/java/daq/pubber/PointsetManager.java | 3 +- schema/configuration_endpoint.json | 12 +- schema/configuration_pod.json | 8 + schema/query_cloud.json | 20 + .../UdmiServicePod_ClearBlade.xml | 2 +- udmis/etc/prod_pod.json | 12 +- .../udmi/service/access/IotAccessBase.java | 2 +- .../udmi/service/core/BridgeProcessor.java | 12 + .../udmi/service/core/ControlProcessor.java | 21 + .../google/bos/udmi/service/core/CronJob.java | 69 + .../udmi/service/core/DistributorPipe.java | 80 +- .../bos/udmi/service/core/ProcessorBase.java | 41 +- .../udmi/service/core/ReflectProcessor.java | 11 +- .../bos/udmi/service/core/StateProcessor.java | 5 + .../udmi/service/core/TargetProcessor.java | 5 + .../service/messaging/impl/MessageBase.java | 14 +- .../messaging/impl/MessageDispatcherImpl.java | 44 +- .../service/messaging/impl/PubSubPipe.java | 5 +- .../messaging/impl/SimpleMqttPipe.java | 13 +- .../bos/udmi/service/pod/ContainerBase.java | 88 +- .../bos/udmi/service/pod/UdmiServicePod.java | 27 +- .../udmi/service/core/StateProcessorTest.java | 3 + 46 files changed, 2998 insertions(+), 363 deletions(-) create mode 100755 bin/start_hivemq create mode 100644 gencode/docs/query_cloud.html create mode 100644 gencode/java/udmi/schema/CloudQuery.java create mode 100644 gencode/python/udmi/schema/query_cloud.py create mode 100644 schema/query_cloud.json create mode 100644 udmis/src/main/java/com/google/bos/udmi/service/core/ControlProcessor.java create mode 100644 udmis/src/main/java/com/google/bos/udmi/service/core/CronJob.java diff --git a/.gencode_hash.txt b/.gencode_hash.txt index 1706156d9b..967506a17f 100644 --- a/.gencode_hash.txt +++ b/.gencode_hash.txt @@ -2,10 +2,10 @@ 41c2bc68fc3b8151b6a504c8adfe47d7453b972a38e4e056238241ae12ad2859 gencode/docs/command_mapping.html 81ba8b959b8ac79fe792eef5a4aaf984fcfbe3e7b94987556dd23a329dbaac5b gencode/docs/config.html 22bfb3fd7c0e73dac4cbd830aa7983714917ec6da813f6bf5768ce3aa9786fb2 gencode/docs/config_mapping.html -e9f5572ab03a36aa926b5b0496fc58af03eca92b83271eafa3e2e65f7936f05b gencode/docs/configuration_endpoint.html -4ac793390f9a8e9bb6aa74f72265cd166fe185a426df7589b7bf56a5c409e3fd gencode/docs/configuration_execution.html -f7fc9ba938347df94df71bb3c5fee5aae3626de8eb7f5bdc36357c186b0f7b36 gencode/docs/configuration_pod.html -e8c20a53a51febbeb7da3869b768635cb2030d3c690bf92cdb8516835f750664 gencode/docs/configuration_pubber.html +a626529e7bbcfbe32e734585c342a300b26161afaab4565d6328726bfb1da7c2 gencode/docs/configuration_endpoint.html +2ca2acaca1c68ff641a60873ed18e49416b2fe8419df88902b5eb9c248bb42e5 gencode/docs/configuration_execution.html +b052fb2c7db24f398ade7a490230f40b8db7d3fd1ed06f081ec14998bcadb2de gencode/docs/configuration_pod.html +f8c01f4bf8a8dc13db3458d4f01ebec64c79417e76caa066f8279cd0fb7a062c gencode/docs/configuration_pubber.html 9a4c3876ca5dd7bbbec722a88cfbf99deef5eda23e62404259cad0a3bc242cfd gencode/docs/event.html 06e6f3a4d8de12d11fce0071baff640a9c4dc01d72d537557ed10b08eda4ccab gencode/docs/event_discovery.html 78f655972772f4bee92d88c3a26535612735c794837bfd6f479faeb2e8d8691e gencode/docs/event_mapping.html @@ -14,9 +14,10 @@ f849ebe1085d81fb0f16654b7c9d3d14c59b56b1c75154e100b85398694657fd gencode/docs/e a4a99c4be9483e889c2d0d180d72d2ed332d587ac9305c7615da0e70fd55a56d gencode/docs/event_validation.html 61326830be577c3f594a8e7fb5c7f078be47fbcbef2f222e70d9e64517b12209 gencode/docs/metadata.html 93bfecd5facd0ead4c75a90f350fa715e6fb8bdab71d81b1f3e46994f03c1c2e gencode/docs/monitoring.html -a300dd8e873610121d817385acbd16a75a914766ead0b0d798031d1ca0499ad4 gencode/docs/persistent_device.html +96808a602a71cec03e205466f93e0a27c6bf642d08d70ea80dbe00a5adf61410 gencode/docs/persistent_device.html 5d039d607af9ec75ee552dfe36b16c702687ea16f5663f41fc49b4533b86e00d gencode/docs/properties.html -1766f84518a315fe57e4a4bf934c0a386ad61d87091754a6bab097c686c16019 gencode/docs/readme.md +9b4413e13e835bc4f76d6f74e7a6935eb58255ca95d499256a6ee6c37d3afc49 gencode/docs/query_cloud.html +3ad206c2afce110cdeb0bc5bb13cd959a2d7016ca40caec6fcc544a451469af4 gencode/docs/readme.md 741b880216be3743f6747800a042f2dbd89f3b0344c6b0a965f4bc010f03a930 gencode/docs/schema_doc.css 878ea88206c974f40643c3cc430875f9c4e8c5e3fd6bcd6358bd3eb6d48699a9 gencode/docs/schema_doc.min.js 7ed934930aee763e0beebc349725ba3909115e8d346bb762f28bcbe745bb163a gencode/docs/schema_extras.js @@ -39,6 +40,7 @@ fcbed49f1af8b791d8c52bcbe18f65521a79d9ac3eb33ec3afd9b342ab2bfc56 gencode/java/u c47b17d70ed7fffae5cb829623088358eca22c8fa5613edd97518bed0b522620 gencode/java/udmi/schema/CapabilityValidationState.java ec164962f2f00924ecb41ae07c2e01d6bf027951ccc605e0210988370b987973 gencode/java/udmi/schema/Category.java f6a557eb73dfa077d7c5daf897bde345c7403232808608c39e24a0cbee2755c9 gencode/java/udmi/schema/CloudModel.java +8b3c78c77a6ccade42d8c3fea9a7c8196344f2f68dfac1dd8685a0727ec31bac gencode/java/udmi/schema/CloudQuery.java 377eb78de936317676faaf7ec5a32ad17f2c2c54a3280df87f5fcc2d36c7014d gencode/java/udmi/schema/Config.java cf9762392e02b5d04c6498963222cc0c00f7be6c3cd82bde3d063a5eceba2b65 gencode/java/udmi/schema/Connections.java 8164e93ccc76d78548d456890e064df8427a09bbcd50686b37a10d3ff5ad429f gencode/java/udmi/schema/Credential.java @@ -51,7 +53,7 @@ e809df42a73ed843977e447fa3333140dcdbe7d09b4e88bf1b8fd52fbaf9ae1a gencode/java/u 5b4508ce3ac0235c9ab97494aa0f2d2ccad88ebc83da28eca2c405fd906e84af gencode/java/udmi/schema/DiscoveryEvent.java 04112dd47b0f761131c276c67d3cd8b789d25e6716b5732be9fef14fc6831f1d gencode/java/udmi/schema/DiscoveryModel.java 0a11a539707571f79bd82b1958886cecae3209e2daef36dfca885adb4c61a07a gencode/java/udmi/schema/DiscoveryState.java -87b9dd3686a5c071846ed3837cb0347933003a1835a514a05c96f2fe94e6578f gencode/java/udmi/schema/EndpointConfiguration.java +fe9eb9928e66f8f34863312778959f49f6a6f2b5f6fa4e647b68c21aa61f0521 gencode/java/udmi/schema/EndpointConfiguration.java dc25e685886e11a741418be9191a478e13c0244647b5a0cac65d6c1e55055578 gencode/java/udmi/schema/Entry.java 06758aca1e0043ddf343b504030f47bb19260e99a82e2d66f12e86092a2434ca gencode/java/udmi/schema/Enumerate.java 8a51984458d96d1798d067005902defa57410167a27dcfb0b730ea38a3326011 gencode/java/udmi/schema/Envelope.java @@ -86,7 +88,7 @@ df64e4ddbf543ac70e7c2af9d3fbc20ffe3dff68c6718aa9ceadab7f64d3d171 gencode/java/u b3b7ef6cae004d5fdb4052f860df0aa583df87bb798a027fc769aeaf16489789 gencode/java/udmi/schema/MonitoringMetric.java 4e7fb33911cf11845d494a07502577647cb96e1196cb7b76553190d14b6ed099 gencode/java/udmi/schema/Operation.java 5e1c5411fae4d7c47391ceb5d19ae864fcd484df75ac6b6db39fd2d12647dec8 gencode/java/udmi/schema/Physical_tag.java -3e331b3817cc87f2fe087aae3a1e599819ceda1ca086094d7f400f5f1c3bdbb9 gencode/java/udmi/schema/PodConfiguration.java +afd4e8dcf55ac7fd91a00bc5348efb7dfe7950037a0eae9365a27d24c4f2f2e9 gencode/java/udmi/schema/PodConfiguration.java d808259db6bbcd26ecf438844ce286d15d4750906be24588d97acfbe8a4ae315 gencode/java/udmi/schema/PointEnumerationEvent.java 468c2c95e9dcbaf4ff706fad7f168c14321eaa35b7fb190848ea8bfd86d981d7 gencode/java/udmi/schema/PointPointsetConfig.java 8f3fc1cdc2dcd3e524863f4675aebabc450a35f5fd1cdc3fd37289b5cab7f2ec gencode/java/udmi/schema/PointPointsetEvent.java @@ -123,7 +125,7 @@ e657fce78cbce01fa4747f1da62dc0442b20ec2d1c196b6e56f3dd465c078ad4 gencode/java/u d54631f8bada01ffecf34361891ee52d41786b1289ce56a9edb696b6ad2d3ace gencode/java/udmi/schema/ValidationState.java e007ddd1ceeae3603c85110c33e1bb4a418ff9c7a791ca0df25b7ea3caeafd36 gencode/java/udmi/schema/ValidationSummary.java b77d953fd22e655c0f10ae32deeaa222769d971f8c38b3379eba45720fb910cc gencode/java/udmi/schema/VirtualEquipmentLinks.java -cf0da75640384f1033a0ac43c758f3ec2f2814878d9a84bd222a4a17d06e2f4d gencode/python/udmi/schema/__init__.py +16db8b6457e9e4a568996fd6b512ffa0344b51469c7f24c2b473411caeeef462 gencode/python/udmi/schema/__init__.py 21a1521cef58f195ef6c44f2b63b820bf981408806f58d3370eeeea07cc5436c gencode/python/udmi/schema/access_iot.py 4b25dd95f863059b761269f93adcae7049507924a1c6e74d6856849203c179db gencode/python/udmi/schema/ancillary_properties.py dab4f5fca272ec48c2881bca2b6bc43786ada47fa1f6dd935c35f7ce0eb6b0f6 gencode/python/udmi/schema/building_translation.py @@ -145,9 +147,9 @@ ac3facbd96f7cb2f7e387e7497d6a36af379a2687329571f250c5670f9933244 gencode/python 7da3bdb37f338260d5f3829fa5fcbb9bbf9f146b514a68319c314a96c6b8ac12 gencode/python/udmi/schema/config_system.py cce623b34fd694880039a1c080214c33e00acaef5bc72276cf11a3bb2de40000 gencode/python/udmi/schema/config_system_testing.py 30b1809e364cb3f7070002bb4a9954b11b25543b099b4bbe450d280001e4de55 gencode/python/udmi/schema/config_udmi.py -8f047e5a423235a90f11e6804c57a0b00de4298bdbef22f3feb0b994ef5a5f05 gencode/python/udmi/schema/configuration_endpoint.py +0e3a99d1ad748319b31b8d88d85dbcdfb7ae060612b5740e64492eac4271ca3c gencode/python/udmi/schema/configuration_endpoint.py 14fd646b9a8638b87e4c421c9dadfb7ed2e66ad02b256217423e3b5dd6c39fd1 gencode/python/udmi/schema/configuration_execution.py -e30f937983f98673b3e67ac1369fe86964d785092964f7e95cd39611f9283d7c gencode/python/udmi/schema/configuration_pod.py +afc89a204d7099791303cf9231b19cc6ba320d1de95a921381f5e47bbafac842 gencode/python/udmi/schema/configuration_pod.py c61ee66daa7e632850bc2705370baa8c057e7a34792c6a29b9e4ca00c0eb195b gencode/python/udmi/schema/configuration_pod_base.py ef61eea743cc2629893b18411636672cdfec0e209e58eb7918b33b43edab5196 gencode/python/udmi/schema/configuration_pod_bridge.py bed77c13436a192047a0dcdcaea7c5d7175e99a76c6c40409cce9e232ab5bc12 gencode/python/udmi/schema/configuration_pubber.py @@ -186,6 +188,7 @@ b48ae013d203eb31cc388a084c0cc6f93d4d5534336d4da2ecbccd84a085ea2b gencode/python 26da2bca967fc7d5179e41e07cfa5da8b1019dd28bf55b68d89193b831b064cd gencode/python/udmi/schema/options_pubber.py 6c5f3dd1c5ca9d821e3c48298af118fc7eafd97af9265dfd34b2ed8642efca77 gencode/python/udmi/schema/persistent_device.py a58f8c98e837a5b56126ca0f410e02f1e9cfcd80a8cb429e0ef522defab1f690 gencode/python/udmi/schema/properties.py +219a9f7053cfaa7d3bde5251c00a98aa90bae2594c549cc417d4ace88341e8bb gencode/python/udmi/schema/query_cloud.py e604cf0280fe772de5f4e5ecf10dc6c564b6177eeff9cd9fb8b385af8fe10a95 gencode/python/udmi/schema/state.py 4a908cee3fb8afb559bcbfa594e57dbc515a35e4468e02600751b2fcce05a238 gencode/python/udmi/schema/state_blobset.py 182e07b534403dcc121d980672e41b0fa2ee55c4da1f5c56f0dad5d599450c80 gencode/python/udmi/schema/state_blobset_blob.py diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index c60ccf52aa..8dbf8c7723 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -21,7 +21,7 @@ jobs: with: distribution: 'temurin' java-version: '17' - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: '3.10' - name: Checkout source @@ -177,11 +177,11 @@ jobs: run: | bin/support ${{ github.repository_owner }}_${{ github.job }}_ tar -tzvf *udmi-support*.tgz - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: ${{ !cancelled() }} with: if-no-files-found: error - name: udmi-support_${{ github.run_id }} + name: udmi-support_${{ github.run_id }}-${{ matrix.shard }} path: '*_udmi-support_*.tgz' baseline: @@ -221,11 +221,11 @@ jobs: - name: support bundle if: ${{ !cancelled() }} run: UDMI_REGISTRY_SUFFIX=_b bin/support ${{ github.repository_owner }}_${{ github.job }}_ - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: ${{ !cancelled() }} with: if-no-files-found: error - name: udmi-support_${{ github.run_id }} + name: udmi-support_${{ github.run_id }}-b path: '*_udmi-support_*.tgz' redirect: @@ -257,11 +257,11 @@ jobs: - name: support bundle if: ${{ !cancelled() }} run: UDMI_REGISTRY_SUFFIX=_r bin/support ${{ github.repository_owner }}_${{ github.job }}_ - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: ${{ !cancelled() }} with: if-no-files-found: error - name: udmi-support_${{ github.run_id }} + name: udmi-support_${{ github.run_id }}-r path: '*_udmi-support_*.tgz' posttest: @@ -275,13 +275,23 @@ jobs: UDMI_ALT_REGISTRY: ZZ-REDIRECT-NA steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: '3.10' - name: Base setup run: bin/setup_base - - name: Download all workflow run artifacts - uses: actions/download-artifact@v3 + - name: Download all sharded support packages + uses: actions/download-artifact@v4 + with: + path: udmi-support_${{ github.run_id }} + pattern: udmi-support_${{ github.run_id }}-* + merge-multiple: true + - name: Upload merged support package + uses: actions/upload-artifact@v4 + with: + if-no-files-found: error + name: udmi-support_${{ github.run_id }} + path: 'udmi-support_${{ github.run_id }}/*_udmi-support_*.tgz' - name: Processing support package run: bin/support_process udmi-support_* - name: Test run index diff --git a/bin/sequencer b/bin/sequencer index ab7e16059d..b624246dae 100755 --- a/bin/sequencer +++ b/bin/sequencer @@ -21,9 +21,6 @@ log_level=INFO min_stage=PREVIEW export UDMI_VERSION=$udmi_version -# For cross-env sort stability -export LC_ALL=C - rm -f $SEQUENCER_LOG $SEQUENCER_OUT $SCHEMA_OUT # Shortcut to run sequencer with a fixed config and cmd-line tests. diff --git a/bin/sequencer_cache b/bin/sequencer_cache index 771603ad94..b2ff153a26 100755 --- a/bin/sequencer_cache +++ b/bin/sequencer_cache @@ -27,9 +27,6 @@ CACHE_ROOT=validator/sequences TEST_ROOT=$RUNDIR/sites/udmi_site_model/out/devices/AHU-1 ARCHIVE_ROOT=/tmp/$CACHE_ROOT -# Fix sort order difference on different platforms. -export LC_ALL=C - function usage(){ echo "Usage: $0 [OPTION]" echo diff --git a/bin/start_hivemq b/bin/start_hivemq new file mode 100755 index 0000000000..da24080b0f --- /dev/null +++ b/bin/start_hivemq @@ -0,0 +1,3 @@ +#!/bin/bash -e + +docker run -p 1883:1883 hivemq/hivemq-ce diff --git a/bin/support_process b/bin/support_process index 2d1d5cb151..7f1f00aea1 100755 --- a/bin/support_process +++ b/bin/support_process @@ -3,6 +3,9 @@ archive=$1 shift || true +# Force consistent sort order +export LC_ALL=C + if [[ -z $archive ]]; then archive=$(ls -t ~/Downloads/udmi-support_*.zip ~/Downloads/udmi-support_*.tgz | head -n 1) echo Auto-detected archive $archive diff --git a/bin/test_regclean b/bin/test_regclean index 6d43ac0d48..c8cc15f0d9 100755 --- a/bin/test_regclean +++ b/bin/test_regclean @@ -1,8 +1,5 @@ #!/bin/bash -e -# Force consistent sort order -export LC_ALL=C - UDMI_ROOT=$(dirname $0)/.. cd $UDMI_ROOT diff --git a/bin/test_sequencer b/bin/test_sequencer index 390acdeddf..9e3e4a227f 100755 --- a/bin/test_sequencer +++ b/bin/test_sequencer @@ -1,8 +1,5 @@ #!/bin/bash -e -# Force consistent sort order -export LC_ALL=C - UDMI_ROOT=$(dirname $0)/.. cd $UDMI_ROOT diff --git a/bin/test_validator b/bin/test_validator index d41e743472..ead02f86aa 100755 --- a/bin/test_validator +++ b/bin/test_validator @@ -1,8 +1,5 @@ #!/bin/bash -e -# Force consistent sort order -export LC_ALL=C - UDMI_ROOT=$(realpath $(dirname $0)/..) cd $UDMI_ROOT diff --git a/common/src/main/java/com/google/udmi/util/GeneralUtils.java b/common/src/main/java/com/google/udmi/util/GeneralUtils.java index 9632a70681..da27a48baa 100644 --- a/common/src/main/java/com/google/udmi/util/GeneralUtils.java +++ b/common/src/main/java/com/google/udmi/util/GeneralUtils.java @@ -289,6 +289,10 @@ public static T ifTrueGet(Object conditional, Supplier action, Supplier T ifTrueGet(Object conditional, Supplier action, T alternate) { + return isTrue(conditional) ? action.get() : alternate; + } + public static void ifTrueThen(Object conditional, Runnable action) { ifTrueThen(conditional, action, null); } diff --git a/gencode/docs/configuration_endpoint.html b/gencode/docs/configuration_endpoint.html index 085d3e5408..7678bed7b0 100644 --- a/gencode/docs/configuration_endpoint.html +++ b/gencode/docs/configuration_endpoint.html @@ -29,6 +29,40 @@ +
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Friendly name for this flow (debugging and diagnostics)

+
+ + + + + + +
+
+
+
@@ -130,6 +164,40 @@

+

+
+
+ +
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Simple payload template for simple injection use cases

+
+ + + + + +
@@ -438,18 +506,18 @@

-
+
-
+

- +

-
+
Type: integer
-

Period for monitoring sampling

+ periodic_sec
Type: integer
+

Rate for periodic task execution

diff --git a/gencode/docs/configuration_execution.html b/gencode/docs/configuration_execution.html index 30ad1b51c6..02b0655896 100644 --- a/gencode/docs/configuration_execution.html +++ b/gencode/docs/configuration_execution.html @@ -462,6 +462,47 @@

+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Friendly name for this flow (debugging and diagnostics)

+
+ + + + + + +
+
+
+
@@ -584,6 +625,47 @@

+

+
+
+

+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Simple payload template for simple injection use cases

+
+ + + + + +
@@ -955,18 +1037,18 @@

-
+
-
+

- +

-
+
Type: integer
-

Period for monitoring sampling

+ periodic_sec
Type: integer
+

Rate for periodic task execution

@@ -1414,6 +1496,47 @@

+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Friendly name for this flow (debugging and diagnostics)

+
+ + + + + + +
+
+
+
@@ -1536,6 +1659,47 @@

+

+
+
+

+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Simple payload template for simple injection use cases

+
+ + + + + +
@@ -1907,18 +2071,18 @@

-
+
-
+

- +

-
+
Type: integer
-

Period for monitoring sampling

+ periodic_sec
Type: integer
+

Rate for periodic task execution

diff --git a/gencode/docs/configuration_pod.html b/gencode/docs/configuration_pod.html index dc97b60ab1..71138ed5f0 100644 --- a/gencode/docs/configuration_pod.html +++ b/gencode/docs/configuration_pod.html @@ -179,6 +179,47 @@

+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Friendly name for this flow (debugging and diagnostics)

+
+ + + + + + +
+
+
+
@@ -301,6 +342,47 @@

+

+
+
+

+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Simple payload template for simple injection use cases

+
+ + + + + +
@@ -672,18 +754,179 @@

-
+
+
+
+

+ +

+
+ +
+
+ + Type: integer
+

Rate for periodic task execution

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

processor designation for a distributor channel

+
Must match regular expression: ^[a-z][a-z0-9]*(_[a-z0-9]+)*$ + + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: object
+ No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: object
+ No Additional Properties + + + + + + +
-
+

- +

-
+
Type: integer
-

Period for monitoring sampling

+ auth_provider + + + + basic + + + + username
Type: string
+ + + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+ + + + + + + +
+
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: object
+ No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: string
+ + + + + + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

The timestamp of the endpoint generation

+
+ + + + + +
+
Example:
+
"2019-01-17T14:02:29.364Z"
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: object
+ + + + + + + +
+
+
+

+ +

+
+ +
+

+ +

+

All property whose name matches the following regular expression must respect the following conditions

+ Property name regular expression: ^[a-z][a-z0-9]*(_[a-z0-9]+)*$ +
+ + Type: object
+

Parameters to define a message endpoint

+
+ + No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Friendly name for this flow (debugging and diagnostics)

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: enum (of string)
+
+

Must be one of:

+
  • "local"
  • "pubsub"
  • "file"
  • "trace"
  • "mqtt"
+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: enum (of string)
+
+

Must be one of:

+
  • "ssl"
  • "tcp"
+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+ + + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Simple payload template for simple injection use cases

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Error message container for capturing errors during parsing/handling

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: integer Default: 8883
+ + + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: integer
+

Delay waiting for config message on start, 0 for default, <0 to disable

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+ + + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Prefix for message topics/addresses

+
Must match regular expression: ^[-_/a-zA-Z0-9]+$ + + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Id for the receiving message channel

+
Must match regular expression: ^[-_/a-zA-Z0-9#]+$ + + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Id for the sending messages channel

+
Must match regular expression: ^[-_/a-zA-Z0-9#]+$ + + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: integer
+

Queue capacity for limiting pipes

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: integer
+

Artifical publish delay for testing

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: integer
+

Rate for periodic task execution

@@ -713,18 +1975,18 @@

-
+
-
+

- +

-
+
Type: string
+ Endpoint Configuration + + + + distributor
Type: string

processor designation for a distributor channel

-
Must match regular expression: ^[a-z][a-z0-9]*(_[a-z0-9]+)*$ +Must match regular expression: ^[a-z][a-z0-9]*(_[a-z0-9]+)*$ @@ -754,18 +2023,18 @@

-
+
-
+

- +

-
+
Type: object
+ Endpoint Configuration + + + + auth_provider
Type: object
No Additional Properties @@ -790,18 +2066,18 @@

-
+
-
+

- +

-
+
Type: object
+ auth_provider + + + + basic
Type: object
No Additional Properties @@ -833,18 +2116,18 @@

-
+
-
+

- +

-
+
Type: string
+ basic + + + + username
Type: string
@@ -887,18 +2177,18 @@

-
+
-
+

- +

-
+
Type: string
+ basic + + + + password
Type: string
@@ -945,18 +2242,18 @@

-
+
-
+

- +

-
+
Type: object
+ auth_provider + + + + jwt
Type: object
No Additional Properties @@ -988,18 +2292,18 @@

-
+
-
+

- +

-
+
Type: string
+ jwt + + + + audience
Type: string
@@ -1050,18 +2361,18 @@

-
+
-
+

- +

-
+
Type: string
+ Endpoint Configuration + + + + generation
Type: string

The timestamp of the endpoint generation

@@ -1088,7 +2406,7 @@


Example:
-
"2019-01-17T14:02:29.364Z"
+
"2019-01-17T14:02:29.364Z"
 
@@ -1098,6 +2416,10 @@

+
+
+
+
@@ -1172,6 +2494,54 @@

+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Friendly name for this flow (debugging and diagnostics)

+
+ + + + + + +
+
+
+
@@ -1315,6 +2685,54 @@

+

+
+
+

+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Simple payload template for simple injection use cases

+
+ + + + + +
@@ -1749,18 +3167,18 @@

-
+
-
+

- +

-
+
Type: integer
-

Period for monitoring sampling

+ periodic_sec
Type: integer
+

Rate for periodic task execution

@@ -2325,9 +3743,56 @@

-
+
+
+ + Type: string
+ + + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
Type: string
+ from
Type: object
+

Parameters to define a message endpoint

+
+ No Additional Properties -
-
-
-
-
+
-
+

- +

-
+
Type: object
-

Parameters to define a message endpoint

+ from + + + + name
Type: string
+

Friendly name for this flow (debugging and diagnostics)

- - No Additional Properties +
+
+
+
@@ -2573,6 +4046,61 @@

+

+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Simple payload template for simple injection use cases

+
+ + + + + +
@@ -3070,18 +4598,18 @@

-
+
-
+

- +

-
+
Type: integer
-

Period for monitoring sampling

+ periodic_sec
Type: integer
+

Rate for periodic task execution

@@ -3669,6 +5197,61 @@

+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Friendly name for this flow (debugging and diagnostics)

+
+ + + + + + +
+
+
+
@@ -3833,6 +5416,61 @@

+

+
+
+

+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Simple payload template for simple injection use cases

+
+ + + + + +
@@ -4330,18 +5968,18 @@

-
+
-
+

- +

-
+
Type: integer
-

Period for monitoring sampling

+ periodic_sec
Type: integer
+

Rate for periodic task execution

@@ -5237,6 +6875,54 @@

+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Friendly name for this flow (debugging and diagnostics)

+
+ + + + + + +
+
+
+
@@ -5380,6 +7066,54 @@

+

+
+
+

+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Simple payload template for simple injection use cases

+
+ + + + + +
@@ -5814,18 +7548,18 @@

-
+
-
+

- +

-
+
Type: integer
-

Period for monitoring sampling

+ periodic_sec
Type: integer
+

Rate for periodic task execution

diff --git a/gencode/docs/configuration_pubber.html b/gencode/docs/configuration_pubber.html index 504154bae9..37c6d6e2b0 100644 --- a/gencode/docs/configuration_pubber.html +++ b/gencode/docs/configuration_pubber.html @@ -61,6 +61,47 @@

+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Friendly name for this flow (debugging and diagnostics)

+
+ + + + + + +
+
+
+
@@ -183,6 +224,47 @@

+

+
+
+

+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Simple payload template for simple injection use cases

+
+ + + + + +
@@ -554,18 +636,18 @@

-
+
-
+

- +

-
+
Type: integer
-

Period for monitoring sampling

+ periodic_sec
Type: integer
+

Rate for periodic task execution

diff --git a/gencode/docs/persistent_device.html b/gencode/docs/persistent_device.html index 4ca4fb1ce6..dcc88282a7 100644 --- a/gencode/docs/persistent_device.html +++ b/gencode/docs/persistent_device.html @@ -61,6 +61,47 @@

+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Friendly name for this flow (debugging and diagnostics)

+
+ + + + + + +
+
+
+
@@ -183,6 +224,47 @@

+

+
+
+

+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Simple payload template for simple injection use cases

+
+ + + + + +
@@ -554,18 +636,18 @@

-
+
-
+

- +

-
+
Type: integer
-

Period for monitoring sampling

+ periodic_sec
Type: integer
+

Rate for periodic task execution

diff --git a/gencode/docs/query_cloud.html b/gencode/docs/query_cloud.html new file mode 100644 index 0000000000..cc057aebf8 --- /dev/null +++ b/gencode/docs/query_cloud.html @@ -0,0 +1,108 @@ + + + + + + + + + + + + + + + + Cloud Query + +

Cloud Query

+ + +
+ + Type: object
+

Information specific to how the device communicates with the cloud.

+
No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Not published by devices, appended to message subblocks within cloud pipeline. RFC 3339 Timestamp the payload was generated

+
+ + + + + +
+
Example:
+
"2019-01-17T14:02:29.364Z"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Version of the UDMI schema

+
+ + + + + + +
+
+
+
+ + + \ No newline at end of file diff --git a/gencode/docs/readme.md b/gencode/docs/readme.md index 72ec323845..0b75a96ad3 100644 --- a/gencode/docs/readme.md +++ b/gencode/docs/readme.md @@ -31,6 +31,7 @@ * [**monitoring**](monitoring.html) - Output from UDMIS monitoring * [**persistent_device**](persistent_device.html) - Device persistent data * [**properties**](properties.html) +* [**query_cloud**](query_cloud.html) - Information specific to how the device communicates with the cloud. * [**state_mapping**](state_mapping.html) - State for [mapping](../../docs/specs/mapping.md) * [**state_udmi**](state_udmi.html) - State of a UDMI reflector client * [**state_validation**](state_validation.html) - Validation state summary diff --git a/gencode/java/udmi/schema/CloudQuery.java b/gencode/java/udmi/schema/CloudQuery.java new file mode 100644 index 0000000000..c0fc442436 --- /dev/null +++ b/gencode/java/udmi/schema/CloudQuery.java @@ -0,0 +1,61 @@ + +package udmi.schema; + +import java.util.Date; +import javax.annotation.processing.Generated; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyDescription; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +/** + * Cloud Query + *

+ * Information specific to how the device communicates with the cloud. + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "timestamp", + "version" +}) +@Generated("jsonschema2pojo") +public class CloudQuery { + + /** + * Not published by devices, appended to message subblocks within cloud pipeline. RFC 3339 Timestamp the payload was generated + * + */ + @JsonProperty("timestamp") + @JsonPropertyDescription("Not published by devices, appended to message subblocks within cloud pipeline. RFC 3339 Timestamp the payload was generated") + public Date timestamp; + /** + * Version of the UDMI schema + * + */ + @JsonProperty("version") + @JsonPropertyDescription("Version of the UDMI schema") + public String version; + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); + result = ((result* 31)+((this.timestamp == null)? 0 :this.timestamp.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof CloudQuery) == false) { + return false; + } + CloudQuery rhs = ((CloudQuery) other); + return (((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version)))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp)))); + } + +} diff --git a/gencode/java/udmi/schema/EndpointConfiguration.java b/gencode/java/udmi/schema/EndpointConfiguration.java index cc68d8dddb..6876583285 100644 --- a/gencode/java/udmi/schema/EndpointConfiguration.java +++ b/gencode/java/udmi/schema/EndpointConfiguration.java @@ -21,9 +21,11 @@ */ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ + "name", "protocol", "transport", "hostname", + "payload", "error", "port", "config_sync_sec", @@ -33,7 +35,7 @@ "send_id", "capacity", "publish_delay_sec", - "monitor_sec", + "periodic_sec", "distributor", "auth_provider", "generation" @@ -41,6 +43,13 @@ @Generated("jsonschema2pojo") public class EndpointConfiguration { + /** + * Friendly name for this flow (debugging and diagnostics) + * + */ + @JsonProperty("name") + @JsonPropertyDescription("Friendly name for this flow (debugging and diagnostics)") + public String name; /** * * (Required) @@ -57,6 +66,13 @@ public class EndpointConfiguration { */ @JsonProperty("hostname") public String hostname; + /** + * Simple payload template for simple injection use cases + * + */ + @JsonProperty("payload") + @JsonPropertyDescription("Simple payload template for simple injection use cases") + public String payload; /** * Error message container for capturing errors during parsing/handling * @@ -116,12 +132,12 @@ public class EndpointConfiguration { @JsonPropertyDescription("Artifical publish delay for testing") public Integer publish_delay_sec; /** - * Period for monitoring sampling + * Rate for periodic task execution * */ - @JsonProperty("monitor_sec") - @JsonPropertyDescription("Period for monitoring sampling") - public Integer monitor_sec; + @JsonProperty("periodic_sec") + @JsonPropertyDescription("Rate for periodic task execution") + public Integer periodic_sec; /** * processor designation for a distributor channel * @@ -143,7 +159,6 @@ public class EndpointConfiguration { public int hashCode() { int result = 1; result = ((result* 31)+((this.generation == null)? 0 :this.generation.hashCode())); - result = ((result* 31)+((this.monitor_sec == null)? 0 :this.monitor_sec.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())); @@ -155,7 +170,10 @@ public int 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.port == null)? 0 :this.port.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.recv_id == null)? 0 :this.recv_id.hashCode())); result = ((result* 31)+((this.auth_provider == null)? 0 :this.auth_provider.hashCode())); return result; @@ -170,7 +188,7 @@ public boolean equals(Object other) { return false; } EndpointConfiguration rhs = ((EndpointConfiguration) other); - return (((((((((((((((((this.generation == rhs.generation)||((this.generation!= null)&&this.generation.equals(rhs.generation)))&&((this.monitor_sec == rhs.monitor_sec)||((this.monitor_sec!= null)&&this.monitor_sec.equals(rhs.monitor_sec))))&&((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.distributor == rhs.distributor)||((this.distributor!= null)&&this.distributor.equals(rhs.distributor))))&&((this.client_id == rhs.client_id)||((this.client_id!= null)&&this.client_id.equals(rhs.client_id))))&&((this.capacity == rhs.capacity)||((this.capacity!= null)&&this.capacity.equals(rhs.capacity))))&&((this.msg_prefix == rhs.msg_prefix)||((this.msg_prefix!= null)&&this.msg_prefix.equals(rhs.msg_prefix))))&&((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.port == rhs.port)||((this.port!= null)&&this.port.equals(rhs.port))))&&((this.recv_id == rhs.recv_id)||((this.recv_id!= null)&&this.recv_id.equals(rhs.recv_id))))&&((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.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.distributor == rhs.distributor)||((this.distributor!= null)&&this.distributor.equals(rhs.distributor))))&&((this.client_id == rhs.client_id)||((this.client_id!= null)&&this.client_id.equals(rhs.client_id))))&&((this.capacity == rhs.capacity)||((this.capacity!= null)&&this.capacity.equals(rhs.capacity))))&&((this.msg_prefix == rhs.msg_prefix)||((this.msg_prefix!= null)&&this.msg_prefix.equals(rhs.msg_prefix))))&&((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.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.recv_id == rhs.recv_id)||((this.recv_id!= null)&&this.recv_id.equals(rhs.recv_id))))&&((this.auth_provider == rhs.auth_provider)||((this.auth_provider!= null)&&this.auth_provider.equals(rhs.auth_provider)))); } @Generated("jsonschema2pojo") diff --git a/gencode/java/udmi/schema/PodConfiguration.java b/gencode/java/udmi/schema/PodConfiguration.java index 35f1b30d62..bb5ed11616 100644 --- a/gencode/java/udmi/schema/PodConfiguration.java +++ b/gencode/java/udmi/schema/PodConfiguration.java @@ -19,6 +19,7 @@ @JsonPropertyOrder({ "base", "flow_defaults", + "crons", "flows", "bridges", "iot_access", @@ -45,6 +46,8 @@ public class PodConfiguration { @JsonProperty("flow_defaults") @JsonPropertyDescription("Parameters to define a message endpoint") public EndpointConfiguration flow_defaults; + @JsonProperty("crons") + public HashMap crons; @JsonProperty("flows") public HashMap flows; @JsonProperty("bridges") @@ -73,6 +76,7 @@ public int hashCode() { result = ((result* 31)+((this.flows == null)? 0 :this.flows.hashCode())); result = ((result* 31)+((this.bridges == null)? 0 :this.bridges.hashCode())); result = ((result* 31)+((this.flow_defaults == null)? 0 :this.flow_defaults.hashCode())); + result = ((result* 31)+((this.crons == null)? 0 :this.crons.hashCode())); result = ((result* 31)+((this.iot_access == null)? 0 :this.iot_access.hashCode())); result = ((result* 31)+((this.base == null)? 0 :this.base.hashCode())); return result; @@ -87,7 +91,7 @@ public boolean equals(Object other) { return false; } PodConfiguration rhs = ((PodConfiguration) other); - return (((((((this.distributors == rhs.distributors)||((this.distributors!= null)&&this.distributors.equals(rhs.distributors)))&&((this.flows == rhs.flows)||((this.flows!= null)&&this.flows.equals(rhs.flows))))&&((this.bridges == rhs.bridges)||((this.bridges!= null)&&this.bridges.equals(rhs.bridges))))&&((this.flow_defaults == rhs.flow_defaults)||((this.flow_defaults!= null)&&this.flow_defaults.equals(rhs.flow_defaults))))&&((this.iot_access == rhs.iot_access)||((this.iot_access!= null)&&this.iot_access.equals(rhs.iot_access))))&&((this.base == rhs.base)||((this.base!= null)&&this.base.equals(rhs.base)))); + return ((((((((this.distributors == rhs.distributors)||((this.distributors!= null)&&this.distributors.equals(rhs.distributors)))&&((this.flows == rhs.flows)||((this.flows!= null)&&this.flows.equals(rhs.flows))))&&((this.bridges == rhs.bridges)||((this.bridges!= null)&&this.bridges.equals(rhs.bridges))))&&((this.flow_defaults == rhs.flow_defaults)||((this.flow_defaults!= null)&&this.flow_defaults.equals(rhs.flow_defaults))))&&((this.crons == rhs.crons)||((this.crons!= null)&&this.crons.equals(rhs.crons))))&&((this.iot_access == rhs.iot_access)||((this.iot_access!= null)&&this.iot_access.equals(rhs.iot_access))))&&((this.base == rhs.base)||((this.base!= null)&&this.base.equals(rhs.base)))); } } diff --git a/gencode/python/udmi/schema/__init__.py b/gencode/python/udmi/schema/__init__.py index fc723cc935..87d24c395f 100644 --- a/gencode/python/udmi/schema/__init__.py +++ b/gencode/python/udmi/schema/__init__.py @@ -60,6 +60,7 @@ from .options_pubber import PubberOptions from .persistent_device import DevicePersistent from .properties import Properties +from .query_cloud import CloudQuery from .state import State from .state_blobset import BlobsetState from .state_blobset_blob import BlobBlobsetState diff --git a/gencode/python/udmi/schema/configuration_endpoint.py b/gencode/python/udmi/schema/configuration_endpoint.py index 13d06859e6..25f5c1d8ee 100644 --- a/gencode/python/udmi/schema/configuration_endpoint.py +++ b/gencode/python/udmi/schema/configuration_endpoint.py @@ -46,9 +46,11 @@ class EndpointConfiguration: """Generated schema class""" def __init__(self): + self.name = None self.protocol = None self.transport = None self.hostname = None + self.payload = None self.error = None self.port = None self.config_sync_sec = None @@ -58,7 +60,7 @@ def __init__(self): self.send_id = None self.capacity = None self.publish_delay_sec = None - self.monitor_sec = None + self.periodic_sec = None self.distributor = None self.auth_provider = None self.generation = None @@ -68,9 +70,11 @@ def from_dict(source): if not source: return None result = EndpointConfiguration() + result.name = source.get('name') result.protocol = source.get('protocol') result.transport = source.get('transport') result.hostname = source.get('hostname') + result.payload = source.get('payload') result.error = source.get('error') result.port = source.get('port') result.config_sync_sec = source.get('config_sync_sec') @@ -80,7 +84,7 @@ def from_dict(source): result.send_id = source.get('send_id') result.capacity = source.get('capacity') result.publish_delay_sec = source.get('publish_delay_sec') - result.monitor_sec = source.get('monitor_sec') + result.periodic_sec = source.get('periodic_sec') result.distributor = source.get('distributor') result.auth_provider = ObjectA90DCC28.from_dict(source.get('auth_provider')) result.generation = source.get('generation') @@ -104,12 +108,16 @@ def expand_dict(input): def to_dict(self): result = {} + if self.name: + result['name'] = self.name # 5 if self.protocol: result['protocol'] = self.protocol # 5 if self.transport: result['transport'] = self.transport # 5 if self.hostname: result['hostname'] = self.hostname # 5 + if self.payload: + result['payload'] = self.payload # 5 if self.error: result['error'] = self.error # 5 if self.port: @@ -128,8 +136,8 @@ def to_dict(self): result['capacity'] = self.capacity # 5 if self.publish_delay_sec: result['publish_delay_sec'] = self.publish_delay_sec # 5 - if self.monitor_sec: - result['monitor_sec'] = self.monitor_sec # 5 + if self.periodic_sec: + result['periodic_sec'] = self.periodic_sec # 5 if self.distributor: result['distributor'] = self.distributor # 5 if self.auth_provider: diff --git a/gencode/python/udmi/schema/configuration_pod.py b/gencode/python/udmi/schema/configuration_pod.py index 713da48501..0473ba16ab 100644 --- a/gencode/python/udmi/schema/configuration_pod.py +++ b/gencode/python/udmi/schema/configuration_pod.py @@ -2,6 +2,7 @@ from .configuration_pod_base import BasePodConfiguration from .configuration_endpoint import EndpointConfiguration from .configuration_endpoint import EndpointConfiguration +from .configuration_endpoint import EndpointConfiguration from .configuration_pod_bridge import BridgePodConfiguration from .access_iot import IotAccess from .configuration_endpoint import EndpointConfiguration @@ -13,6 +14,7 @@ class PodConfiguration: def __init__(self): self.base = None self.flow_defaults = None + self.crons = None self.flows = None self.bridges = None self.iot_access = None @@ -25,6 +27,7 @@ def from_dict(source): result = PodConfiguration() result.base = BasePodConfiguration.from_dict(source.get('base')) result.flow_defaults = EndpointConfiguration.from_dict(source.get('flow_defaults')) + result.crons = EndpointConfiguration.map_from(source.get('crons')) result.flows = EndpointConfiguration.map_from(source.get('flows')) result.bridges = BridgePodConfiguration.map_from(source.get('bridges')) result.iot_access = IotAccess.map_from(source.get('iot_access')) @@ -53,6 +56,8 @@ def to_dict(self): result['base'] = self.base.to_dict() # 4 if self.flow_defaults: result['flow_defaults'] = self.flow_defaults.to_dict() # 4 + if self.crons: + result['crons'] = EndpointConfiguration.expand_dict(self.crons) # 2 if self.flows: result['flows'] = EndpointConfiguration.expand_dict(self.flows) # 2 if self.bridges: diff --git a/gencode/python/udmi/schema/query_cloud.py b/gencode/python/udmi/schema/query_cloud.py new file mode 100644 index 0000000000..2f8c7800b3 --- /dev/null +++ b/gencode/python/udmi/schema/query_cloud.py @@ -0,0 +1,42 @@ +"""Generated class for query_cloud.json""" + + +class CloudQuery: + """Generated schema class""" + + def __init__(self): + self.timestamp = None + self.version = None + + @staticmethod + def from_dict(source): + if not source: + return None + result = CloudQuery() + result.timestamp = source.get('timestamp') + result.version = source.get('version') + return result + + @staticmethod + def map_from(source): + if not source: + return None + result = {} + for key in source: + result[key] = CloudQuery.from_dict(source[key]) + return result + + @staticmethod + def expand_dict(input): + result = {} + for property in input: + result[property] = input[property].to_dict() if input[property] else {} + return result + + def to_dict(self): + result = {} + if self.timestamp: + result['timestamp'] = self.timestamp # 5 + if self.version: + result['version'] = self.version # 5 + return result diff --git a/pubber/src/main/java/daq/pubber/PointsetManager.java b/pubber/src/main/java/daq/pubber/PointsetManager.java index 9661acf862..e1fc5fb972 100644 --- a/pubber/src/main/java/daq/pubber/PointsetManager.java +++ b/pubber/src/main/java/daq/pubber/PointsetManager.java @@ -173,8 +173,7 @@ private void updateState(AbstractPoint point) { if (point.isDirty()) { PointPointsetState state = point.getState(); // Always call to clear the dirty bit - PointPointsetState useState = - ifTrueGet(options.noPointState, PointPointsetState::new, () -> state); + PointPointsetState useState = ifTrueGet(options.noPointState, PointPointsetState::new, state); pointsetState.points.put(pointName, useState); updateState(); } diff --git a/schema/configuration_endpoint.json b/schema/configuration_endpoint.json index c408a3de2a..aa49903170 100644 --- a/schema/configuration_endpoint.json +++ b/schema/configuration_endpoint.json @@ -7,6 +7,10 @@ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { + "name": { + "description": "Friendly name for this flow (debugging and diagnostics)", + "type": "string" + }, "protocol": { "enum": [ "local", @@ -25,6 +29,10 @@ "hostname": { "type": "string" }, + "payload": { + "description": "Simple payload template for simple injection use cases", + "type": "string" + }, "error": { "description": "Error message container for capturing errors during parsing/handling", "type": "string" @@ -63,8 +71,8 @@ "description": "Artifical publish delay for testing", "type": "integer" }, - "monitor_sec": { - "description": "Period for monitoring sampling", + "periodic_sec": { + "description": "Rate for periodic task execution", "type": "integer" }, "distributor": { diff --git a/schema/configuration_pod.json b/schema/configuration_pod.json index 699e3f51fe..c94905b5c0 100644 --- a/schema/configuration_pod.json +++ b/schema/configuration_pod.json @@ -13,6 +13,14 @@ "flow_defaults": { "$ref": "file:configuration_endpoint.json" }, + "crons": { + "existingJavaType": "java.util.HashMap", + "patternProperties": { + "^[a-z][a-z0-9]*(_[a-z0-9]+)*$": { + "$ref": "file:configuration_endpoint.json" + } + } + }, "flows": { "existingJavaType": "java.util.HashMap", "patternProperties": { diff --git a/schema/query_cloud.json b/schema/query_cloud.json new file mode 100644 index 0000000000..971222506d --- /dev/null +++ b/schema/query_cloud.json @@ -0,0 +1,20 @@ +{ + "$udmi_version": "1.5.0", + "title": "Cloud Query", + "description": "Information specific to how the device communicates with the cloud.", + "type": "object", + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "properties": { + "timestamp": { + "description": "Not published by devices, appended to message subblocks within cloud pipeline. RFC 3339 Timestamp the payload was generated", + "type": "string", + "format": "date-time", + "examples": ["2019-01-17T14:02:29.364Z"] + }, + "version": { + "description": "Version of the UDMI schema", + "type": "string" + } + } +} diff --git a/udmis/.idea/runConfigurations/UdmiServicePod_ClearBlade.xml b/udmis/.idea/runConfigurations/UdmiServicePod_ClearBlade.xml index 00188728a7..e56cfcfd42 100644 --- a/udmis/.idea/runConfigurations/UdmiServicePod_ClearBlade.xml +++ b/udmis/.idea/runConfigurations/UdmiServicePod_ClearBlade.xml @@ -14,7 +14,7 @@