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> CharmObservableList<T> |
retrieveList(java.lang.String listIdentifier,
java.lang.Class<T> objectClass)
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)
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)
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)
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)
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)
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)
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)
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)
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 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)
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)
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)
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.