public class StorageService extends CharmService
gluonClient
Constructor and Description |
---|
StorageService(GluonClient gluonClient)
Construct a new StorageService.
|
Modifier and Type | Method and Description |
---|---|
StorageService |
authentication(Authentication authentication)
Defines which authentication method must be used when retrieving data
from Gluon Cloud.
|
<T> void |
deleteObject(CharmObservableObject<T> observable)
Asynchronously delete the provided observable object from its storage system.
|
<T> CharmObservableObject<T> |
deleteObject(java.lang.String objectIdentifier)
Asynchronously delete the object with the provided identifier from the device storage system.
|
<T> CharmObservableObject<T> |
deleteObject(java.lang.String objectIdentifier,
StorageWhere storageWhere)
Asynchronously delete the object with the provided identifier from the provided storage system.
|
<T> CharmObservableList<T> |
retrieveList(java.lang.String listIdentifier,
java.lang.Class<T> objectClass)
Asynchronously retrieve the list with the provided id from the device storage system.
|
<T> CharmObservableList<T> |
retrieveList(java.lang.String listIdentifier,
java.lang.Class<T> objectClass,
StorageWhere storageWhere)
Asynchronously retrieve the list with the provided id from the provided storage system.
|
<T> CharmObservableList<T> |
retrieveList(java.lang.String listIdentifier,
java.lang.Class<T> objectClass,
StorageWhere storageWhere,
SyncFlag... syncFlags)
Asynchronously retrieve the list with the provided id, from the provided storage system using
the provided synchronization flags to decide how the list will be synchronized with the chosen
storage system.
|
<T> CharmObservableObject<T> |
retrieveObject(java.lang.String objectIdentifier,
java.lang.Class<T> objectClass)
Asynchronously retrieve the object with the provided id from the device storage system.
|
<T> CharmObservableObject<T> |
retrieveObject(java.lang.String objectIdentifier,
java.lang.Class<T> objectClass,
StorageWhere storageWhere)
Asynchronously retrieve the object with the provided id from the provided storage system.
|
<T> CharmObservableObject<T> |
retrieveObject(java.lang.String objectIdentifier,
java.lang.Class<T> objectClass,
StorageWhere storageWhere,
SyncFlag... syncFlags)
Asynchronously retrieve the object with the provided id from the provided storage system,
using the provided flags to decide how the object will be synchronized with the storage system.
|
<T> CharmObservableObject<T> |
storeObject(java.lang.String objectIdentifier,
T object)
Asynchronously store the provided object with the given identifier on the device storage system.
|
<T> CharmObservableObject<T> |
storeObject(java.lang.String objectIdentifier,
T object,
StorageWhere storageWhere)
Asynchronously store the provided object with the given id at the specified storage system.
|
<T> CharmObservableObject<T> |
storeObject(java.lang.String objectIdentifier,
T object,
StorageWhere storageWhere,
SyncFlag... syncFlags)
Asynchronously store the provided object with the given id at the specified storage system,
using the provided synchronization flags to decide how the object will be synchronized with
the storage system.
|
getGluonClient
public StorageService(GluonClient gluonClient)
gluonClient
- The GluonClient instance used to connect with Gluon
Cloud.public StorageService authentication(Authentication authentication)
authentication
- The authentication method to use.public <T> CharmObservableList<T> retrieveList(java.lang.String listIdentifier, java.lang.Class<T> objectClass)
CharmObservableList
instance will be synchronized
directly to the storage on the device. Use retrieveList(String, Class, StorageWhere, SyncFlag...)
in case other synchronization parameters are needed.T
- The type of the elements that are contained in the list.listIdentifier
- The unique identifier of the list.objectClass
- The class of the elements in the list.public <T> CharmObservableList<T> retrieveList(java.lang.String listIdentifier, java.lang.Class<T> objectClass, StorageWhere storageWhere)
CharmObservableList
instance will be
synchronized to the storage location. Use retrieveList(String, Class, StorageWhere, SyncFlag...)
in case other synchronization parameters are needed.T
- The type of the elements that are contained in the list.listIdentifier
- The unique identifier of the list.objectClass
- The class of the elements in the list.storageWhere
- The storage system to use for storing and retrieving the items of the list.public <T> CharmObservableList<T> retrieveList(java.lang.String listIdentifier, java.lang.Class<T> objectClass, StorageWhere storageWhere, SyncFlag... syncFlags)
The retrieve operation is executed asynchronously in a background thread. You can monitor the
process of the operation by checking the state
of the returned
CharmObservable object.
T
- The type of the elements that are contained in the list.listIdentifier
- The unique identifier of the list.objectClass
- The class of the elements in the list.storageWhere
- The storage system to use for storing and retrieving the items of the list.syncFlags
- Synchronization flags that define how changes between the local list and the stored list are
reflected to each other.public <T> CharmObservableObject<T> storeObject(java.lang.String objectIdentifier, T object)
T
- The type of the object.objectIdentifier
- The unique identifier of the object.object
- The actual object to store.public <T> CharmObservableObject<T> storeObject(java.lang.String objectIdentifier, T object, StorageWhere storageWhere)
T
- The type of the object.objectIdentifier
- The unique identifier of the object.object
- The actual object to store.storageWhere
- The storage system to use for storing the object.public <T> CharmObservableObject<T> storeObject(java.lang.String objectIdentifier, T object, StorageWhere storageWhere, SyncFlag... syncFlags)
The store operation is executed asynchronously in a background thread. You can monitor the
process of the operation by checking the state
of the returned
CharmObservable object.
T
- The type of the object.objectIdentifier
- The unique identifier of the object.object
- The actual object to store.storageWhere
- The storage system to use for storing the object.syncFlags
- Synchronization flags that define how changes between the local object and the stored object are
reflected to each other.public <T> CharmObservableObject<T> retrieveObject(java.lang.String objectIdentifier, java.lang.Class<T> objectClass)
T
- The type of the object to retrieve.objectIdentifier
- The unique identifier of the object to retrieve.objectClass
- The class of the object to retrieve.public <T> CharmObservableObject<T> retrieveObject(java.lang.String objectIdentifier, java.lang.Class<T> objectClass, StorageWhere storageWhere)
T
- The type of the object to retrieve.objectIdentifier
- The unique identifier of the object to retrieve.objectClass
- The class of the object to retrieve.storageWhere
- The storage system to use for storing and retrieving the object.public <T> CharmObservableObject<T> retrieveObject(java.lang.String objectIdentifier, java.lang.Class<T> objectClass, StorageWhere storageWhere, SyncFlag... syncFlags)
The retrieve operation is executed asynchronously in a background thread. You can monitor the
process of the operation by checking the state
of the returned
CharmObservable object.
T
- The type of the object to retrieve.objectIdentifier
- The unique identifier of the object to retrieve.objectClass
- The class of the object to retrieve.storageWhere
- The storage system to use for storing and retrieving the object.syncFlags
- Synchronization flags that define how changes between the local object and the stored object are
reflected to each other.public <T> CharmObservableObject<T> deleteObject(java.lang.String objectIdentifier)
T
- The type of the object to delete.objectIdentifier
- The unique identifier of the object to delete.public <T> CharmObservableObject<T> deleteObject(java.lang.String objectIdentifier, StorageWhere storageWhere)
T
- The type of the object to delete.objectIdentifier
- The unique identifier of the object to delete.storageWhere
- The storage system to delete the object from.public <T> void deleteObject(CharmObservableObject<T> observable)
The delete operation is executed asynchronously in a background thread. You can monitor the
process of the operation by checking the state
of the returned
CharmObservable object.
T
- The type of the object to delete.observable
- The observable object to delete.