summaryrefslogtreecommitdiff
path: root/same/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'same/src/main/java')
-rw-r--r--same/src/main/java/com/orbekk/same/Client.java1
-rw-r--r--same/src/main/java/com/orbekk/same/ClientInterface.java1
-rw-r--r--same/src/main/java/com/orbekk/same/State.java3
-rw-r--r--same/src/main/java/com/orbekk/same/VariableFactory.java4
4 files changed, 5 insertions, 4 deletions
diff --git a/same/src/main/java/com/orbekk/same/Client.java b/same/src/main/java/com/orbekk/same/Client.java
index b496aac..d29147b 100644
--- a/same/src/main/java/com/orbekk/same/Client.java
+++ b/same/src/main/java/com/orbekk/same/Client.java
@@ -32,7 +32,6 @@ public class Client implements DiscoveryListener {
return new State(state);
}
- @Override
public void set(String name, String data, long revision)
throws UpdateConflict {
String masterUrl = state.getDataOf(".masterUrl");
diff --git a/same/src/main/java/com/orbekk/same/ClientInterface.java b/same/src/main/java/com/orbekk/same/ClientInterface.java
index 4b4c731..c534fce 100644
--- a/same/src/main/java/com/orbekk/same/ClientInterface.java
+++ b/same/src/main/java/com/orbekk/same/ClientInterface.java
@@ -2,7 +2,6 @@ package com.orbekk.same;
public interface ClientInterface {
State getState();
- void set(String name, String data, long revision) throws UpdateConflict;
void set(State.Component component) throws UpdateConflict;
void addStateListener(StateChangedListener listener);
void removeStateListener(StateChangedListener listener);
diff --git a/same/src/main/java/com/orbekk/same/State.java b/same/src/main/java/com/orbekk/same/State.java
index 627f79e..2b48a00 100644
--- a/same/src/main/java/com/orbekk/same/State.java
+++ b/same/src/main/java/com/orbekk/same/State.java
@@ -234,7 +234,8 @@ public class State {
return false;
}
Component o = (Component)other;
- return name == o.name && data == o.data && revision == o.revision;
+ return name.equals(o.name) && data.equals(o.data) &&
+ revision == o.revision;
}
}
diff --git a/same/src/main/java/com/orbekk/same/VariableFactory.java b/same/src/main/java/com/orbekk/same/VariableFactory.java
index 8c786c0..3f3b19c 100644
--- a/same/src/main/java/com/orbekk/same/VariableFactory.java
+++ b/same/src/main/java/com/orbekk/same/VariableFactory.java
@@ -40,7 +40,9 @@ public class VariableFactory {
public void set(T value) throws UpdateConflict {
try {
String serializedValue = mapper.writeValueAsString(value);
- client.set(identifier, serializedValue, revision);
+ State.Component update = new State.Component(identifier,
+ revision, serializedValue);
+ client.set(update);
} catch (JsonGenerationException e) {
logger.warn("Failed to convert to JSON: {}", value);
logger.warn("Parse exception.", e);