m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/pl/edu/mimuw/cloudatlas/client
diff options
context:
space:
mode:
authorMagdalena Grodzińska <mag.grodzinska@gmail.com>2020-01-12 22:58:08 +0100
committerMagdalena Grodzińska <mag.grodzinska@gmail.com>2020-01-12 22:58:08 +0100
commitc48ec1604744ab330d18af1f55256c35dc5c34c6 (patch)
treebd847d0a328e30d545cd4d2ea64a0a07020424b4 /src/main/java/pl/edu/mimuw/cloudatlas/client
parent36cf47fd63352c67a5fdeea7a922c16f0856e9aa (diff)
Improve query signer and its api
Diffstat (limited to 'src/main/java/pl/edu/mimuw/cloudatlas/client')
-rw-r--r--src/main/java/pl/edu/mimuw/cloudatlas/client/ClientController.java10
1 files changed, 4 insertions, 6 deletions
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<String, byte[]> querySignatures;
private Map<ValueTime, AttributesMap> 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:");