From ebee2e36646254983635053ed607436c5ea34eac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magdalena=20Grodzi=C5=84ska?= Date: Tue, 14 Jan 2020 23:18:13 +0100 Subject: Fix README --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 47cdd3e..3a5ad5b 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,14 @@ The agent, fetcher, and interpreter take an optional `-Dhostname= Date: Tue, 14 Jan 2020 23:47:05 +0100 Subject: Fix stanik --- .../edu/mimuw/cloudatlas/agent/modules/Stanik.java | 27 +++++++++++++--------- 1 file changed, 16 insertions(+), 11 deletions(-) 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 efc5605..8f0b13f 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 @@ -226,23 +226,28 @@ public class Stanik extends Module { for (Entry entry : message.getQueries().entrySet()) { Attribute attribute = entry.getKey(); ValueQuery query = entry.getValue(); - try { - if (query.isInstalled()) { + System.out.println(query.getSignature()); + System.out.println(query); + System.out.println(query.getCode()); + if (!attribute.getName().equals("&cardinality") && ! attribute.getName().equals("&contacts")) { + try { + if (query.isInstalled()) { QuerySignerApiImplementation.validateInstallQuery( attribute.getName(), QueryUtils.constructQueryData(query), this.publicKey); - } else { - QuerySignerApiImplementation.validateUninstallQuery( - attribute.getName(), - QueryUtils.constructQueryData(query), - this.publicKey); + } else { + QuerySignerApiImplementation.validateUninstallQuery( + attribute.getName(), + QueryUtils.constructQueryData(query), + this.publicKey); + } + } catch (RemoteException | IllegalBlockSizeException | InvalidKeyException | BadPaddingException | NoSuchAlgorithmException | NoSuchPaddingException | QuerySigner.InvalidQueryException e) { + System.out.println("ERROR: Query " + attribute.getName() + " was not updated in Stanik with error message " + e.getMessage()); + e.printStackTrace(); + continue; } - } catch (RemoteException | IllegalBlockSizeException | InvalidKeyException | BadPaddingException | NoSuchAlgorithmException | NoSuchPaddingException | QuerySigner.InvalidQueryException e) { - System.out.println("ERROR: Query " + attribute.getName() + " was not updated in Stanik with error message " + e.getMessage()); - e.printStackTrace(); - continue; } ValueTime timestamp = new ValueTime(entry.getValue().getTimestamp()); ValueQuery currentTimestampedQuery = queries.get(attribute); -- cgit v1.2.3 From 62671d3865398ebe5a1ac6f5fd04abe87fcf9419 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magdalena=20Grodzi=C5=84ska?= Date: Tue, 14 Jan 2020 23:51:52 +0100 Subject: Fix stanik again --- src/main/java/pl/edu/mimuw/cloudatlas/agent/modules/Stanik.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 8f0b13f..5a2f8a9 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 @@ -229,7 +229,7 @@ public class Stanik extends Module { System.out.println(query.getSignature()); System.out.println(query); System.out.println(query.getCode()); - if (!attribute.getName().equals("&cardinality") && ! attribute.getName().equals("&contacts")) { + if (query.getSignature() != null && query.getSignature().length != 0) { try { if (query.isInstalled()) { QuerySignerApiImplementation.validateInstallQuery( -- cgit v1.2.3 From becf7ebe358740ca082d4147ab3e1a3c99106e57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magdalena=20Grodzi=C5=84ska?= Date: Tue, 14 Jan 2020 23:53:46 +0100 Subject: Fix stanik again! --- src/main/java/pl/edu/mimuw/cloudatlas/agent/modules/Stanik.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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 5a2f8a9..382160e 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 @@ -226,10 +226,7 @@ public class Stanik extends Module { for (Entry entry : message.getQueries().entrySet()) { Attribute attribute = entry.getKey(); ValueQuery query = entry.getValue(); - System.out.println(query.getSignature()); - System.out.println(query); - System.out.println(query.getCode()); - if (query.getSignature() != null && query.getSignature().length != 0) { + if (query.getSignature() != null) { try { if (query.isInstalled()) { QuerySignerApiImplementation.validateInstallQuery( -- cgit v1.2.3