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-05 18:00:56 +0100
committerMagdalena Grodzińska <mag.grodzinska@gmail.com>2020-01-05 18:00:56 +0100
commitbfd4c421004ce35a9eac307c3ac4976caa1820ae (patch)
treebcae85fc193c2c1cd8f410821ae10f66f9b18093 /src/main/java/pl/edu/mimuw/cloudatlas/agent/messages
parent69480d460a698a78b90d8d111f5fb4d761ffda81 (diff)
UDUP with no serialization working
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.java61
1 files changed, 61 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..335d6fe
--- /dev/null
+++ b/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/UDUPMessage.java
@@ -0,0 +1,61 @@
+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;
+ private int retry;
+ private String conversationId;
+
+ public UDUPMessage(String messageId, long timestamp, ValueContact contact, AgentMessage content, int retry, String conversationId) {
+ super(messageId, ModuleType.UDP, timestamp);
+ this.contact = contact;
+ this.content = content;
+ this.retry = retry;
+ this.conversationId = conversationId;
+ }
+
+ public UDUPMessage(String messageId, ValueContact contact, AgentMessage content, int retry, String conversationId) {
+ super(messageId, ModuleType.UDP);
+ this.contact = contact;
+ this.content = content;
+ this.retry = retry;
+ this.conversationId = conversationId;
+ }
+
+ @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 int getRetry() {
+ return retry;
+ }
+
+ public String getConversationId() {
+ return conversationId;
+ }
+
+ public void setRetry(int retry) { this.retry = retry; }
+
+ public ValueContact getContact() { return contact; }
+
+ public void setContact(ValueContact contact) {
+ this.contact = contact;
+ }
+
+ public void setConversationId(String conversationId) {
+ this.conversationId = conversationId;
+ }
+}