summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHåkon Hallingstad <hakon@verizonmedia.com>2020-06-08 18:04:06 +0200
committerHåkon Hallingstad <hakon@verizonmedia.com>2020-06-08 18:04:06 +0200
commit51484604317a7381c28fa0f2a5dbe3f6e6364408 (patch)
tree4e58d445696ab4ff7ac4c1396a79ac34e50ba496
parent9a23511e5729c8cdfeaf11fcd061a327ded1e910 (diff)
Update return and throws javadoc for SyncSession::update
-rwxr-xr-xdocumentapi/src/main/java/com/yahoo/documentapi/SyncSession.java15
1 files changed, 11 insertions, 4 deletions
diff --git a/documentapi/src/main/java/com/yahoo/documentapi/SyncSession.java b/documentapi/src/main/java/com/yahoo/documentapi/SyncSession.java
index cc0f6dc7cd5..24fd47ed12c 100755
--- a/documentapi/src/main/java/com/yahoo/documentapi/SyncSession.java
+++ b/documentapi/src/main/java/com/yahoo/documentapi/SyncSession.java
@@ -6,6 +6,7 @@ import com.yahoo.document.DocumentId;
import com.yahoo.document.DocumentPut;
import com.yahoo.document.DocumentRemove;
import com.yahoo.document.DocumentUpdate;
+import com.yahoo.document.TestAndSetCondition;
import com.yahoo.documentapi.messagebus.protocol.DocumentProtocol;
import java.time.Duration;
@@ -105,8 +106,11 @@ public interface SyncSession extends Session {
* Updates a document.
*
* @param update the updates to perform
- * @return true, if the document was found and updated
- * @throws UnsupportedOperationException thrown if this access does not support update
+ * @return false if the updates could not be applied as the document does not exist and
+ * {@link DocumentUpdate#setCreateIfNonExistent(boolean) create-if-non-existent} is not set.
+ * @throws DocumentAccessException on update error, including but not limited to: 1. timeouts,
+ * 2. the document exists but the {@link DocumentUpdate#setCondition(TestAndSetCondition) condition}
+ * is not met.
*/
boolean update(DocumentUpdate update);
@@ -115,8 +119,11 @@ public interface SyncSession extends Session {
*
* @param update the updates to perform.
* @param priority the priority with which to perform this operation
- * @return true, if the document was found and updated
- * @throws UnsupportedOperationException thrown if this access does not support update
+ * @return false if the updates could not be applied as the document does not exist and
+ * {@link DocumentUpdate#setCreateIfNonExistent(boolean) create-if-non-existent} is not set.
+ * @throws DocumentAccessException on update error, including but not limited to: 1. timeouts,
+ * 2. the document exists but the {@link DocumentUpdate#setCondition(TestAndSetCondition) condition}
+ * is not met.
*/
boolean update(DocumentUpdate update, DocumentProtocol.Priority priority);