From 23b8714b29816b608cb3aa330b6e93610e107126 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magdalena=20Grodzi=C5=84ska?= Date: Mon, 13 Jan 2020 20:56:41 +0100 Subject: Create simple query data structure so that RMI doesn't blow up --- src/main/java/pl/edu/mimuw/cloudatlas/agent/ApiImplementation.java | 7 ++++--- .../java/pl/edu/mimuw/cloudatlas/agent/NewApiImplementation.java | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'src/main/java/pl/edu/mimuw/cloudatlas/agent') 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> 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); -- cgit v1.2.3