From 581e6c3aaf418665a9c1254537821f341442b724 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magdalena=20Grodzi=C5=84ska?= 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(-) (limited to 'src/main/java/pl/edu/mimuw') 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(-) (limited to 'src/main/java/pl/edu/mimuw') 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(-) (limited to 'src/main/java/pl/edu/mimuw') 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