m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/pl/edu/mimuw/cloudatlas/agent
diff options
context:
space:
mode:
authorMagdalena Grodzińska <mag.grodzinska@gmail.com>2020-01-13 20:56:41 +0100
committerMagdalena Grodzińska <mag.grodzinska@gmail.com>2020-01-13 20:56:41 +0100
commit23b8714b29816b608cb3aa330b6e93610e107126 (patch)
tree4cb9bf4d64ec1d2987ec4b44692fdd42280ab91d /src/main/java/pl/edu/mimuw/cloudatlas/agent
parent81d1abbbad1f1e9c7774c7162b23fc804f7989a3 (diff)
Create simple query data structure so that RMI doesn't blow up
Diffstat (limited to 'src/main/java/pl/edu/mimuw/cloudatlas/agent')
-rw-r--r--src/main/java/pl/edu/mimuw/cloudatlas/agent/ApiImplementation.java7
-rw-r--r--src/main/java/pl/edu/mimuw/cloudatlas/agent/NewApiImplementation.java7
2 files changed, 8 insertions, 6 deletions
diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/agent/ApiImplementation.java b/src/main/java/pl/edu/mimuw/cloudatlas/agent/ApiImplementation.java
index e9dbb7e..90e7789 100644
--- a/src/main/java/pl/edu/mimuw/cloudatlas/agent/ApiImplementation.java
+++ b/src/main/java/pl/edu/mimuw/cloudatlas/agent/ApiImplementation.java
@@ -28,6 +28,7 @@ import pl.edu.mimuw.cloudatlas.model.Type;
import pl.edu.mimuw.cloudatlas.model.TypePrimitive;
import pl.edu.mimuw.cloudatlas.model.ZMI;
import pl.edu.mimuw.cloudatlas.api.Api;
+import pl.edu.mimuw.cloudatlas.querysigner.QueryData;
import pl.edu.mimuw.cloudatlas.querysigner.QueryUtils;
public class ApiImplementation implements Api {
@@ -61,11 +62,11 @@ public class ApiImplementation implements Api {
}
}
- public void installQuery(String name, ValueQuery query) throws RemoteException {
+ public void installQuery(String name, QueryData query) throws RemoteException {
QueryUtils.validateQueryName(name);
try {
Attribute attributeName = new Attribute(name);
- installQueryInHierarchy(root, attributeName, query);
+ installQueryInHierarchy(root, attributeName, new ValueQuery(query));
executeAllQueries(root);
} catch (Exception e) {
throw new RemoteException("Failed to install query", e);
@@ -81,7 +82,7 @@ public class ApiImplementation implements Api {
}
}
- public void uninstallQuery(String queryName, ValueQuery query) throws RemoteException {
+ public void uninstallQuery(String queryName, QueryData query) throws RemoteException {
QueryUtils.validateQueryName(queryName);
uninstallQueryInHierarchy(root, new Attribute(queryName));
}
diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/agent/NewApiImplementation.java b/src/main/java/pl/edu/mimuw/cloudatlas/agent/NewApiImplementation.java
index bf75210..0bf4338 100644
--- a/src/main/java/pl/edu/mimuw/cloudatlas/agent/NewApiImplementation.java
+++ b/src/main/java/pl/edu/mimuw/cloudatlas/agent/NewApiImplementation.java
@@ -22,6 +22,7 @@ import pl.edu.mimuw.cloudatlas.interpreter.Main;
import pl.edu.mimuw.cloudatlas.interpreter.QueryResult;
import pl.edu.mimuw.cloudatlas.model.*;
import pl.edu.mimuw.cloudatlas.api.Api;
+import pl.edu.mimuw.cloudatlas.querysigner.QueryData;
import pl.edu.mimuw.cloudatlas.querysigner.QueryUtils;
public class NewApiImplementation implements Api {
@@ -80,13 +81,13 @@ public class NewApiImplementation implements Api {
}
}
- public void installQuery(String name, ValueQuery query) throws RemoteException {
+ public void installQuery(String name, QueryData query) throws RemoteException {
QueryUtils.validateQueryName(name);
try {
Attribute attributeName = new Attribute(name);
ValueTime timestamp = new ValueTime(System.currentTimeMillis());
Map<Attribute, Entry<ValueQuery, ValueTime>> queries = new HashMap();
- queries.put(attributeName, new SimpleImmutableEntry(query, timestamp));
+ queries.put(attributeName, new SimpleImmutableEntry(new ValueQuery(query), timestamp));
UpdateQueriesMessage message = new UpdateQueriesMessage("", 0, queries);
eventBus.addMessage(message);
} catch (Exception e) {
@@ -94,7 +95,7 @@ public class NewApiImplementation implements Api {
}
}
- public void uninstallQuery(String queryName, ValueQuery query) throws RemoteException {
+ public void uninstallQuery(String queryName, QueryData query) throws RemoteException {
QueryUtils.validateQueryName(queryName);
try {
Attribute attributeName = new Attribute(queryName);