OfflineStoreManager

Store manager can be used to persist data into an application specific private database.

Types

Link copied to clipboard
Any method attempting to call changeDownloadIdentifier must be annotated explicitly with this annotation.

Functions

Link copied to clipboard
open fun addDownloadRequests(requestSet: DownloadRequestSet, requests: Array<IDownloadManager.IRequest>): DownloadRequestSet
Creates a new blank download request set.
Link copied to clipboard
open fun changeDownloadIdentifier(video: Video): OfflineVideo
Changes the download identifier associated with given video.
Link copied to clipboard
open fun countDownloadRequestsInState(requestSetKey: Long, statusCode: Int): Int
Counts the download requests belonging to a DownloadRequestSet with the specified status code.
Link copied to clipboard
open fun createDownloadRequestSet(requestConfig: RequestConfig, estimatedSize: Long): DownloadRequestSet
Creates a new blank download request set.
Link copied to clipboard
Deletes the specified request set from the store.
Link copied to clipboard
open fun deleteOfflineVideo(videoId: String): Boolean
Deletes the first offline video entity with the given video identifier.
Link copied to clipboard
open fun findAllOfflineVideo(): List<OfflineVideo>
Finds all offline video entities.
open fun findAllOfflineVideo(status: Int): List<OfflineVideo>
Finds all offline video entities with the specified status
Link copied to clipboard
open fun findCurrentDownloadBatchInProgress(batchSize: Int): List<DownloadRequest>
Finds the current set of download request which are still being processed.
Link copied to clipboard
open fun findCurrentDownloadRequestSetInProgress(): List<DownloadRequestSet>
Finds the current set of download request set which are still being processed.
Link copied to clipboard
open fun findDownloadRequestSetByKey(key: Long): DownloadRequestSet
Finds a download request set with the specified unique key.
Link copied to clipboard
open fun findDownloadRequestSets(requestIds: Array<Long>): Collection<DownloadRequestSet>
Finds the download request sets to which the given requests belong to.
Link copied to clipboard
open fun findDownloadsToBeQueued(batchSize: Int, excludeWifiOnly: Boolean): List<DownloadRequest>
Fetches a list of download requests that not have been queued for download by the android.app.
Link copied to clipboard
open fun findOfflineAssetUri(uri: Uri): Uri
Finds the local URI of a remote asset that has been downloaded successfully.
Link copied to clipboard
open fun findOfflineVideo(videoId: String): OfflineVideo
Finds the first offline video entity with the given video identifier.
Link copied to clipboard
open fun getInstance(context: Context): OfflineStoreManager
Gets reference to the single instance of OfflineStoreManager
Link copied to clipboard
Checks if the current set of download request are still being processed.
Link copied to clipboard
open fun isDownloadCompleted(requestSetKey: Long): Boolean
Checks if the DownloadRequestSet is completed.
Link copied to clipboard
open fun markRequestSetForRemoval(key: Long): List<DownloadRequest>
Marks the specified request set for removal.
Link copied to clipboard
open fun pauseDownloadRequestSet(key: Long): List<DownloadRequest>
Marks a download request set as paused.
Link copied to clipboard
open fun <E : IdentifiableEntity?> refreshEntity(entity: E): E
Refresh the given entity.
Link copied to clipboard
open fun resumeDownloadRequestSet(key: Long): DownloadRequestSet
Marks a download request set as waiting to be queued.
Link copied to clipboard
open fun <T : IdentifiableEntity?> saveEntity(entity: T): T
Inserts or updates the given entity.
Link copied to clipboard
open fun saveOfflineLicense(video: Video): OfflineVideo
Updates the entity with given unique video identifier to save the video license information.
Link copied to clipboard
open fun saveOfflineVideo(video: Video): OfflineVideo
Updates the entity with given unique video identifier to save the video metadata object, while retaining the previously saved license information.
open fun saveOfflineVideo(video: Video, downloadDirectory: File, requestSet: DownloadRequestSet): OfflineVideo
Saves the offline video information into the store.
Link copied to clipboard
open fun toVideoList(entityList: List<OfflineVideo>): List<Video>
Converts the given list of OfflineVideo objects into a list of Video objects.
Link copied to clipboard
open fun updateDownloadId(key: Long, downloadId: Long): Boolean
Sets the download identifier for the request with the specified primary key.
Link copied to clipboard
open fun updateDownloadRequestIdList(videoId: String, requestIdList: List<Long>, estimatedSize: Long): OfflineVideo
Updates the entity with given unique video identifier to save the current list of download request identifiers.
Link copied to clipboard
open fun updateDownloadRequestSetStatus(requestSet: DownloadRequestSet, statusCode: Int, reasonCode: Int, downloadRequest: DownloadRequest, evaluateAllSegments: Boolean): Boolean
Updates the status of Download Request Set.
Link copied to clipboard
open fun updateDownloadRequestStatusByDownloadId(downloadId: Long, statusCode: Int, reasonCode: Int, bytesDownloaded: Long, actualSize: Long, updateParentRecord: Boolean): DownloadRequest
Updates the status of download request.