-
- All Implemented Interfaces:
-
com.brightcove.player.store.MediaStore
public class BaseStore implements MediaStore
A base wrapper for io.requery.EntityStore.
-
-
Field Summary
Fields Modifier and Type Field Description public final static int
MAX_SQL_VARIABLES
public final static int
MAX_SQL_EXPRESSIONS
-
Method Summary
Modifier and Type Method Description long
getFileSize()
Gets the size of the backing database file. boolean
compact()
Compacts the physical database file size by running the SQLiteVACUUM statement. <E extends IdentifiableEntity> E
refreshEntity(@Nullable() E entity)
Refresh the given entity. void
onCreated(int version)
Called when new EntityDataStore has been created. void
onUpgraded(int oldVersion, int newVersion)
Called when the EntityDataStore has been upgraded from an previous versionto a new version. <T extends IdentifiableEntity> T
saveEntity(@NonNull() T entity)
Inserts or updates the given entity. boolean
deleteEntity(@Nullable() IdentifiableEntity entity)
Deletes an identifiable entity from the store. <T extends IdentifiableEntity> T
saveOfflineVideo(Video video)
Updates the entity with given unique video identifier to save the video metadata object,while retaining the previously saved license information. <T extends IdentifiableEntity> T
saveOfflineLicense(@NonNull() Video video)
Updates the entity with given unique video identifier to save the video license information. <T extends IdentifiableEntity> T
findOfflineVideo(@NonNull() String videoId)
Finds the first offline video entity with the given video identifier. boolean
deleteOfflineVideo(@NonNull() String videoId)
Deletes the first offline video entity with the given video identifier. Uri
findOfflineAssetUri(@Nullable() Uri uri)
Finds the local URI of a remote asset that has been downloaded successfully. -
-
Method Detail
-
getFileSize
long getFileSize()
Gets the size of the backing database file.
-
compact
boolean compact()
Compacts the physical database file size by running the SQLiteVACUUM statement.
-
refreshEntity
@Nullable() <E extends IdentifiableEntity> E refreshEntity(@Nullable() E entity)
Refresh the given entity. This refreshes the already loaded properties in the entity.If no properties are loaded then the default properties will be loaded.
- Parameters:
entity
- reference to the entity to be refreshed.
-
onCreated
void onCreated(int version)
Called when new EntityDataStore has been created. Override this method to setupthe default state of the entity store.
- Parameters:
version
- schema version of the store.
-
onUpgraded
void onUpgraded(int oldVersion, int newVersion)
Called when the EntityDataStore has been upgraded from an previous versionto a new version.
- Parameters:
oldVersion
- the old schema versionnewVersion
- the new schema version
-
saveEntity
<T extends IdentifiableEntity> T saveEntity(@NonNull() T entity)
Inserts or updates the given entity.
- Parameters:
entity
- the entity to be save.
-
deleteEntity
boolean deleteEntity(@Nullable() IdentifiableEntity entity)
Deletes an identifiable entity from the store.
- Parameters:
entity
- the entity to be deleted.
-
saveOfflineVideo
@NonNull() <T extends IdentifiableEntity> T saveOfflineVideo(Video video)
Updates the entity with given unique video identifier to save the video metadata object,while retaining the previously saved license information.
- Parameters:
video
- the video to be saved.
-
saveOfflineLicense
@NonNull() <T extends IdentifiableEntity> T saveOfflineLicense(@NonNull() Video video)
Updates the entity with given unique video identifier to save the video license information.
- Parameters:
video
- the video to be saved.
-
findOfflineVideo
@Nullable() <T extends IdentifiableEntity> T findOfflineVideo(@NonNull() String videoId)
Finds the first offline video entity with the given video identifier.
- Parameters:
videoId
- the unique video identifier.
-
deleteOfflineVideo
boolean deleteOfflineVideo(@NonNull() String videoId)
Deletes the first offline video entity with the given video identifier.
- Parameters:
videoId
- the unique video identifier.
-
findOfflineAssetUri
@Nullable() Uri findOfflineAssetUri(@Nullable() Uri uri)
Finds the local URI of a remote asset that has been downloaded successfully.
- Parameters:
uri
- the remote URI to the asset.
-
-
-
-