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-30 22:16:46 +0100
committerMarcin Chrzanowski <marcin.j.chrzanowski@gmail.com>2019-12-30 22:16:46 +0100
commitca2f1ab4a37f0d590d5c116cd1fa7c341c77fad3 (patch)
treefb3b8ff1629e5480086f43065156625985a2e034 /src/main/java/pl/edu/mimuw/cloudatlas/agent/messages
parentfda20e7aa496926d4f4d78921925025040414d9b (diff)
Implement modular getZoneSet
Diffstat (limited to 'src/main/java/pl/edu/mimuw/cloudatlas/agent/messages')
-rw-r--r--src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/RemikMessage.java (renamed from src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/RMIMessage.java)15
-rw-r--r--src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/RequestStateMessage.java16
2 files changed, 29 insertions, 2 deletions
diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/RMIMessage.java b/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/RemikMessage.java
index a8e3afb..b0300cb 100644
--- a/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/RMIMessage.java
+++ b/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/RemikMessage.java
@@ -3,9 +3,20 @@ package pl.edu.mimuw.cloudatlas.agent.messages;
import pl.edu.mimuw.cloudatlas.agent.modules.Module;
import pl.edu.mimuw.cloudatlas.agent.modules.ModuleType;
-public class RMIMessage extends AgentMessage {
- public RMIMessage(String messageId, long timestamp) {
+public abstract class RemikMessage extends AgentMessage {
+ public enum Type {
+ REQUEST_STATE
+ }
+
+ private Type type;
+
+ public RemikMessage(String messageId, long timestamp, Type type) {
super(messageId, ModuleType.RMI, timestamp);
+ this.type = type;
+ }
+
+ public Type getType() {
+ return type;
}
public void callMe(Module module) throws InterruptedException, Module.InvalidMessageType {
diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/RequestStateMessage.java b/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/RequestStateMessage.java
new file mode 100644
index 0000000..698aac7
--- /dev/null
+++ b/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/RequestStateMessage.java
@@ -0,0 +1,16 @@
+package pl.edu.mimuw.cloudatlas.agent.messages;
+
+import java.util.concurrent.CompletableFuture;
+
+public class RequestStateMessage extends RemikMessage {
+ CompletableFuture<ResponseMessage> responseFuture;
+
+ public RequestStateMessage(String messageId, long timestamp, CompletableFuture<ResponseMessage> responseFuture) {
+ super(messageId, timestamp, Type.REQUEST_STATE);
+ this.responseFuture = responseFuture;
+ }
+
+ public CompletableFuture<ResponseMessage> getFuture() {
+ return responseFuture;
+ }
+}