From c48ec1604744ab330d18af1f55256c35dc5c34c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magdalena=20Grodzi=C5=84ska?= Date: Sun, 12 Jan 2020 22:58:08 +0100 Subject: Improve query signer and its api --- .../java/pl/edu/mimuw/cloudatlas/client/ClientController.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/main/java/pl/edu/mimuw/cloudatlas/client') diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/client/ClientController.java b/src/main/java/pl/edu/mimuw/cloudatlas/client/ClientController.java index 14f531e..56b478c 100644 --- a/src/main/java/pl/edu/mimuw/cloudatlas/client/ClientController.java +++ b/src/main/java/pl/edu/mimuw/cloudatlas/client/ClientController.java @@ -35,7 +35,6 @@ import java.util.*; public class ClientController { private Api agentApi; private QuerySignerApi querySignerApi; - private Map querySignatures; private Map attributes; private String currentZoneName; private static final int MAX_ENTRIES = 10; @@ -60,7 +59,6 @@ public class ClientController { } }; this.currentZoneName = System.getProperty("zone_path"); - this.querySignatures = new HashMap<>(); fetchAttributeData(); // fetch attribute data as early as possible } @@ -81,9 +79,8 @@ public class ClientController { boolean success = true; try { - byte[] querySignature = this.querySignerApi.signQuery(queryObject.getName(), queryObject.getValue()); - querySignatures.put(queryObject.getName(), querySignature); - this.agentApi.installQuery(queryObject.getName(), queryObject.getValue(), querySignature); + ValueQuery query = this.querySignerApi.signInstallQuery(queryObject.getName(), queryObject.getValue()); + this.agentApi.installQuery(queryObject.getName(), query); } catch (Exception e) { success = false; System.err.println("Client exception:"); @@ -108,7 +105,8 @@ public class ClientController { boolean success = true; try { - this.agentApi.uninstallQuery(queryObject.getName(), querySignatures.get(queryObject.getName())); + ValueQuery query = querySignerApi.signUninstallQuery(queryObject.getName()); + this.agentApi.uninstallQuery(queryObject.getName(), query); } catch (Exception e) { success = false; System.err.println("Client exception:"); -- cgit v1.2.3