From 219431065b335fdf250394ba66da8220d9bb868f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magdalena=20Grodzi=C5=84ska?= Date: Mon, 23 Dec 2019 19:54:24 +0100 Subject: Rename messages package --- .../java/pl/edu/mimuw/cloudatlas/agent/Agent.java | 2 +- .../pl/edu/mimuw/cloudatlas/agent/EventBus.java | 2 +- .../pl/edu/mimuw/cloudatlas/agent/Executor.java | 2 +- .../cloudatlas/agent/message/AgentMessage.java | 57 ---------------------- .../agent/message/TimerSchedulerMessage.java | 46 ----------------- .../cloudatlas/agent/messages/AgentMessage.java | 57 ++++++++++++++++++++++ .../agent/messages/TimerSchedulerMessage.java | 46 +++++++++++++++++ .../edu/mimuw/cloudatlas/agent/modules/Module.java | 2 +- .../cloudatlas/agent/modules/TimerScheduler.java | 4 +- 9 files changed, 109 insertions(+), 109 deletions(-) delete mode 100644 src/main/java/pl/edu/mimuw/cloudatlas/agent/message/AgentMessage.java delete mode 100644 src/main/java/pl/edu/mimuw/cloudatlas/agent/message/TimerSchedulerMessage.java create mode 100644 src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/AgentMessage.java create mode 100644 src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/TimerSchedulerMessage.java (limited to 'src/main/java/pl/edu/mimuw/cloudatlas') diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/agent/Agent.java b/src/main/java/pl/edu/mimuw/cloudatlas/agent/Agent.java index e695773..4bd522d 100644 --- a/src/main/java/pl/edu/mimuw/cloudatlas/agent/Agent.java +++ b/src/main/java/pl/edu/mimuw/cloudatlas/agent/Agent.java @@ -8,7 +8,7 @@ import java.util.HashMap; import java.util.Iterator; import java.util.Map; -import pl.edu.mimuw.cloudatlas.agent.message.AgentMessage; +import pl.edu.mimuw.cloudatlas.agent.messages.AgentMessage; import pl.edu.mimuw.cloudatlas.agent.modules.Module; import pl.edu.mimuw.cloudatlas.api.Api; import pl.edu.mimuw.cloudatlas.interpreter.Main; diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/agent/EventBus.java b/src/main/java/pl/edu/mimuw/cloudatlas/agent/EventBus.java index afb4e27..8cdda62 100644 --- a/src/main/java/pl/edu/mimuw/cloudatlas/agent/EventBus.java +++ b/src/main/java/pl/edu/mimuw/cloudatlas/agent/EventBus.java @@ -1,6 +1,6 @@ package pl.edu.mimuw.cloudatlas.agent; -import pl.edu.mimuw.cloudatlas.agent.message.AgentMessage; +import pl.edu.mimuw.cloudatlas.agent.messages.AgentMessage; import java.util.HashMap; import java.util.Iterator; diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/agent/Executor.java b/src/main/java/pl/edu/mimuw/cloudatlas/agent/Executor.java index 6d29d13..6ebf6a6 100644 --- a/src/main/java/pl/edu/mimuw/cloudatlas/agent/Executor.java +++ b/src/main/java/pl/edu/mimuw/cloudatlas/agent/Executor.java @@ -2,7 +2,7 @@ package pl.edu.mimuw.cloudatlas.agent; import java.util.concurrent.LinkedBlockingQueue; -import pl.edu.mimuw.cloudatlas.agent.message.AgentMessage; +import pl.edu.mimuw.cloudatlas.agent.messages.AgentMessage; import pl.edu.mimuw.cloudatlas.agent.modules.Module; /* 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 deleted file mode 100644 index 6e8f51c..0000000 --- a/src/main/java/pl/edu/mimuw/cloudatlas/agent/message/AgentMessage.java +++ /dev/null @@ -1,57 +0,0 @@ -package pl.edu.mimuw.cloudatlas.agent.message; - -import pl.edu.mimuw.cloudatlas.agent.Agent; - -public class AgentMessage { - - public enum AgentModule { - TIMER_SCHEDULER, - TIMER_GTP, - RMI, - UDP, - GOSSIP_IN, - GOSSIP_OUT, - STATE, - QUERY - } - - private String messageId; - private AgentModule destinationModule; - private long timestamp; - - public AgentMessage(String messageId, AgentModule destinationModule, long timestamp) { - this.messageId = messageId; - this.destinationModule = destinationModule; - 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; - } - - public void setMessageId(String messageId) { - this.messageId = messageId; - } - - public AgentModule getDestinationModule() { - return destinationModule; - } - - public void setDestinationModule(AgentModule destinationModule) { - this.destinationModule = destinationModule; - } - - public long getTimestamp() { - return timestamp; - } - - public void setTimestamp(long timestamp) { - this.timestamp = timestamp; - } -} diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/agent/message/TimerSchedulerMessage.java b/src/main/java/pl/edu/mimuw/cloudatlas/agent/message/TimerSchedulerMessage.java deleted file mode 100644 index 9743533..0000000 --- a/src/main/java/pl/edu/mimuw/cloudatlas/agent/message/TimerSchedulerMessage.java +++ /dev/null @@ -1,46 +0,0 @@ -package pl.edu.mimuw.cloudatlas.agent.message; - -import java.util.TimerTask; - -public class TimerSchedulerMessage extends AgentMessage { - private String requestId; - private long delay; - private long baseTime; - private TimerTask task; - - public TimerSchedulerMessage(String messageId, AgentModule destinationModule, long timestamp, String requestId, long delay, long baseTime, TimerTask task) { - super(messageId, destinationModule, timestamp); - this.requestId = requestId; - this.delay = delay; - this.baseTime = baseTime; - this.task = task; - } - - public long getDelay() { - return delay; - } - - public void setDelay(long delay) { - this.delay = delay; - } - - public long getBaseTime() { - return baseTime; - } - - public void setBaseTime(long baseTime) { - this.baseTime = baseTime; - } - - public TimerTask getTask() { - return task; - } - - public void setTask(TimerTask task) { - this.task = task; - } - - public String getRequestId() { return requestId; } - - public void setRequestId(String requestId) { this.requestId = requestId; } -} diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/AgentMessage.java b/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/AgentMessage.java new file mode 100644 index 0000000..4f5a69c --- /dev/null +++ b/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/AgentMessage.java @@ -0,0 +1,57 @@ +package pl.edu.mimuw.cloudatlas.agent.messages; + +import pl.edu.mimuw.cloudatlas.agent.Agent; + +public class AgentMessage { + + public enum AgentModule { + TIMER_SCHEDULER, + TIMER_GTP, + RMI, + UDP, + GOSSIP_IN, + GOSSIP_OUT, + STATE, + QUERY + } + + private String messageId; + private AgentModule destinationModule; + private long timestamp; + + public AgentMessage(String messageId, AgentModule destinationModule, long timestamp) { + this.messageId = messageId; + this.destinationModule = destinationModule; + 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; + } + + public void setMessageId(String messageId) { + this.messageId = messageId; + } + + public AgentModule getDestinationModule() { + return destinationModule; + } + + public void setDestinationModule(AgentModule destinationModule) { + this.destinationModule = destinationModule; + } + + public long getTimestamp() { + return timestamp; + } + + public void setTimestamp(long timestamp) { + this.timestamp = timestamp; + } +} diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/TimerSchedulerMessage.java b/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/TimerSchedulerMessage.java new file mode 100644 index 0000000..23ec700 --- /dev/null +++ b/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/TimerSchedulerMessage.java @@ -0,0 +1,46 @@ +package pl.edu.mimuw.cloudatlas.agent.messages; + +import java.util.TimerTask; + +public class TimerSchedulerMessage extends AgentMessage { + private String requestId; + private long delay; + private long baseTime; + private TimerTask task; + + public TimerSchedulerMessage(String messageId, AgentModule destinationModule, long timestamp, String requestId, long delay, long baseTime, TimerTask task) { + super(messageId, destinationModule, timestamp); + this.requestId = requestId; + this.delay = delay; + this.baseTime = baseTime; + this.task = task; + } + + public long getDelay() { + return delay; + } + + public void setDelay(long delay) { + this.delay = delay; + } + + public long getBaseTime() { + return baseTime; + } + + public void setBaseTime(long baseTime) { + this.baseTime = baseTime; + } + + public TimerTask getTask() { + return task; + } + + public void setTask(TimerTask task) { + this.task = task; + } + + public String getRequestId() { return requestId; } + + public void setRequestId(String requestId) { this.requestId = requestId; } +} diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/agent/modules/Module.java b/src/main/java/pl/edu/mimuw/cloudatlas/agent/modules/Module.java index dd6a5f8..04d002d 100644 --- a/src/main/java/pl/edu/mimuw/cloudatlas/agent/modules/Module.java +++ b/src/main/java/pl/edu/mimuw/cloudatlas/agent/modules/Module.java @@ -1,7 +1,7 @@ package pl.edu.mimuw.cloudatlas.agent.modules; import pl.edu.mimuw.cloudatlas.agent.Executor; -import pl.edu.mimuw.cloudatlas.agent.message.AgentMessage; +import pl.edu.mimuw.cloudatlas.agent.messages.AgentMessage; /* * A Module is a (potentially stateful) event handler. diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/agent/modules/TimerScheduler.java b/src/main/java/pl/edu/mimuw/cloudatlas/agent/modules/TimerScheduler.java index b7ce435..8f6c2f0 100644 --- a/src/main/java/pl/edu/mimuw/cloudatlas/agent/modules/TimerScheduler.java +++ b/src/main/java/pl/edu/mimuw/cloudatlas/agent/modules/TimerScheduler.java @@ -1,7 +1,7 @@ package pl.edu.mimuw.cloudatlas.agent.modules; -import pl.edu.mimuw.cloudatlas.agent.message.AgentMessage; -import pl.edu.mimuw.cloudatlas.agent.message.TimerSchedulerMessage; +import pl.edu.mimuw.cloudatlas.agent.messages.AgentMessage; +import pl.edu.mimuw.cloudatlas.agent.messages.TimerSchedulerMessage; import java.util.Timer; import java.util.TimerTask; -- cgit v1.2.3