From 5aa6345de1464a372bc69219ef9b777991bde1dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magdalena=20Grodzi=C5=84ska?= Date: Sat, 11 Jan 2020 12:39:54 +0100 Subject: Add adding missing zones on attribute creation --- src/main/java/pl/edu/mimuw/cloudatlas/agent/modules/Stanik.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/main/java') diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/agent/modules/Stanik.java b/src/main/java/pl/edu/mimuw/cloudatlas/agent/modules/Stanik.java index 6761c94..3fca1d5 100644 --- a/src/main/java/pl/edu/mimuw/cloudatlas/agent/modules/Stanik.java +++ b/src/main/java/pl/edu/mimuw/cloudatlas/agent/modules/Stanik.java @@ -1,5 +1,6 @@ package pl.edu.mimuw.cloudatlas.agent.modules; +import java.nio.file.Path; import java.util.HashMap; import java.util.LinkedList; import java.util.List; @@ -141,7 +142,11 @@ public class Stanik extends Module { */ public void handleSetAttribte(SetAttributeMessage message) { try { - ZMI zmi = hierarchy.findDescendant(new PathName(message.getPathName())); + PathName descendantPath = new PathName(message.getPathName()); + if (!hierarchy.descendantExists(descendantPath)) { + addMissingZones(descendantPath); + } + ZMI zmi = hierarchy.findDescendant(descendantPath); ValueTime updateTimestamp = message.getUpdateTimestamp(); ValueTime currentTimestamp = (ValueTime) zmi.getAttributes().getOrNull("timestamp"); if (ValueUtils.valueLower(currentTimestamp, updateTimestamp)) { -- cgit v1.2.3