m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/pl/edu/mimuw/cloudatlas/agent
diff options
context:
space:
mode:
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);