m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages
diff options
context:
space:
mode:
authorMarcin Chrzanowski <marcin.j.chrzanowski@gmail.com>2019-12-29 19:12:48 +0100
committerMarcin Chrzanowski <marcin.j.chrzanowski@gmail.com>2019-12-29 19:12:48 +0100
commit0e9ed16b0a048266b56d1238bd7a8a31e59fdac5 (patch)
tree2940168f2cc91be0d350989dc7461f0af2cf018b /src/main/java/pl/edu/mimuw/cloudatlas/agent/messages
parent7f03e1ddbd73831499d63eee1075b0b1226fa173 (diff)
Start running queries with Qurnik
Diffstat (limited to 'src/main/java/pl/edu/mimuw/cloudatlas/agent/messages')
-rw-r--r--src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/QurnikMessage.java25
-rw-r--r--src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/RunQueriesMessage.java9
2 files changed, 34 insertions, 0 deletions
diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/QurnikMessage.java b/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/QurnikMessage.java
new file mode 100644
index 0000000..0161a37
--- /dev/null
+++ b/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/QurnikMessage.java
@@ -0,0 +1,25 @@
+package pl.edu.mimuw.cloudatlas.agent.messages;
+
+import pl.edu.mimuw.cloudatlas.agent.modules.Module;
+import pl.edu.mimuw.cloudatlas.agent.modules.ModuleType;
+
+public abstract class QurnikMessage extends AgentMessage {
+ public enum Type {
+ RUN_QUERIES
+ }
+
+ private Type type;
+
+ public QurnikMessage(String messageId, long timestamp, Type type) {
+ super(messageId, ModuleType.QUERY, timestamp);
+ this.type = type;
+ }
+
+ public Type getType() {
+ return type;
+ }
+
+ public void callMe(Module module) throws InterruptedException, Module.InvalidMessageType {
+ module.handleTyped(this);
+ }
+}
diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/RunQueriesMessage.java b/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/RunQueriesMessage.java
new file mode 100644
index 0000000..35f7819
--- /dev/null
+++ b/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/RunQueriesMessage.java
@@ -0,0 +1,9 @@
+package pl.edu.mimuw.cloudatlas.agent.messages;
+
+import pl.edu.mimuw.cloudatlas.agent.modules.ModuleType;
+
+public class RunQueriesMessage extends QurnikMessage {
+ public RunQueriesMessage(String messageId, long timestamp) {
+ super(messageId, timestamp, Type.RUN_QUERIES);
+ }
+}