Interface ISystemDriverRegistry


public 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 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 a IDataProducer, this method takes care of registering all FOIs associated with the system at the time of registration (i.e. returned by IDataProducer.getCurrentFeaturesOfInterest()).

      If the system is a ISystemGroupDriver, this method takes care of registering all subsystems defined by the driver at the time of registration (i.e. returned by ISystemGroupDriver.getMembers()).

      Note that a single SystemAddedEvent 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 interest
      foi - 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

      CompletableFuture<Boolean> register(String sysUID, IFeature foi)
      Asynchronously registers a feature of interest.
      Parameters:
      sysUID - The unique identifier of the system hosting the feature of interest
      foi - 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 a SystemDisabledEvent 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

      boolean isRegistered(String uid)
      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

      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.

      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 database
      db - A database instance
      Throws:
      IllegalArgumentException - if the database is not writable
    • registerDatabase

      default void registerDatabase(Collection<String> systemUIDs, IObsSystemDatabase db)
      Helper method to register several system/database mappings at once.
      Parameters:
      systemUIDs - Unique IDs of systems to associate with the database
      db - The database instance
    • unregisterDatabase

      void unregisterDatabase(IObsSystemDatabase db)
      Unregisters a system to observation database mapping.
      Parameters:
      systemUID - Unique ID of systems previously associated with the specified database
      db - A database instance
    • hasDatabase

      boolean hasDatabase(String systemUID)
      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

      IObsSystemDatabase getDatabase(String systemUID)
      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