diff options
author | Magdalena Grodzińska <mag.grodzinska@gmail.com> | 2019-12-23 19:08:08 +0100 |
---|---|---|
committer | Magdalena Grodzińska <mag.grodzinska@gmail.com> | 2019-12-23 19:08:08 +0100 |
commit | b88b2866f5731491f1e7957a678559a1922c983a (patch) | |
tree | 76a297248aac9616aea4248a828738d8f385854e | |
parent | 6af48bd213350954914e899b2bf23ebd0da5ed22 (diff) |
Add simple message constructor
-rw-r--r-- | src/main/java/pl/edu/mimuw/cloudatlas/agent/message/AgentMessage.java | 8 |
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; } |