m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages
diff options
context:
space:
mode:
authorMagdalena GrodziƄska <mag.grodzinska@gmail.com>2020-01-06 18:28:13 +0100
committerGitHub <noreply@github.com>2020-01-06 18:28:13 +0100
commit2feff1aa41c41008fcda2dd60c718cf09deb3fa1 (patch)
tree36c774a7b2cda6ace2d4510267d09ef0e0bba6d8 /src/main/java/pl/edu/mimuw/cloudatlas/agent/messages
parentedd8c9d09b89a68a0d654dd6b08dc23a22d50293 (diff)
parent360cb66d187b64ae51c792d87d0d425e73b48d0a (diff)
Merge pull request #86 from m-chrzan/UDUP
Udup
Diffstat (limited to 'src/main/java/pl/edu/mimuw/cloudatlas/agent/messages')
-rw-r--r--src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/UDUPMessage.java45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/UDUPMessage.java b/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/UDUPMessage.java
new file mode 100644
index 0000000..fa8d1fa
--- /dev/null
+++ b/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/UDUPMessage.java
@@ -0,0 +1,45 @@
+package pl.edu.mimuw.cloudatlas.agent.messages;
+
+import pl.edu.mimuw.cloudatlas.agent.modules.Module;
+import pl.edu.mimuw.cloudatlas.agent.modules.ModuleType;
+import pl.edu.mimuw.cloudatlas.model.ValueContact;
+
+public class UDUPMessage extends AgentMessage {
+ private ValueContact contact;
+ private AgentMessage content;
+
+ public UDUPMessage(String messageId, long timestamp, ValueContact contact, AgentMessage content) {
+ super(messageId, ModuleType.UDP, timestamp);
+ this.contact = contact;
+ this.content = content;
+ }
+
+ public UDUPMessage(String messageId, ValueContact contact, AgentMessage content) {
+ super(messageId, ModuleType.UDP);
+ this.contact = contact;
+ this.content = content;
+ }
+
+ public UDUPMessage() {
+ super("", ModuleType.UDP);
+ }
+
+ @Override
+ public void callMe(Module module) throws InterruptedException, Module.InvalidMessageType {
+ module.handleTyped(this);
+ }
+
+ public AgentMessage getContent() {
+ return content;
+ }
+
+ public void setContent(AgentMessage content) {
+ this.content = content;
+ }
+
+ public ValueContact getContact() { return contact; }
+
+ public void setContact(ValueContact contact) {
+ this.contact = contact;
+ }
+}