m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/pl/edu/mimuw/cloudatlas/agent/messages')
-rw-r--r--src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/AgentMessage.java5
-rw-r--r--src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/TimerSchedulerMessage.java5
2 files changed, 8 insertions, 2 deletions
diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/AgentMessage.java b/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/AgentMessage.java
index ba15a7a..b71831f 100644
--- a/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/AgentMessage.java
+++ b/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/AgentMessage.java
@@ -1,7 +1,6 @@
package pl.edu.mimuw.cloudatlas.agent.messages;
-public class AgentMessage {
- public AgentModule correctType;
+public abstract class AgentMessage {
public enum AgentModule {
TIMER_SCHEDULER,
@@ -30,6 +29,8 @@ public class AgentMessage {
this.timestamp = System.currentTimeMillis() / 1000L;
}
+ public abstract AgentModule getCorrectMessageType();
+
public String getMessageId() {
return messageId;
}
diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/TimerSchedulerMessage.java b/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/TimerSchedulerMessage.java
index 23ec700..9a558b7 100644
--- a/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/TimerSchedulerMessage.java
+++ b/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/TimerSchedulerMessage.java
@@ -43,4 +43,9 @@ public class TimerSchedulerMessage extends AgentMessage {
public String getRequestId() { return requestId; }
public void setRequestId(String requestId) { this.requestId = requestId; }
+
+ @Override
+ public AgentModule getCorrectMessageType() {
+ return AgentModule.TIMER_SCHEDULER;
+ }
}