Interface ISystemDriverRegistry
There is one system registry per sensor hub that is used to keep the list and state of all systems registered on this hub. (i.e. sensors, actuators, processes, other data sources). The registry generates events when systems are added and removed from the registry. Implementations backed by a persistent store can be used to persist systems state across restarts.
Note that implementations of this interface may not expose the driver/module objects directly. They usually keep a shadow object reflecting the state of the system instead; thus clients of this interface should not rely on specific functionality of the driver module itself.
- Since:
- Feb 18, 2019
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiongetDatabase
(String systemUID) Provides direct read/write access to the database that is currently handling observation data from the specified system driverboolean
hasDatabase
(String systemUID) Checks if a database is currently handling data generated by the specified systemboolean
isRegistered
(String uid) Checks if the given system driver is registered on this hubAsynchronously registers a feature of interest.register
(IStreamingControlInterface controlStream) Asynchronously registers a control interface.register
(IStreamingDataInterface dataStream) Asynchronously registers a datastream / data interface.register
(IProcedureWithDesc proc) Registers a procedure implemented by a system driver.
The procedure can be the datasheet of a piece of equipment (e.g.register
(ISystemDriver proc) Asynchronously registers a system driver (e.g.register
(ISystemDriver sys, IFeature foi) Asynchronously registers a feature of interest.void
registerDatabase
(String systemUID, IObsSystemDatabase db) Configures the registry to write data produced by the system driver with the specified UID to the provided observing system database.default void
registerDatabase
(Collection<String> systemUIDs, IObsSystemDatabase db) Helper method to register several system/database mappings at once.unregister
(ISystemDriver sys) Unregisters a system driver and all its datastreams, command streams and subsystems, recursively.void
Unregisters a system to observation database mapping.
-
Method Details
-
register
Asynchronously registers a system driver (e.g. sensor driver, etc.) with this registry. Implementation of this method must take take care of forwarding all events produced by the driver to the event bus.
If the system is aIDataProducer
, this method takes care of registering all FOIs associated with the system at the time of registration (i.e. returned byIDataProducer.getCurrentFeaturesOfInterest()
).
If the system is aISystemGroupDriver
, this method takes care of registering all subsystems defined by the driver at the time of registration (i.e. returned byISystemGroupDriver.getMembers()
).
Note that a singleSystemAddedEvent
is generated for the parent system. No event is generated for members of a system group.- Parameters:
proc
- The system driver instance- Returns:
- A future that will be completed when the system is successfully registered or report an exception if an error occurred.
-
register
Registers a procedure implemented by a system driver.
The procedure can be the datasheet of a piece of equipment (e.g. sensor, platform, etc.), or it can be a methodology implemented by an operator to measure, sample or act on features of interest.
System descriptions (that represent system instances) can then refer to these procedures/datasheets instead of including all information in each instance.- Parameters:
proc
- The procedure description- Returns:
- A future that will be completed when the procedure is successfully unregistered or report an exception if an error occurred.
-
register
Asynchronously registers a datastream / data interface.- Parameters:
dataStream
- The streaming data interface of a system driver- Returns:
- A future that will be completed when the datastream is successfully registered or report an exception if an error occurred.
-
register
Asynchronously registers a control interface.- Parameters:
controlStream
- The streaming control interface of a system driver- Returns:
- A future that will be completed when the control interface is successfully registered or report an exception if an error occurred.
-
register
Asynchronously registers a feature of interest.- Parameters:
proc
- The system observing or targeting the feature of interestfoi
- The feature of interest- Returns:
- A future that will be completed when the feature of interest is successfully registered or report an exception if an error occurred.
-
register
Asynchronously registers a feature of interest.- Parameters:
sysUID
- The unique identifier of the system hosting the feature of interestfoi
- The feature of interest- Returns:
- A future that will be completed when the feature of interest is successfully registered or report an exception if an error occurred.
-
unregister
Unregisters a system driver and all its datastreams, command streams and subsystems, recursively.
Note that unregistering the system doesn't remove it from the data store but only disconnects the system driver and send aSystemDisabledEvent
event.- Parameters:
sys
- The system driver instance- Returns:
- A future that will be completed when the system driver is successfully unregistered or report an exception if an error occurred.
-
isRegistered
Checks if the given system driver is registered on this hub- Parameters:
uid
-- Returns:
- True if a driver has previously registered a system with the given UID, false otherwise
-
getSystemStateDatabase
ISystemStateDatabase getSystemStateDatabase()- Returns:
- The database containing the latest state of systems registered on this hub when they are not associated to a historical database. Note that information contained in this database is also accessible as read-only through the federated hub database.
-
registerDatabase
Configures the registry to write data produced by the system driver with the specified UID to the provided observing system database.This can be called multiple times to register multiple mappings with the same database instance. However, several databases cannot contain data for the same system so a given system UID cannot be mapped to different database instances using this method.
Note that the database is not required to contain data for the specified system at the time of the call.
- Parameters:
systemUID
- Unique ID of system to associate with the databasedb
- A database instance- Throws:
IllegalArgumentException
- if the database is not writable
-
registerDatabase
Helper method to register several system/database mappings at once.- Parameters:
systemUIDs
- Unique IDs of systems to associate with the databasedb
- The database instance
-
unregisterDatabase
Unregisters a system to observation database mapping.- Parameters:
systemUID
- Unique ID of systems previously associated with the specified databasedb
- A database instance
-
hasDatabase
Checks if a database is currently handling data generated by the specified system- Parameters:
systemUID
- Unique ID of the system- Returns:
- true if a database has been registered, false otherwise
-
getDatabase
Provides direct read/write access to the database that is currently handling observation data from the specified system driver- Parameters:
systemUID
- Unique ID of the system- Returns:
- The database instance or null if none has been registered for the specified system
-