public class OfflineIndex.WriteTransaction
extends Object
OfflineIndex.newTransaction()
.Constructor and Description |
---|
WriteTransaction() |
Modifier and Type | Method and Description |
---|---|
Request |
clearIndexAsync(CompletionHandler completionHandler)
Delete the index content without removing settings.
|
void |
clearIndexSync()
Delete the index content without removing settings.
|
Request |
commitAsync(CompletionHandler completionHandler)
Commit the transaction.
|
void |
commitSync()
Commit the transaction (synchronously).
|
Request |
deleteObjectAsync(String objectID,
CompletionHandler completionHandler)
Delete an object.
|
Request |
deleteObjectsAsync(Collection<String> objectIDs,
CompletionHandler completionHandler)
Delete multiple objects.
|
void |
deleteObjectsSync(Collection<String> objectIDs)
Delete multiple objects (synchronously).
|
void |
deleteObjectSync(String objectID)
Delete an object (synchronously).
|
void |
finalize() |
int |
getId()
Get this transaction's ID.
|
boolean |
isFinished()
Test whether this transaction is finished.
|
Request |
rollbackAsync(CompletionHandler completionHandler)
Roll back the current write transaction.
|
void |
rollbackSync()
Rollback the transaction.
|
Request |
saveObjectAsync(JSONObject object,
CompletionHandler completionHandler)
Save an object.
|
Request |
saveObjectsAsync(JSONArray objects,
CompletionHandler completionHandler)
Save multiple objects.
|
void |
saveObjectsSync(JSONArray objects)
Save multiple objects (synchronously).
|
void |
saveObjectSync(JSONObject object)
Save an object (synchronously).
|
Request |
setSettingsAsync(JSONObject settings,
CompletionHandler completionHandler)
Set the index settings.
|
void |
setSettingsSync(JSONObject settings)
Set the index settings (synchronously).
|
String |
toString() |
public void finalize()
finalize
in class Object
@NonNull public String toString()
toString
in class Object
public int getId()
public boolean isFinished()
public Request saveObjectAsync(@NonNull JSONObject object, CompletionHandler completionHandler)
object
- Object to save. Must contain an `objectID` attribute.completionHandler
- Completion handler to be notified of the request's outcome.public void saveObjectSync(@NonNull JSONObject object) throws AlgoliaException
object
- Object to save. Must contain an `objectID` attribute.AlgoliaException
public Request saveObjectsAsync(@NonNull JSONArray objects, CompletionHandler completionHandler)
objects
- Objects to save. Each one must contain an `objectID` attribute.completionHandler
- Completion handler to be notified of the request's outcome.public void saveObjectsSync(@NonNull JSONArray objects) throws AlgoliaException
objects
- Objects to save. Each one must contain an `objectID` attribute.AlgoliaException
public Request deleteObjectAsync(@NonNull String objectID, CompletionHandler completionHandler)
objectID
- Identifier of object to delete.completionHandler
- Completion handler to be notified of the request's outcome.public void deleteObjectSync(@NonNull String objectID) throws AlgoliaException
objectID
- Identifier of the object to delete.AlgoliaException
public Request deleteObjectsAsync(Collection<String> objectIDs, CompletionHandler completionHandler)
objectIDs
- Identifiers of objects to delete.completionHandler
- Completion handler to be notified of the request's outcome.public void deleteObjectsSync(@NonNull Collection<String> objectIDs) throws AlgoliaException
objectIDs
- Identifiers of the objects to delete.AlgoliaException
public Request setSettingsAsync(@NonNull JSONObject settings, CompletionHandler completionHandler)
settings
- New settings.completionHandler
- Completion handler to be notified of the request's outcome.public void setSettingsSync(@NonNull JSONObject settings) throws AlgoliaException
settings
- New settings.AlgoliaException
public Request clearIndexAsync(CompletionHandler completionHandler)
completionHandler
- Completion handler to be notified of the request's outcome.public void clearIndexSync() throws AlgoliaException
AlgoliaException
public Request commitAsync(@NonNull CompletionHandler completionHandler)
completionHandler
- Completion handler to be notified of the transaction's outcome.public void commitSync() throws AlgoliaException
AlgoliaException
public Request rollbackAsync(CompletionHandler completionHandler)
completionHandler
- Completion handler to be notified of the transaction's outcome.public void rollbackSync()