From 7b03effca945dea607ed7a3c3debebda303992ab Mon Sep 17 00:00:00 2001
From: Arnstein Ressem This class is the factory for creating the four session types mentioned above. There may be multiple implementations of the document api classes. If
- * default configuration is sufficient, simply inject a {@code DocumentAccess} to
- * obtain a running document access. If you instead create a concrete implementation, note that
- * there are running threads within an access object, so you must shut it down when done.
An implementation of the Document Api may support just a subset of the * access types defined in this interface. For example, some document diff --git a/documentapi/src/main/java/com/yahoo/documentapi/RemoveResponse.java b/documentapi/src/main/java/com/yahoo/documentapi/RemoveResponse.java index 2a7c6f45d95..502588a3d5f 100644 --- a/documentapi/src/main/java/com/yahoo/documentapi/RemoveResponse.java +++ b/documentapi/src/main/java/com/yahoo/documentapi/RemoveResponse.java @@ -12,7 +12,7 @@ public class RemoveResponse extends Response { private final boolean wasFound; public RemoveResponse(long requestId, boolean wasFound) { - super(requestId, null, wasFound ? Outcome.SUCCESS : Outcome.NOT_FOUND); + super(requestId); this.wasFound = wasFound; } @@ -20,10 +20,6 @@ public class RemoveResponse extends Response { return wasFound; } - @Override - // TODO: fix this when/if NOT_FOUND is no longer a success. - public boolean isSuccess() { return super.isSuccess() || outcome() == Outcome.NOT_FOUND; } - @Override public int hashCode() { return super.hashCode() + Boolean.valueOf(wasFound).hashCode(); diff --git a/documentapi/src/main/java/com/yahoo/documentapi/UpdateResponse.java b/documentapi/src/main/java/com/yahoo/documentapi/UpdateResponse.java index aca34a92a30..96bf58c1e64 100644 --- a/documentapi/src/main/java/com/yahoo/documentapi/UpdateResponse.java +++ b/documentapi/src/main/java/com/yahoo/documentapi/UpdateResponse.java @@ -12,7 +12,7 @@ public class UpdateResponse extends Response { private final boolean wasFound; public UpdateResponse(long requestId, boolean wasFound) { - super(requestId, null, wasFound ? Outcome.SUCCESS : Outcome.NOT_FOUND); + super(requestId); this.wasFound = wasFound; } @@ -20,10 +20,6 @@ public class UpdateResponse extends Response { return wasFound; } - @Override - // TODO: fix this when/if NOT_FOUND is no longer a success. - public boolean isSuccess() { return super.isSuccess() || outcome() == Outcome.NOT_FOUND; } - @Override public int hashCode() { return super.hashCode() + Boolean.valueOf(wasFound).hashCode(); -- cgit v1.2.3