Package com.blukii.sdk.config
Class 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.
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
The listener interface for receiving state changes from assigning blukiis to a user in blukii cloud.static interface
The listener interface for receiving errors while communicate to blukii cloud.static interface
Deprecated.static interface
The listener interface for receiving state changes from loading blukii status from blukii cloud.static interface
The listener interface for receiving state changes from syncing blukiis with blukii cloud. -
Method Summary
Modifier and TypeMethodDescriptionvoid
assignBlukiis
(String orderCode, DataManager.OnAssignBlukiiListener listener) Assigns blukiis via order code to a user in blukii cloud.getBlukiiData
(String blukiiId) Gets aBlukiiData
object via blukii id.Gets a list of keys of all availableBlukiiData
objects.Gets a list of keys of all availableBlukiiData
objects, which are full data synced.long
Gets timestamp of last full data sync.long
Gets timestamp of last status sync.Gets a list of keys of all availableBlukiiData
objects, which are status synced or full data synced.boolean
Checks if anyBlukiiData
object is modified.boolean
Checks if status has been loaded since user has been logged in.void
loadBlukii
(String blukiiId, DataManager.OnLoadBlukiiListener listener) Deprecated.please usesync(OnSyncListener, List)
instead!void
loadStatus
(DataManager.OnLoadStatusListener listener) Load status data for all user owned blukiis from blukii cloud.void
reset()
Clears all blukii data and flagsvoid
sync
(DataManager.OnSyncListener listener) Synchronizes local blukii data with blukii cloud.void
sync
(DataManager.OnSyncListener listener, List<String> blukiiIds) Synchronizes local blukii data with blukii cloud.
-
Method Details
-
reset
public void reset()Clears all blukii data and flags -
getBlukiiData
Gets aBlukiiData
object via blukii id.- Parameters:
blukiiId
- id of blukii- Returns:
- a
BlukiiData
object
-
getBlukiiDataList
Gets a list of keys of all availableBlukiiData
objects.- Returns:
- a list of String keys
-
getFullDataSyncedBlukiiDataList
Gets a list of keys of all availableBlukiiData
objects, which are full data synced.- Returns:
- a list of String keys
-
getSyncedBlukiiDataList
Gets a list of keys of all availableBlukiiData
objects, which are status synced or full data synced.- Returns:
- a list of String keys
-
isDataModified
public boolean isDataModified()Checks if anyBlukiiData
object is modified.- Returns:
true
if there is modified data, otherwisefalse
-
getLastDataSyncTime
public long getLastDataSyncTime()Gets timestamp of last full data sync.- Returns:
- timestamp of last full data sync
-
getLastStatusSyncTime
public long getLastStatusSyncTime()Gets timestamp of last status sync.- Returns:
- timestamp of last status sync
-
isStatusLoaded
public boolean isStatusLoaded()Checks if status has been loaded since user has been logged in.- Returns:
- timestamp of last status sync
-
loadBlukii
@Deprecated public void loadBlukii(String blukiiId, @NonNull DataManager.OnLoadBlukiiListener listener) Deprecated.please usesync(OnSyncListener, List)
instead!Loads a specific blukii from blukii cloud.- Parameters:
blukiiId
- id of blukiilistener
- OnLoadBlukiiListener which is called if load is done or on error- See Also:
-
sync
Synchronizes local blukii data with blukii cloud.- Parameters:
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.- Parameters:
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.- Parameters:
listener
- OnLoadStatusListener which is called if load is done or on error
-
assignBlukiis
Assigns blukiis via order code to a user in blukii cloud.- Parameters:
orderCode
- order code which verifies the assignmentlistener
- OnAssignBlukiiListener which is called if assign is done or on error
-
sync(OnSyncListener, List)
instead!