GenericController class

This Class Acts as an intermediate class to relay storageRequests to the StorageMapper.

This class contains the interaction API every actor (sensor, shields, UI,...) calls methods from this controller to manipulate data.

Implemented types

Constructors

GenericController(String _owner, StorageMapper mapper)
Construct the controller according to the database that is used.

Properties

hashCode int
The hash code for this object.
no setterinherited
listeners Map<SearchCriteria, Set<StorageListener>>
a map of all registered listeners for changes.
final
mapper StorageMapper
the storage mapper to be used.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

add(Node node) Future<void>
Add StorageNode to data.
override
addOrUpdate(Node? node) Future<bool>
add or update the node and all materialized sub-nodes.
override
addOrUpdateValue(String nodeName, NodeValue newValue) Future<bool>
Adds or updates a NodeValueObject to StorageNode and returns true if the value was added.
override
addValue(String nodeName, NodeValue newValue) Future<void>
Add NodeValueObject to StorageNode.
override
close() Future<void>
Closes all database connections and flushes the content.
override
delete(String path) Future<Node>
Remove a StorageNode from the data.
override
deleteValue(String nodeName, String key) Future<NodeValue>
Updates one NodeValueObject with a new NodeValueObject by copying all fields except key.
override
deregisterChangeListener(StorageListener listener) Future<List<SearchCriteria>>
Removes a registered listener.
override
dump([String rootNode = ':', String prefix = '']) Future<String>
Gets a dump of the whole storage as string representation.
override
flush() Future<void>
Flushes all values to the backend.
override
get(String path) Future<Node>
Fetches a node by its path.
override
getNodeOrTombstone(String path) Future<Node>
Fetches a node by its path.
override
getValue(String path, String key) Future<NodeValue?>
Get a single value from a node.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerChangeListener(StorageListener listener, SearchCriteria criteria) Future<void>
Registers a listener for a specific search criteria.
override
rename(String oldPath, String newPathOrName) Future<void>
Rename a node identified by a path.
override
*
override
toString() String
A string representation of this object.
inherited
update(Node node) Future<void>
Update a StorageNode inside the data.
override
updateValue(String nodeName, NodeValue newValue) Future<void>
Updates one NodeValueObject with a new NodeValueObject.
override
zap() Future<void>
Clear the entire storage.
override

Operators

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

Static Properties

defaultController StorageController?
getter/setter pair
preloadData bool
getter/setter pair

Static Methods

getDefault() StorageController?
Returns the latest created controller within the JVM.
getResourceOrFile(String? name) Future<String>

Constants

pathDelimiter → const String
the path delimiter.