| Constructor and Description |
|---|
GenericAsyncDao(Client client,
java.lang.String collection,
java.lang.Class<T> clazz)
Create a data access object to store objects of type
T to the
specified collection using the client. |
| 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. |
public GenericAsyncDao(Client client, java.lang.String collection, java.lang.Class<T> clazz)
T to the
specified collection using the client.client - The client used to query the Orchestrate.io service.collection - The name of the collection to store objects to.clazz - Type information for deserializing to type T at
runtime.public KvObject<T> findOne(java.lang.String key)
KvObject for the object stored with the specified
key.public void findOne(java.lang.String key,
java.lang.Iterable<ResponseListener<KvObject<T>>> listeners)
key and fire the
listeners on the response.public KvObject<T> findOne(java.lang.String key, KvMetadata metadata)
KvObject for the object stored with the specified
key and the version from the metadata.public 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.public KvObject<T> findOne(java.lang.String key, java.lang.String ref)
KvObject for the object stored with the specified
key and the version ref.public 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.public KvMetadata save(java.lang.String key, T value)
public 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.public 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.
public 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.
public 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.
public 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.public 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.
public 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.
public java.lang.Boolean delete(java.lang.String key)
key.public void delete(java.lang.String key,
java.lang.Iterable<ResponseListener<java.lang.Boolean>> listeners)
key and fire the
listeners on the response.public 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.
public 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.
public 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.
public 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.
public java.lang.Boolean deleteCollection()
deleteCollection in interface AsyncDao<T>public void deleteCollection(java.lang.Iterable<ResponseListener<java.lang.Boolean>> listeners)
deleteCollection in interface AsyncDao<T>listeners - The callbacks to fire on the operation's response.