Skip to content

Commit

Permalink
Checkpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron committed Dec 17, 2020
1 parent 8e5bd58 commit d91363e
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/main/java/org/dsa/iot/haystack/Haystack.java
Original file line number Diff line number Diff line change
Expand Up @@ -145,18 +145,26 @@ public void editConnection(String url,
boolean enabled) {
LOGGER.info("Edit Server url={} user={} enabled={}", url, user, enabled);
node.setRoConfig("lu", new Value(0));
stop();
List<String> list = new ArrayList<>(node.getChildren().keySet());
for (String name : list) {
Node tmp = node.getChild(name);
Node tmp = node.getChild(name, false);
if (tmp == null) {
tmp = node.getChild(name, true);
}
if (tmp == null) {
continue;
}
if (tmp.getAction() != null) {
continue;
}
if (tmp.getRoConfig("navId") != null) {
node.removeChild(name, false);
if (node.removeChild(name, false) == null) {
node.removeChild(name, true);
}
}
}
if (!enabled) {
stop();
Utils.getStatusNode(node).setValue(new Value("Disabled"));
} else {
conn.editConnection(url, user, pass, connTimeout, readTimeout);
Expand Down

0 comments on commit d91363e

Please sign in to comment.