From 0a1a9555d9d31a50e635a929edece9b6ff4f6d92 Mon Sep 17 00:00:00 2001 From: Uellington Damasceno Date: Fri, 2 Feb 2024 23:13:57 -0300 Subject: [PATCH] If applied, this commit will update the dlt client. --- pom.xml | 28 +++++++++++-------- .../load/monitor/model/LedgerConnector.java | 10 ++++--- .../dlt/load/monitor/model/Processor.java | 5 ++-- 3 files changed, 24 insertions(+), 19 deletions(-) diff --git a/pom.xml b/pom.xml index 87b5f04..93ad18c 100644 --- a/pom.xml +++ b/pom.xml @@ -59,13 +59,17 @@ true + + jitpack.io + https://jitpack.io + io.github.larsid - SOFT-IoT-DLT-Client-Tangle - 1.0-SNAPSHOT + soft-iot-dlt-client-tangle-hornet + 96dba1fb12 provided @@ -125,21 +129,21 @@ true - + org.apache.maven.plugins maven-gpg-plugin 1.5 - sign-artifacts - verify - - sign - - - true - ${env.GPG_KEYNAME} - + sign-artifacts + verify + + sign + + + true + ${env.GPG_KEYNAME} + diff --git a/src/main/java/dlt/load/monitor/model/LedgerConnector.java b/src/main/java/dlt/load/monitor/model/LedgerConnector.java index 32e36a4..46959e5 100644 --- a/src/main/java/dlt/load/monitor/model/LedgerConnector.java +++ b/src/main/java/dlt/load/monitor/model/LedgerConnector.java @@ -1,8 +1,9 @@ package dlt.load.monitor.model; -import dlt.client.tangle.model.transactions.Status; -import dlt.client.tangle.model.transactions.Transaction; -import dlt.client.tangle.services.ILedgerWriter; +import dlt.client.tangle.hornet.model.transactions.IndexTransaction; +import dlt.client.tangle.hornet.model.transactions.Status; +import dlt.client.tangle.hornet.model.transactions.Transaction; +import dlt.client.tangle.hornet.services.ILedgerWriter; import dlt.id.manager.services.IDLTGroupManager; import dlt.id.manager.services.IIDManagerService; @@ -40,6 +41,7 @@ public void put(int lastCharge, boolean lbEntry, Long avgLoad, Long lastLoad, bo .toString(); Transaction transaction = new Status(source, group, lbEntry, avgLoad, lastLoad,available); - this.ledgerWriter.put(transaction); + IndexTransaction indexedTransaction = new IndexTransaction(transaction.getType().name(), transaction); + this.ledgerWriter.put(indexedTransaction); } } diff --git a/src/main/java/dlt/load/monitor/model/Processor.java b/src/main/java/dlt/load/monitor/model/Processor.java index 20f4714..6dd6feb 100644 --- a/src/main/java/dlt/load/monitor/model/Processor.java +++ b/src/main/java/dlt/load/monitor/model/Processor.java @@ -1,5 +1,6 @@ package dlt.load.monitor.model; +import java.util.logging.Level; import java.util.logging.Logger; /** @@ -27,9 +28,7 @@ protected void updateBrokerStatus(Integer qtdDevices) boolean lbEntry = (qtdDevices >= loadLimit); boolean available = ((qtdDevices + 1) < loadLimit); - logger.info( - "Amount of devices: " + qtdDevices + " | Need balancing? " + lbEntry - ); + logger.log(Level.INFO, "Amount of devices: {0} | Need balancing? {1}", new Object[]{qtdDevices, lbEntry}); if (lbEntry) { //Se o gateway está sobrecarregado. if (