From 1f87c2d319b2671bd2d61feb3a76d102059c4c52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magdalena=20Grodzi=C5=84ska?= Date: Fri, 10 Jan 2020 19:06:26 +0100 Subject: Make UDUP handle only gossip girl messages with its timestamps --- .../edu/mimuw/cloudatlas/agent/messages/GossipGirlMessage.java | 2 ++ .../cloudatlas/agent/messages/RemoteGossipGirlMessage.java | 2 ++ .../pl/edu/mimuw/cloudatlas/agent/messages/UDUPMessage.java | 10 +++++----- 3 files changed, 9 insertions(+), 5 deletions(-) (limited to 'src/main/java/pl/edu/mimuw/cloudatlas/agent/messages') diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/GossipGirlMessage.java b/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/GossipGirlMessage.java index 508fe88..03525bb 100644 --- a/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/GossipGirlMessage.java +++ b/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/GossipGirlMessage.java @@ -19,6 +19,8 @@ public abstract class GossipGirlMessage extends AgentMessage { this.type = type; } + public GossipGirlMessage() {}; + public Type getType() { return type; } diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/RemoteGossipGirlMessage.java b/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/RemoteGossipGirlMessage.java index 0a3a868..4c223f5 100644 --- a/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/RemoteGossipGirlMessage.java +++ b/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/RemoteGossipGirlMessage.java @@ -10,6 +10,8 @@ public class RemoteGossipGirlMessage extends GossipGirlMessage { super(messageId, timestamp, type); } + public RemoteGossipGirlMessage() {}; + public void setSentTimestamp(ValueTime sentTimestamp) { this.sentTimestamp = sentTimestamp; } 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 index 3751b3c..b955340 100644 --- a/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/UDUPMessage.java +++ b/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/UDUPMessage.java @@ -6,15 +6,15 @@ import pl.edu.mimuw.cloudatlas.model.ValueContact; public class UDUPMessage extends AgentMessage { private ValueContact contact; - private AgentMessage content; + private RemoteGossipGirlMessage content; - public UDUPMessage(String messageId, long timestamp, ValueContact contact, AgentMessage content) { + public UDUPMessage(String messageId, long timestamp, ValueContact contact, RemoteGossipGirlMessage content) { super(messageId, ModuleType.UDP, timestamp); this.contact = contact; this.content = content; } - public UDUPMessage(String messageId, ValueContact contact, AgentMessage content) { + public UDUPMessage(String messageId, ValueContact contact, RemoteGossipGirlMessage content) { super(messageId, ModuleType.UDP); this.contact = contact; this.content = content; @@ -27,11 +27,11 @@ public class UDUPMessage extends AgentMessage { module.handleTyped(this); } - public AgentMessage getContent() { + public RemoteGossipGirlMessage getContent() { return content; } - public void setContent(AgentMessage content) { + public void setContent(RemoteGossipGirlMessage content) { this.content = content; } -- cgit v1.2.3