An abstract interface that FMTC will use to communicate with a storage 'backend' (usually one root), from a 'normal' thread (likely the UI thread)
Should implement methods that operate in another isolate/thread to avoid blocking the normal thread. In this case, FMTCBackendInternalThreadSafe should also be implemented, which should not operate in another thread & must be sendable between isolates (because it will already be operated in another thread), and must be suitable for simultaneous initialisation across multiple threads.
Should be set in FMTCBackendAccess when ready to use, and unset when not. See documentation on that class for more information.
Methods with a doc template in the doc string are for 'direct' public invocation.
See FMTCBackend for more information.
- Mixed in types
- Implementers
Properties
- friendlyIdentifier → String
-
Generic description/name of this backend
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
cancelRecovery(
{required int id}) → Future< void> - Safely cancel the specified recoverable region
-
createStore(
{required String storeName}) → Future< void> - Create a new store with the specified name
-
deleteStore(
{required String storeName}) → Future< void> - Delete the specified store
-
deleteTile(
{required String storeName, required String url}) → Future< bool?> - Remove the tile from the specified store, deleting it if was orphaned
-
exportStores(
{required String path, required List< String> storeNames}) → Future<void> -
Create an archive at the file
path
containing the specifed stores and their respective tiles -
getRecoverableRegion(
{required int id}) → Future< RecoveredRegion> - Retrieve the specified registered recovery region
-
getStoreStats(
{required String storeName}) → Future< ({int hits, int length, int misses, double size})> - Retrieve the following statistics about the specified store (all available):
-
importStores(
{required String path, required ImportConflictStrategy strategy, required List< String> ? storeNames}) → ImportResult -
Load the specified stores (or all stores if
null
) from the archive file atpath
into the current root, usingstrategy
where there are conflicts -
listImportableStores(
{required String path}) → Future< List< String> > -
Check the stores available inside the archive file at
path
-
listRecoverableRegions(
) → Future< List< RecoveredRegion> > - List all registered recovery regions
-
listStores(
) → Future< List< String> > - List all the available stores
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
readLatestTile(
{required String storeName}) → Future< BackendTile?> - Retrieve the tile most recently modified in the specified store, if any tiles exist
-
readMetadata(
{required String storeName}) → Future< Map< String, String> > - Retrieve the stored metadata for the specified store
-
readTile(
{required String url, String? storeName}) → Future< BackendTile?> - Retrieve a raw tile by the specified URL
-
realSize(
) → Future< double> - Retrieve the actual total size of the database in KiBs
-
registerHitOrMiss(
{required String storeName, required bool hit}) → Future< void> - Register a cache hit or miss on the specified store
-
removeMetadata(
{required String storeName, required String key}) → Future< String?> - Remove the specified key from the metadata for the specified store
-
removeOldestTilesAboveLimit(
{required String storeName, required int tilesLimit}) → Future< int> - Remove tiles in excess of the specified limit from the specified store, oldest first
-
removeTilesOlderThan(
{required String storeName, required DateTime expiry}) → Future< int> - Remove tiles that were last modified after expiry from the specified store
-
renameStore(
{required String currentStoreName, required String newStoreName}) → Future< void> - Change the name of the specified store to the specified new store name
-
resetMetadata(
{required String storeName}) → Future< void> - Clear the metadata for the specified store
-
resetStore(
{required String storeName}) → Future< void> - Remove all the tiles from within the specified store
-
rootLength(
) → Future< int> - Retrieve the total number of tiles in all stores
-
rootSize(
) → Future< double> - Retrieve the total number of KiBs of all tiles' bytes (not 'real total' size) from all stores
-
setBulkMetadata(
{required String storeName, required Map< String, String> kvs}) → Future<void> - Set multiple key-value pairs in the metadata for the specified store
-
setMetadata(
{required String storeName, required String key, required String value}) → Future< void> - Set a key-value pair in the metadata for the specified store
-
storeExists(
{required String storeName}) → Future< bool> - Check whether the specified store currently exists
-
tileExistsInStore(
{required String storeName, required String url}) → Future< bool> - Check whether the specified tile exists in the specified store
-
toString(
) → String -
A string representation of this object.
inherited
-
watchRecovery(
{required bool triggerImmediately}) → Stream< void> - Watch for changes to the recovery system
-
watchStores(
{required List< String> storeNames, required bool triggerImmediately}) → Stream<void> - Watch for changes in the specified stores
-
writeTile(
{required String storeName, required String url, required Uint8List bytes}) → Future< void> -
Create or update a tile (given a
url
and itsbytes
) in the specified store
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited