100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps
Java asset-managementbuildingdashboarddataplatformdevice-managementedge-computingenergyenergy-managementenergy-monitorfleet-managementfleet-telematicsiotiot-applicationiot-platformmodbusmqttmqtt-brokerota-updaterules-enginesmartcity
Made it possible to attach a remote debugger to the manager container. Options for this should be supplied through env Fixed a parameter name in ReplaySimulatorElement
Michael Rademaker9a69fed4e880
diff --git a/agent/src/main/java/org/openremote/agent/protocol/simulator/SimulatorProtocol.java b/agent/src/main/java/org/openremote/agent/protocol/simulator/SimulatorProtocol.javaindex eaaf2e1f8..d218719de 100644--- a/agent/src/main/java/org/openremote/agent/protocol/simulator/SimulatorProtocol.java+++ b/agent/src/main/java/org/openremote/agent/protocol/simulator/SimulatorProtocol.java@@ -556,14 +556,14 @@ public class SimulatorProtocol extends AbstractProtocol {ReplaySimulatorElement.ReplaySimulatorDatapoint nextDatapoint = replaySimulatorElement.getNextDatapoint(now);long nextRun = nextDatapoint.timestamp;if (nextRun <= now) { //now is after so nextRun is next day- nextRun += 86400;//day in seconds+ nextRun += 86400; //day in seconds}long nextRunRelative = nextRun - now;LOG.info("Next update for asset " + attributeRef.getEntityId() + " for attribute " + attributeRef.getAttributeName() + " in " + nextRunRelative + " second(s)");return executorService.schedule(() -> {withLock(getProtocolName() + "::firingNextUpdate", () -> {- LOG.info("Updating asset " + attributeRef.getEntityId() + "for attribute " + attributeRef.getAttributeName() + " with value " + nextDatapoint.value.toString());+ LOG.info("Updating asset " + attributeRef.getEntityId() + " for attribute " + attributeRef.getAttributeName() + " with value " + nextDatapoint.value.toString());updateLinkedAttribute(new AttributeState(attributeRef, nextDatapoint.value));replayMap.put(attributeRef, scheduleReplay(attributeRef, replaySimulatorElement));});diff --git a/manager/Dockerfile b/manager/Dockerfileindex b37b355e5..b3213bd48 100644--- a/manager/Dockerfile+++ b/manager/Dockerfile@@ -9,9 +9,11 @@ ENV JAVA_HOME /etc/alternatives/java# Add git commit label must be specified at build time using --build-arg GIT_COMMIT=dadadadadadARG GIT_COMMIT=unknown+LABEL git-commit=$GIT_COMMIT-ENV JAVA_OPTS=${JAVA_OPTS:-Xmx1g}+ENV JAVA_OPTS=${JAVA_OPTS}+ENV JAVA_TOOL_OPTIONS=${JAVA_TOOL_OPTIONS}ENV APP_DOCROOT /deployment/manager/appENV SHARED_DOCROOT /deployment/manager/shareddiff --git a/model/src/main/java/org/openremote/model/simulator/element/ReplaySimulatorElement.java b/model/src/main/java/org/openremote/model/simulator/element/ReplaySimulatorElement.javaindex 864e816a4..94363ca50 100644--- a/model/src/main/java/org/openremote/model/simulator/element/ReplaySimulatorElement.java+++ b/model/src/main/java/org/openremote/model/simulator/element/ReplaySimulatorElement.java@@ -40,10 +40,10 @@ public class ReplaySimulatorElement extends SimulatorElement {super(attributeRef, AttributeValueType.ARRAY);}- public ReplaySimulatorDatapoint getNextDatapoint(long millis) throws JsonProcessingException {+ public ReplaySimulatorDatapoint getNextDatapoint(long seconds) throws JsonProcessingException {ReplaySimulatorDatapoint[] datapoints = new ObjectMapper().registerModule(new ModelModule()).readValue(elementValue.toJson(), ReplaySimulatorDatapoint[].class);return Arrays.stream(datapoints)- .filter(replaySimulatorDatapoint -> replaySimulatorDatapoint.timestamp > millis)+ .filter(replaySimulatorDatapoint -> replaySimulatorDatapoint.timestamp > seconds).findFirst().orElse(datapoints[0]);}