Package com.yahoo.documentapi.local
Class LocalSyncSession
java.lang.Object
com.yahoo.documentapi.local.LocalSyncSession
- All Implemented Interfaces:
Session
,SyncSession
- Author:
- bratseth
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
destroy()
Destroys this session and frees up any resources it has held.com.yahoo.document.Document
Gets a document with timeout.getNext()
Returns the next response of this session.getNext
(int timeout) Returns the next response of this session.void
put
(com.yahoo.document.DocumentPut documentPut) Puts a document.boolean
remove
(com.yahoo.document.DocumentRemove documentRemove) Removes a document if it is present and condition is fulfilled.boolean
update
(com.yahoo.document.DocumentUpdate update) Updates a document.
-
Constructor Details
-
LocalSyncSession
-
-
Method Details
-
put
public void put(com.yahoo.document.DocumentPut documentPut) Description copied from interface:SyncSession
Puts a document. When this method returns, the document is safely received. This enables setting condition compared to using Document.- Specified by:
put
in interfaceSyncSession
- Parameters:
documentPut
- the DocumentPut operation
-
get
Description copied from interface:SyncSession
Gets a document with timeout.- Specified by:
get
in interfaceSyncSession
- Parameters:
id
- the id of the document to gettimeout
- timeout. If timeout is null, an unspecified default will be used- Returns:
- the document with this id, or null if there is none
-
remove
public boolean remove(com.yahoo.document.DocumentRemove documentRemove) Description copied from interface:SyncSession
Removes a document if it is present and condition is fulfilled.- Specified by:
remove
in interfaceSyncSession
- Parameters:
documentRemove
- document to delete- Returns:
- true if the document with this id was removed, false otherwise
-
update
public boolean update(com.yahoo.document.DocumentUpdate update) Description copied from interface:SyncSession
Updates a document.- Specified by:
update
in interfaceSyncSession
- Parameters:
update
- the updates to perform- Returns:
- false if the updates could not be applied as the document does not exist and
create-if-non-existent
is not set.
-
getNext
Description copied from interface:Session
Returns the next response of this session. This method returns immediately. -
getNext
Description copied from interface:Session
Returns the next response of this session. This will block until a response is ready or until the given timeout is reached -
destroy
public void destroy()Description copied from interface:Session
Destroys this session and frees up any resources it has held. Making further calls on a destroyed session causes a runtime exception.
-