m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMagdalena Grodzińska <mag.grodzinska@gmail.com>2019-12-23 19:08:08 +0100
committerMagdalena Grodzińska <mag.grodzinska@gmail.com>2019-12-23 19:08:08 +0100
commitb88b2866f5731491f1e7957a678559a1922c983a (patch)
tree76a297248aac9616aea4248a828738d8f385854e /src
parent6af48bd213350954914e899b2bf23ebd0da5ed22 (diff)
Add simple message constructor
Diffstat (limited to 'src')
-rw-r--r--src/main/java/pl/edu/mimuw/cloudatlas/agent/message/AgentMessage.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/agent/message/AgentMessage.java b/src/main/java/pl/edu/mimuw/cloudatlas/agent/message/AgentMessage.java
index ab24f48..6e8f51c 100644
--- a/src/main/java/pl/edu/mimuw/cloudatlas/agent/message/AgentMessage.java
+++ b/src/main/java/pl/edu/mimuw/cloudatlas/agent/message/AgentMessage.java
@@ -1,5 +1,7 @@
package pl.edu.mimuw.cloudatlas.agent.message;
+import pl.edu.mimuw.cloudatlas.agent.Agent;
+
public class AgentMessage {
public enum AgentModule {
@@ -23,6 +25,12 @@ public class AgentMessage {
this.timestamp = timestamp;
}
+ public AgentMessage(String messageId, AgentModule destinationModule) {
+ this.messageId = messageId;
+ this.destinationModule = destinationModule;
+ this.timestamp = System.currentTimeMillis() / 1000L;
+ }
+
public String getMessageId() {
return messageId;
}