-
Notifications
You must be signed in to change notification settings - Fork 313
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(sparkplug): Edge Node implementation at Data Transport level (#5098
) * feat(sparkplug): Edge Node implementation at DataTransport level Signed-off-by: Marcello Martina <[email protected]> * fix: message handler threading rework Signed-off-by: Marcello Martina <[email protected]> * chrore: changed executor type Signed-off-by: Marcello Martina <[email protected]> * fix: proper thread shutdown on update Signed-off-by: Marcello Martina <[email protected]> * feat: added example device for testing purposes Signed-off-by: Marcello Martina <[email protected]> * feat: added SessionStatus for managing state transitions Signed-off-by: Marcello Martina <[email protected]> * refactor: renaming Signed-off-by: Marcello Martina <[email protected]> * refactor: renaming Signed-off-by: Marcello Martina <[email protected]> * refactor: better SessionStatus management Signed-off-by: Marcello Martina <[email protected]> * fix: made BdSeqCounter thread safe Signed-off-by: Marcello Martina <[email protected]> * refactor: replaced messages queue with ExecutorService submits Signed-off-by: Marcello Martina <[email protected]> * refactor: better error handling on connect Signed-off-by: Marcello Martina <[email protected]> * fix: confirming session outside the client Signed-off-by: Marcello Martina <[email protected]> * refactor: simplified BdSeqCounter Signed-off-by: Marcello Martina <[email protected]> * refactor: better options class, added logs, moved session estabilish into client Signed-off-by: Marcello Martina <[email protected]> * test: added test cases and refactor of SparkplugDataTransportOptionsTest Signed-off-by: Marcello Martina <[email protected]> * refactor: removed unecessary reference to DataTransportService in CloudEndpoint Signed-off-by: Marcello Martina <[email protected]> * test: fixed CloudEndpoint tests Signed-off-by: Marcello Martina <[email protected]> * test: replaced unit test with integration tests for SparkplugDataTransportTest Signed-off-by: Marcello Martina <[email protected]> * test: added test cases, removed negative test verification due to spurious messages Signed-off-by: Marcello Martina <[email protected]> * test: added test cases Signed-off-by: Marcello Martina <[email protected]> * test: added test cases Signed-off-by: Marcello Martina <[email protected]> * fix: using Random to generate int values Signed-off-by: Marcello Martina <[email protected]> --------- Signed-off-by: Marcello Martina <[email protected]>
- Loading branch information
1 parent
0445dee
commit 3488d02
Showing
17 changed files
with
1,350 additions
and
962 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
...src/main/java/org/eclipse/kura/cloudconnection/sparkplug/mqtt/transport/BdSeqCounter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2024 Eurotech and/or its affiliates and others | ||
* | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Eurotech | ||
*******************************************************************************/ | ||
package org.eclipse.kura.cloudconnection.sparkplug.mqtt.transport; | ||
|
||
public class BdSeqCounter { | ||
|
||
private int bdSeq = 0; | ||
|
||
public synchronized void next() { | ||
if (this.bdSeq == 255) { | ||
this.bdSeq = 0; | ||
} else { | ||
this.bdSeq = this.bdSeq + 1; | ||
} | ||
} | ||
|
||
public synchronized int getCurrent() { | ||
return this.bdSeq; | ||
} | ||
|
||
} |
Oops, something went wrong.