diff options
author | Marcin Chrzanowski <marcin.j.chrzanowski@gmail.com> | 2019-12-29 14:12:31 +0100 |
---|---|---|
committer | Marcin Chrzanowski <marcin.j.chrzanowski@gmail.com> | 2019-12-29 14:12:31 +0100 |
commit | af6f6f37403d0e23a09a6ba4476271c2a0eaf623 (patch) | |
tree | 1b28c18d8dc4adffc24ea8baa762adad9e0b9d57 /src/main/java/pl/edu/mimuw/cloudatlas/agent/messages | |
parent | 8e0aed0711a26fec5c0497cee9777744f1d48663 (diff) |
Include timestamped queries in state
Diffstat (limited to 'src/main/java/pl/edu/mimuw/cloudatlas/agent/messages')
-rw-r--r-- | src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/GetStateMessage.java (renamed from src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/GetHierarchyMessage.java) | 6 | ||||
-rw-r--r-- | src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/HierarchyMessage.java | 17 | ||||
-rw-r--r-- | src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/ResponseMessage.java | 2 | ||||
-rw-r--r-- | src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/StanikMessage.java | 2 | ||||
-rw-r--r-- | src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/StateMessage.java | 29 |
5 files changed, 34 insertions, 22 deletions
diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/GetHierarchyMessage.java b/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/GetStateMessage.java index d3c749d..63392e8 100644 --- a/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/GetHierarchyMessage.java +++ b/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/GetStateMessage.java @@ -2,12 +2,12 @@ package pl.edu.mimuw.cloudatlas.agent.messages; import pl.edu.mimuw.cloudatlas.agent.modules.ModuleType; -public class GetHierarchyMessage extends StanikMessage { +public class GetStateMessage extends StanikMessage { private ModuleType requestingModule; private long requestId; - public GetHierarchyMessage(String messageId, long timestamp, ModuleType requestingModule, long requestId) { - super(messageId, timestamp, Type.GET_HIERARCHY); + public GetStateMessage(String messageId, long timestamp, ModuleType requestingModule, long requestId) { + super(messageId, timestamp, Type.GET_STATE); this.requestingModule = requestingModule; this.requestId = requestId; } diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/HierarchyMessage.java b/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/HierarchyMessage.java deleted file mode 100644 index 9f7ca70..0000000 --- a/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/HierarchyMessage.java +++ /dev/null @@ -1,17 +0,0 @@ -package pl.edu.mimuw.cloudatlas.agent.messages; - -import pl.edu.mimuw.cloudatlas.agent.modules.ModuleType; -import pl.edu.mimuw.cloudatlas.model.ZMI; - -public class HierarchyMessage extends ResponseMessage { - private ZMI zmi; - - public HierarchyMessage(String messageId, ModuleType destinationModule, long timestamp, long requestId, ZMI zmi) { - super(messageId, destinationModule, timestamp, Type.HIERARCHY, requestId); - this.zmi = zmi; - } - - public ZMI getZMI() { - return zmi; - } -} diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/ResponseMessage.java b/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/ResponseMessage.java index 171cf07..02b3337 100644 --- a/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/ResponseMessage.java +++ b/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/ResponseMessage.java @@ -5,7 +5,7 @@ import pl.edu.mimuw.cloudatlas.agent.modules.ModuleType; public abstract class ResponseMessage extends AgentMessage { public enum Type { - HIERARCHY + STATE } Type type; diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/StanikMessage.java b/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/StanikMessage.java index 8661c90..da35f2d 100644 --- a/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/StanikMessage.java +++ b/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/StanikMessage.java @@ -5,7 +5,7 @@ import pl.edu.mimuw.cloudatlas.agent.modules.ModuleType; public abstract class StanikMessage extends AgentMessage { public enum Type { - GET_HIERARCHY, + GET_STATE, UPDATE_ATTRIBUTES } diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/StateMessage.java b/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/StateMessage.java new file mode 100644 index 0000000..f7f490b --- /dev/null +++ b/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/StateMessage.java @@ -0,0 +1,29 @@ +package pl.edu.mimuw.cloudatlas.agent.messages; + +import java.util.Map; +import java.util.Map.Entry; + +import pl.edu.mimuw.cloudatlas.agent.modules.ModuleType; +import pl.edu.mimuw.cloudatlas.model.Attribute; +import pl.edu.mimuw.cloudatlas.model.ValueQuery; +import pl.edu.mimuw.cloudatlas.model.ValueTime; +import pl.edu.mimuw.cloudatlas.model.ZMI; + +public class StateMessage extends ResponseMessage { + private ZMI zmi; + private Map<Attribute, Entry<ValueQuery, ValueTime>> queries; + + public StateMessage(String messageId, ModuleType destinationModule, long timestamp, long requestId, ZMI zmi, Map<Attribute, Entry<ValueQuery, ValueTime>> queries) { + super(messageId, destinationModule, timestamp, Type.STATE, requestId); + this.zmi = zmi; + this.queries = queries; + } + + public ZMI getZMI() { + return zmi; + } + + public Map<Attribute, Entry<ValueQuery, ValueTime>> getQueries() { + return queries; + } +} |