Interface for the persistent storage used to back the downloader
Defines 'store', 'retrieve', 'retrieveAll' and 'remove' methods for:
- TaskRecords, keyed by taskId
- paused Tasks, keyed by taskId
- ResumeData, keyed by taskId
Each of the objects has a toJson method and can be created using fromJson (use .createFromJson for Task objects)
Also defined methods to allow migration from one database version to another
- Implementers
Constructors
Properties
- currentDatabaseVersion → (String, int)
-
Name and version number for this type of persistent storage
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
storedDatabaseVersion
→ Future<
(String, int)> -
Name and version number for database as stored
no setter
Methods
-
initialize(
) → Future< void> -
Initialize the database - only called when the
BaseDownloader
is created with this object, which happens when the FileDownloader singleton is instantiated, OR as part of a migration away from this database type. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
removePausedTask(
String? taskId) → Future< void> -
Remove paused Task with
taskId
from storage. If null, remove all -
removeResumeData(
String? taskId) → Future< void> -
Remove ResumeData with
taskId
from storage. If null, remove all -
removeTaskRecord(
String? taskId) → Future< void> -
Remove TaskRecord with
taskId
from storage. If null, remove all -
retrieveAllPausedTasks(
) → Future< List< Task> > - Retrieve all paused Task
-
retrieveAllResumeData(
) → Future< List< ResumeData> > - Retrieve all ResumeData
-
retrieveAllTaskRecords(
) → Future< List< TaskRecord> > - Retrieve all TaskRecord
-
retrievePausedTask(
String taskId) → Future< Task?> -
Retrieve paused
Task
withtaskId
, or null if not found -
retrieveResumeData(
String taskId) → Future< ResumeData?> -
Retrieve
ResumeData
withtaskId
, or null if not found -
retrieveTaskRecord(
String taskId) → Future< TaskRecord?> -
Retrieve
TaskRecord
withtaskId
, or null if not found -
storePausedTask(
Task task) → Future< void> -
Store a paused
task
, keyed by taskId -
storeResumeData(
ResumeData resumeData) → Future< void> - Store ResumeData, keyed by its taskId
-
storeTaskRecord(
TaskRecord record) → Future< void> - Store a TaskRecord, keyed by taskId
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited