m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages
diff options
context:
space:
mode:
authorMarcin Chrzanowski <marcin.j.chrzanowski@gmail.com>2019-12-31 17:31:38 +0100
committerMarcin Chrzanowski <marcin.j.chrzanowski@gmail.com>2019-12-31 17:32:33 +0100
commiteb7fbbd08bb003a47d9788a9f6476695ab46b271 (patch)
tree7bdd6f9a29877345e538b1cebb99277fa1aa41d4 /src/main/java/pl/edu/mimuw/cloudatlas/agent/messages
parent17d87268246d32a75407590f8fef118148b87ccd (diff)
Add message to set a single attribute
Diffstat (limited to 'src/main/java/pl/edu/mimuw/cloudatlas/agent/messages')
-rw-r--r--src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/SetAttributeMessage.java37
-rw-r--r--src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/StanikMessage.java1
2 files changed, 38 insertions, 0 deletions
diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/SetAttributeMessage.java b/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/SetAttributeMessage.java
new file mode 100644
index 0000000..4888484
--- /dev/null
+++ b/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/SetAttributeMessage.java
@@ -0,0 +1,37 @@
+package pl.edu.mimuw.cloudatlas.agent.messages;
+
+import pl.edu.mimuw.cloudatlas.agent.modules.ModuleType;
+import pl.edu.mimuw.cloudatlas.model.Attribute;
+import pl.edu.mimuw.cloudatlas.model.Value;
+import pl.edu.mimuw.cloudatlas.model.ValueTime;
+
+public class SetAttributeMessage extends StanikMessage {
+ private String pathName;
+ private Attribute attribute;
+ private Value value;
+ private ValueTime updateTimestamp;
+
+ public SetAttributeMessage(String messageId, long timestamp, String pathName, Attribute attribute, Value value, ValueTime updateTimestamp) {
+ super(messageId, timestamp, Type.SET_ATTRIBUTE);
+ this.pathName = pathName;
+ this.attribute = attribute;
+ this.value = value;
+ this.updateTimestamp = updateTimestamp;
+ }
+
+ public String getPathName() {
+ return pathName;
+ }
+
+ public Attribute getAttribute() {
+ return attribute;
+ }
+
+ public Value getValue() {
+ return value;
+ }
+
+ public ValueTime getUpdateTimestamp() {
+ return updateTimestamp;
+ }
+}
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 d86de4a..844f31c 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
@@ -7,6 +7,7 @@ public abstract class StanikMessage extends AgentMessage {
public enum Type {
GET_STATE,
REMOVE_ZMI,
+ SET_ATTRIBUTE,
UPDATE_ATTRIBUTES,
UPDATE_QUERIES
}