summaryrefslogtreecommitdiff
path: root/same/src/main
diff options
context:
space:
mode:
authorKjetil Ørbekk <kjetil.orbekk@gmail.com>2012-02-26 13:25:43 +0100
committerKjetil Ørbekk <kjetil.orbekk@gmail.com>2012-02-26 13:25:43 +0100
commit930596730c3df733dc5c5601579fd044f55682c8 (patch)
treea6108932b2299a7713ed31d4815fd631278fe42b /same/src/main
parentb5c462b2ae88623a3fc759ab073f1b27346b851f (diff)
Support setting state on Android.
Diffstat (limited to 'same/src/main')
-rw-r--r--same/src/main/java/com/orbekk/same/Client.java7
-rw-r--r--same/src/main/java/com/orbekk/same/ClientInterface.java1
2 files changed, 8 insertions, 0 deletions
diff --git a/same/src/main/java/com/orbekk/same/Client.java b/same/src/main/java/com/orbekk/same/Client.java
index 244a64d..b496aac 100644
--- a/same/src/main/java/com/orbekk/same/Client.java
+++ b/same/src/main/java/com/orbekk/same/Client.java
@@ -9,6 +9,7 @@ import org.codehaus.jackson.type.TypeReference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import com.orbekk.same.State.Component;
import com.orbekk.util.WorkQueue;
public class Client implements DiscoveryListener {
@@ -50,6 +51,12 @@ public class Client implements DiscoveryListener {
}
@Override
+ public void set(Component component) throws UpdateConflict {
+ set(component.getName(), component.getData(),
+ component.getRevision());
+ }
+
+ @Override
public void addStateListener(StateChangedListener listener) {
stateListeners.add(listener);
}
diff --git a/same/src/main/java/com/orbekk/same/ClientInterface.java b/same/src/main/java/com/orbekk/same/ClientInterface.java
index 99adf21..4b4c731 100644
--- a/same/src/main/java/com/orbekk/same/ClientInterface.java
+++ b/same/src/main/java/com/orbekk/same/ClientInterface.java
@@ -3,6 +3,7 @@ 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);
} \ No newline at end of file