Package com.blukii.sdk.config
Klasse DataManager
java.lang.Object
com.blukii.sdk.config.DataManager
This class is the central logic to handle all data driven actions.
From here you can start calls to blukii cloud and handle BlukiiData actions.
Get the DataManager instance by calling BlukiiController.getConfigDataManager()
Important: Most of DataManager class functions need to be logged in.
See BlukiiCloud for more information.
- Siehe auch:
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenModifizierer und TypKlasseBeschreibungstatic interfaceThe listener interface for receiving state changes from assigning blukiis to a user in blukii cloud.static interfaceThe listener interface for receiving state changes from loading blukii status from blukii cloud.static interfaceThe listener interface for receiving state changes from syncing blukiis with blukii cloud. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidassignBlukiis(String orderCode, DataManager.OnAssignBlukiiListener listener) Assigns blukiis via order code to a user in blukii cloud.voidClears all blukii data and flagsvoidClears the blukii data and firmware file cache.booleanClears the blukii firmware file cache.getBlukiiData(String blukiiId) Gets aBlukiiDataobject via blukii id.Gets a list of keys of all availableBlukiiDataobjects.Gets a list of keys of all availableBlukiiDataobjects, which are full data synced.longGets timestamp of last full data sync.longGets timestamp of last status sync.Gets a list of keys of all availableBlukiiDataobjects, which are status synced or full data synced.booleanChecks if anyBlukiiDataobject is modified.booleanChecks if status has been loaded since user has been logged in.intLoads the blukii data from preferences and writes the data tu the blukii data list (seegetBlukiiDataList().voidloadStatus(DataManager.OnLoadStatusListener listener) Load status data for all user owned blukiis from blukii cloud.intremoveFromCache(List<String> blukiiIds) Removes blukii data (of the given ids) from the preferences.intsaveToCache(List<String> blukiiIds) Saves blukii data (of the given ids) to the preferences.voidsync(DataManager.OnSyncListener listener) Synchronizes local blukii data with blukii cloud.voidsync(DataManager.OnSyncListener listener, List<String> blukiiIds) Synchronizes local blukii data with blukii cloud.
-
Methodendetails
-
clearBlukiiData
public void clearBlukiiData()Clears all blukii data and flags -
getBlukiiData
Gets aBlukiiDataobject via blukii id.- Parameter:
blukiiId- id of blukii- Gibt zurück:
- a
BlukiiDataobject
-
getBlukiiDataList
Gets a list of keys of all availableBlukiiDataobjects.- Gibt zurück:
- a list of String keys
-
getFullDataSyncedBlukiiDataList
Gets a list of keys of all availableBlukiiDataobjects, which are full data synced.- Gibt zurück:
- a list of String keys
-
getSyncedBlukiiDataList
Gets a list of keys of all availableBlukiiDataobjects, which are status synced or full data synced.- Gibt zurück:
- a list of String keys
-
saveToCache
Saves blukii data (of the given ids) to the preferences.Note: the blukii data is only saved if blukii ids are part of the
getBlukiiDataList().- Parameter:
blukiiIds- list of blukii ids- Gibt zurück:
- number of saved blukii data items
-
loadFromCache
public int loadFromCache()Loads the blukii data from preferences and writes the data tu the blukii data list (seegetBlukiiDataList().Note: all data in blukii data list will be overwritten!
- Gibt zurück:
- number of loaded blukii data items
-
removeFromCache
Removes blukii data (of the given ids) from the preferences.- Parameter:
blukiiIds- list of blukii ids- Gibt zurück:
- number of removed blukii data items
-
clearCache
public void clearCache()Clears the blukii data and firmware file cache. -
clearFirmwareCache
public boolean clearFirmwareCache()Clears the blukii firmware file cache.- Gibt zurück:
trueif successfully cleared
-
isDataModified
public boolean isDataModified()Checks if anyBlukiiDataobject is modified.- Gibt zurück:
trueif there is modified data, otherwisefalse
-
getLastDataSyncTime
public long getLastDataSyncTime()Gets timestamp of last full data sync.- Gibt zurück:
- timestamp of last full data sync
-
getLastStatusSyncTime
public long getLastStatusSyncTime()Gets timestamp of last status sync.- Gibt zurück:
- timestamp of last status sync
-
isStatusLoaded
public boolean isStatusLoaded()Checks if status has been loaded since user has been logged in.- Gibt zurück:
- timestamp of last status sync
-
sync
Synchronizes local blukii data with blukii cloud.- Parameter:
listener- OnSyncListener which is called if sync is done or on error
-
sync
Synchronizes local blukii data with blukii cloud.Parameter blukiiIds define the set of blukiis that should be synchronized from now on. Blukiis that are not in this list will not be synchronized any more.
If parameter blukiiIds is null, the current sync ids retrieved by
getFullDataSyncedBlukiiDataList()are synced.- Parameter:
listener- OnSyncListener which is called if sync is done or on errorblukiiIds- blukii ids that should be synced
-
loadStatus
Load status data for all user owned blukiis from blukii cloud.- Parameter:
listener- OnLoadStatusListener which is called if load is done or on error
-
assignBlukiis
Assigns blukiis via order code to a user in blukii cloud.- Parameter:
orderCode- order code which verifies the assignmentlistener- OnAssignBlukiiListener which is called if assign is done or on error
-