m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/ResponseMessage.java
diff options
context:
space:
mode:
authorMartin <marcin.j.chrzanowski@gmail.com>2019-12-29 16:50:05 +0100
committerGitHub <noreply@github.com>2019-12-29 16:50:05 +0100
commit7f03e1ddbd73831499d63eee1075b0b1226fa173 (patch)
tree55bd25630a090c91e1a4362b68e32da22389dd1d /src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/ResponseMessage.java
parent8b076ed54b692381a3c1410b704bdad33ad5ca0b (diff)
parentc3121bfa6c00682173a7f1fba9d4c524b8ef517e (diff)
Merge pull request #77 from m-chrzan/stanik
Stanik
Diffstat (limited to 'src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/ResponseMessage.java')
-rw-r--r--src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/ResponseMessage.java31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/ResponseMessage.java b/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/ResponseMessage.java
new file mode 100644
index 0000000..02b3337
--- /dev/null
+++ b/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/ResponseMessage.java
@@ -0,0 +1,31 @@
+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 ResponseMessage extends AgentMessage {
+ public enum Type {
+ STATE
+ }
+
+ Type type;
+ long requestId;
+
+ public ResponseMessage(String messageId, ModuleType destinationModule, long timestamp, Type type, long requestId) {
+ super(messageId, destinationModule, timestamp);
+ this.type = type;
+ this.requestId = requestId;
+ }
+
+ public void callMe(Module module) throws InterruptedException, Module.InvalidMessageType {
+ module.handleTyped(this);
+ }
+
+ public long getRequestId() {
+ return requestId;
+ }
+
+ public Type getType() {
+ return type;
+ }
+}