diff options
Diffstat (limited to 'same/src/main')
-rw-r--r-- | same/src/main/java/com/orbekk/same/Client.java | 4 | ||||
-rw-r--r-- | same/src/main/java/com/orbekk/util/DelayedOperation.java | 12 |
2 files changed, 15 insertions, 1 deletions
diff --git a/same/src/main/java/com/orbekk/same/Client.java b/same/src/main/java/com/orbekk/same/Client.java index b18f523..d035881 100644 --- a/same/src/main/java/com/orbekk/same/Client.java +++ b/same/src/main/java/com/orbekk/same/Client.java @@ -44,7 +44,9 @@ public class Client implements DiscoveryListener { boolean success = master.updateStateRequest( component.getName(), component.getData(), component.getRevision()); - if (!success) { + if (success) { + op.complete(DelayedOperation.Status.createOk()); + } else { op.complete(DelayedOperation.Status .createConflict("Conflict from master")); } diff --git a/same/src/main/java/com/orbekk/util/DelayedOperation.java b/same/src/main/java/com/orbekk/util/DelayedOperation.java index 21215e7..c423a7d 100644 --- a/same/src/main/java/com/orbekk/util/DelayedOperation.java +++ b/same/src/main/java/com/orbekk/util/DelayedOperation.java @@ -26,6 +26,18 @@ public class DelayedOperation { this.message = message; } + public boolean isOk() { + return status == OK; + } + + public int getStatusCode() { + return status; + } + + public String getMessage() { + return message; + } + @Override public String toString() { switch(status) { case OK: |