T - The type this object will control CRUD operations for.public interface AsyncDao<T>
| Modifier and Type | Method and Description |
|---|---|
java.lang.Boolean |
delete(java.lang.String key)
Delete the object with the specified
key. |
void |
delete(java.lang.String key,
java.lang.Iterable<ResponseListener<java.lang.Boolean>> listeners)
Delete the object with the specified
key and fire the
listeners on the response. |
java.lang.Boolean |
delete(java.lang.String key,
KvMetadata metadata)
Delete the object with the specified
key if and only if the ref
from the metadata matches the current stored ref. |
void |
delete(java.lang.String key,
KvMetadata metadata,
java.lang.Iterable<ResponseListener<java.lang.Boolean>> listeners)
Delete the object with the specified
key if and only if the ref
from the metadata matches the current stored ref. |
java.lang.Boolean |
delete(java.lang.String key,
java.lang.String currentRef)
Delete the object with the specified
key if and only if the
currentRef matches the current stored ref. |
void |
delete(java.lang.String key,
java.lang.String currentRef,
java.lang.Iterable<ResponseListener<java.lang.Boolean>> listeners)
Delete the object with the specified
key if and only if the
currentRef matches the current stored ref. |
java.lang.Boolean |
deleteCollection()
Delete all objects in the collection.
|
void |
deleteCollection(java.lang.Iterable<ResponseListener<java.lang.Boolean>> listeners)
Delete all objects in the collection.
|
KvObject<T> |
findOne(java.lang.String key)
Return the
KvObject for the object stored with the specified
key. |
void |
findOne(java.lang.String key,
java.lang.Iterable<ResponseListener<KvObject<T>>> listeners)
Find the object stored with the specified
key and fire the
listeners on the response. |
KvObject<T> |
findOne(java.lang.String key,
KvMetadata metadata)
Return the
KvObject for the object stored with the specified
key and the version from the metadata. |
void |
findOne(java.lang.String key,
KvMetadata metadata,
java.lang.Iterable<ResponseListener<KvObject<T>>> listeners)
Find the object stored with the specified
key and the version
from the metadata and fire the listeners on the response. |
KvObject<T> |
findOne(java.lang.String key,
java.lang.String ref)
Return the
KvObject for the object stored with the specified
key and the version ref. |
void |
findOne(java.lang.String key,
java.lang.String ref,
java.lang.Iterable<ResponseListener<KvObject<T>>> listeners)
Find the object stored with the specified
key and the version
ref and fire the listeners on the response. |
KvMetadata |
save(java.lang.String key,
T value)
Save the specified
value to the key. |
KvMetadata |
save(java.lang.String key,
T value,
boolean ifAbsent)
Save the specified
value to the key if and only if the
key does not already exist when ifAbsent is true. |
void |
save(java.lang.String key,
T value,
boolean ifAbsent,
java.lang.Iterable<ResponseListener<KvMetadata>> listeners)
Save the specified
value to the key if and only if the
key does not already exist when ifAbsent is true. |
void |
save(java.lang.String key,
T value,
java.lang.Iterable<ResponseListener<KvMetadata>> listeners)
Save the specified
value to the key and fire the
listeners on the response. |
KvMetadata |
save(java.lang.String key,
T value,
KvMetadata metadata)
Save the specified
value to the key if and only if the
ref from the metadata matches the current stored ref. |
void |
save(java.lang.String key,
T value,
KvMetadata metadata,
java.lang.Iterable<ResponseListener<KvMetadata>> listeners)
Save the specified
value to the key if and only if the
ref from the metadata matches the current stored ref. |
KvMetadata |
save(java.lang.String key,
T value,
java.lang.String currentRef)
Save the specified
value to the key if and only if the
currentRef matches the current stored ref. |
void |
save(java.lang.String key,
T value,
java.lang.String currentRef,
java.lang.Iterable<ResponseListener<KvMetadata>> listeners)
Save the specified
value to the key if and only if the
currentRef matches the current stored ref. |
@Nullable KvObject<T> findOne(java.lang.String key)
KvObject for the object stored with the specified
key.key - The key used to find the object.null.void findOne(java.lang.String key,
java.lang.Iterable<ResponseListener<KvObject<T>>> listeners)
key and fire the
listeners on the response.key - The key used to find the object.listeners - The callbacks to fire on the operation's response.@Nullable KvObject<T> findOne(java.lang.String key, KvMetadata metadata)
KvObject for the object stored with the specified
key and the version from the metadata.key - The key used to find the object.metadata - The metadata about the version of the object to get.null.void findOne(java.lang.String key,
KvMetadata metadata,
java.lang.Iterable<ResponseListener<KvObject<T>>> listeners)
key and the version
from the metadata and fire the listeners on the response.key - The key used to find the object.metadata - The metadata about the version of the object to get.listeners - The callbacks to fire on the operation's response.@Nullable KvObject<T> findOne(java.lang.String key, java.lang.String ref)
KvObject for the object stored with the specified
key and the version ref.key - The key used to find the object.ref - The version of the object.null.void findOne(java.lang.String key,
java.lang.String ref,
java.lang.Iterable<ResponseListener<KvObject<T>>> listeners)
key and the version
ref and fire the listeners on the response.key - The key used to find the object.ref - The version of the object.listeners - The callbacks to fire on the operation's response.KvMetadata save(java.lang.String key, T value)
key - The key to save the specified value to.value - The object to save.void save(java.lang.String key,
T value,
java.lang.Iterable<ResponseListener<KvMetadata>> listeners)
value to the key and fire the
listeners on the response.key - The key to save the specified value to.value - The object to save.listeners - The callbacks to fire on the operation's response.@Nullable KvMetadata save(java.lang.String key, T value, boolean ifAbsent)
value to the key if and only if the
key does not already exist when ifAbsent is true.
If ifAbsent is true and the key already exists
the KvMetadata will be null.
key - The key to save the specified value to.value - The object to save.ifAbsent - When true the store operation will only succeed
if the specified key does not already exist.null.void save(java.lang.String key,
T value,
boolean ifAbsent,
java.lang.Iterable<ResponseListener<KvMetadata>> listeners)
value to the key if and only if the
key does not already exist when ifAbsent is true.
Fire the listeners on the response.
If ifAbsent is true and the key already exists
the KvMetadata will be null.
key - The key to save the specified value to.value - The object to save.ifAbsent - When true the store operation will only succeed
if the specified key does not already exist.listeners - The callbacks to fire on the operation's response.@Nullable KvMetadata save(java.lang.String key, T value, KvMetadata metadata)
value to the key if and only if the
ref from the metadata matches the current stored ref.
If the ref from the metadata does not match the current ref stored, the
resulting KvMetadata will be null.
key - The key to save the specified value to.value - The object to save.metadata - The metadata about the current object stored to this key.void save(java.lang.String key,
T value,
KvMetadata metadata,
java.lang.Iterable<ResponseListener<KvMetadata>> listeners)
value to the key if and only if the
ref from the metadata matches the current stored ref. Fire the
listeners on the response.key - The key to save the specified value to.value - The object to save.metadata - The metadata about the current object stored to this key.listeners - The callbacks to fire on the operation's response.@Nullable KvMetadata save(java.lang.String key, T value, java.lang.String currentRef)
value to the key if and only if the
currentRef matches the current stored ref.
If the currentRef does not match the current ref stored, the
resulting KvMetadata will be null.
key - The key to save the specified value to.value - The object to save.currentRef - The ref of the last known object stored to this key.void save(java.lang.String key,
T value,
java.lang.String currentRef,
java.lang.Iterable<ResponseListener<KvMetadata>> listeners)
value to the key if and only if the
currentRef matches the current stored ref. Fire the
listeners on the response.
If the currentRef does not match the current ref stored, the
resulting KvMetadata will be null.
key - The key to save the specified value to.value - The object to save.currentRef - The ref of the last known object stored to this key.listeners - The callbacks to fire on the operation's response.java.lang.Boolean delete(java.lang.String key)
key.key - The key of the object to delete.void delete(java.lang.String key,
java.lang.Iterable<ResponseListener<java.lang.Boolean>> listeners)
key and fire the
listeners on the response.key - The key of the object to delete.listeners - The callbacks to fire on the operation's response.java.lang.Boolean delete(java.lang.String key,
KvMetadata metadata)
key if and only if the ref
from the metadata matches the current stored ref.
If the ref from the metadata does not match the current ref stored, the
result will be false.
key - The key of the object to delete.metadata - The metadata about the current object stored to this key.void delete(java.lang.String key,
KvMetadata metadata,
java.lang.Iterable<ResponseListener<java.lang.Boolean>> listeners)
key if and only if the ref
from the metadata matches the current stored ref.
If the ref from the metadata does not match the current ref stored, the
result will be false.
key - The key of the object to delete.metadata - The metadata about the current object stored to this key.listeners - The callbacks to fire on the operation's response.java.lang.Boolean delete(java.lang.String key,
java.lang.String currentRef)
key if and only if the
currentRef matches the current stored ref.
If the currentRef does not match the current ref stored, the
result will be false.
key - The key of the object to delete.currentRef - The ref of the last known object stored to this key.void delete(java.lang.String key,
java.lang.String currentRef,
java.lang.Iterable<ResponseListener<java.lang.Boolean>> listeners)
key if and only if the
currentRef matches the current stored ref.
If the currentRef does not match the current ref stored, the
result will be false.
key - The key of the object to delete.currentRef - The ref of the last known object stored to this key.listeners - The callbacks to fire on the operation's response.java.lang.Boolean deleteCollection()
void deleteCollection(java.lang.Iterable<ResponseListener<java.lang.Boolean>> listeners)
listeners - The callbacks to fire on the operation's response.