FMTCBackendInternal class abstract interface

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

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, required int? maxLength}) 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<int>
Create an archive at the file path containing the specifed stores and their respective tiles
getRecoverableRegion({required int id}) Future<RecoveredRegion<BaseRegion>>
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 at path into the current root, using strategy where there are conflicts
incrementStoreHits({required List<String> storeNames}) Future<void>
Add a cache hit to all specified stores
incrementStoreMisses({required ({bool includeOrExclude, List<String> storeNames}) storeNames}) Future<void>
Add a cache miss to all specified stores
listImportableStores({required String path}) Future<List<String>>
Check the stores available inside the archive file at path
listRecoverableRegions() Future<List<RecoveredRegion<BaseRegion>>>
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, required ({bool includeOrExclude, List<String> storeNames}) storeNames}) Future<({List<String> allStoreNames, List<String> intersectedStoreNames, BackendTile? tile})>
Retrieve a raw tile by URL from any of the specified stores
realSize() Future<double>
Retrieve the actual total size of the database in KiBs
removeMetadata({required String storeName, required String key}) Future<String?>
Remove the specified key from the metadata for the specified store
removeOldestTilesAboveLimit({required List<String> storeNames}) Future<Map<String, int>>
Remove tiles in excess of the specified limit in each specified store, oldest tile first
removeTilesOlderThan({required String storeName, required DateTime expiry}) Future<int>
Remove tiles that were last modified prior to the expiry timestamp 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
storeGetMaxLength({required String storeName}) Future<int?>
Retrieve the maximum allowable number of tiles within the specified store
storeSetMaxLength({required String storeName, required int? newMaxLength}) Future<void>
Set the maximum allowable number of tiles within the specified store
tileExists({required String url, required ({bool includeOrExclude, List<String> storeNames}) storeNames}) Future<bool>
Check whether the specified tile exists in any of the specified stores
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 url, required Uint8List bytes, required List<String> storeNames, required List<String>? writeAllNotIn}) Future<Map<String, bool>>
Create or update a tile (given a url and its bytes) in the specified store

Operators

operator ==(Object other) bool
The equality operator.
inherited