public interface SyncSession extends Session
A session for synchronous access to a document repository. This class provides simple document access where throughput is not a concern.
Modifier and Type | Method and Description |
---|---|
com.yahoo.document.Document |
get(com.yahoo.document.DocumentId id)
Gets a document.
|
default com.yahoo.document.Document |
get(com.yahoo.document.DocumentId id,
Duration timeout)
Gets a document with timeout.
|
com.yahoo.document.Document |
get(com.yahoo.document.DocumentId id,
String fieldSet,
DocumentProtocol.Priority priority)
Gets a document.
|
default com.yahoo.document.Document |
get(com.yahoo.document.DocumentId id,
String fieldSet,
DocumentProtocol.Priority priority,
Duration timeout)
Gets a document with timeout.
|
void |
put(com.yahoo.document.DocumentPut documentPut)
Puts a document.
|
void |
put(com.yahoo.document.DocumentPut documentPut,
DocumentProtocol.Priority priority)
Puts a document.
|
boolean |
remove(com.yahoo.document.DocumentRemove documentRemove)
Removes a document if it is present and condition is fulfilled.
|
boolean |
remove(com.yahoo.document.DocumentRemove documentRemove,
DocumentProtocol.Priority priority)
Removes a document if it is present.
|
boolean |
update(com.yahoo.document.DocumentUpdate update)
Updates a document.
|
boolean |
update(com.yahoo.document.DocumentUpdate update,
DocumentProtocol.Priority priority)
Updates a document.
|
void put(com.yahoo.document.DocumentPut documentPut)
Puts a document. When this method returns, the document is safely received. This enables setting condition compared to using Document.
documentPut
- The DocumentPut operationvoid put(com.yahoo.document.DocumentPut documentPut, DocumentProtocol.Priority priority)
Puts a document. When this method returns, the document is safely received.
documentPut
- The DocumentPut operationpriority
- The priority with which to perform this operation.com.yahoo.document.Document get(com.yahoo.document.DocumentId id)
Gets a document.
id
- The id of the document to get.UnsupportedOperationException
- Thrown if this access does not
support retrieving.com.yahoo.document.Document get(com.yahoo.document.DocumentId id, String fieldSet, DocumentProtocol.Priority priority)
Gets a document.
id
- The id of the document to get.fieldSet
- A comma-separated list of fields to retrievepriority
- The priority with which to perform this operation.UnsupportedOperationException
- Thrown if this access does not
support retrieving.default com.yahoo.document.Document get(com.yahoo.document.DocumentId id, Duration timeout)
Gets a document with timeout.
id
- The id of the document to get.timeout
- Timeout. If timeout is null, an unspecified default will be used.UnsupportedOperationException
- Thrown if this access does not support retrieving.DocumentAccessException
- on any messagebus error, including timeout (ErrorCode.TIMEOUT
).default com.yahoo.document.Document get(com.yahoo.document.DocumentId id, String fieldSet, DocumentProtocol.Priority priority, Duration timeout)
Gets a document with timeout.
id
- The id of the document to get.fieldSet
- A comma-separated list of fields to retrievepriority
- The priority with which to perform this operation.timeout
- Timeout. If timeout is null, an unspecified default will be used.UnsupportedOperationException
- Thrown if this access does not support retrieving.DocumentAccessException
- on any messagebus error, including timeout (ErrorCode.TIMEOUT
).boolean remove(com.yahoo.document.DocumentRemove documentRemove)
Removes a document if it is present and condition is fulfilled.
documentRemove
- document to deleteboolean remove(com.yahoo.document.DocumentRemove documentRemove, DocumentProtocol.Priority priority)
Removes a document if it is present.
documentRemove
- Document remove operationpriority
- The priority with which to perform this operation.UnsupportedOperationException
- Thrown if this access does not
support removal.boolean update(com.yahoo.document.DocumentUpdate update)
Updates a document.
update
- The updates to perform.UnsupportedOperationException
- Thrown if this access does not
support update.boolean update(com.yahoo.document.DocumentUpdate update, DocumentProtocol.Priority priority)
Updates a document.
update
- The updates to perform.priority
- The priority with which to perform this operation.UnsupportedOperationException
- Thrown if this access does not
support update.Copyright © 2018. All rights reserved.