Interface IDatabaseRegistry


public interface IDatabaseRegistry

Interface for the main database registry on a sensor hub.

This database registry keeps track of which database contains data for each system registered on the hub.

It also exposes a federated database which provides read-only access to all historical observations available from this hub, along with the corresponding systems, datastreams, command channels and features of interest metadata. The federated database aggregates data from all databases registered with this registry.

With a minimum setup (i.e. no database configured), the federated database gives access to the latest state of all registered systems (e.g. latest system description, latest observations, latest observed FOI) but no historical data will be available.

  • Method Details

    • register

      void register(IDatabase db)
      Register a database to be exposed through the federated database.

      If the database is a ISystemDriverDatabase a mapping is registered with the system UIDs obtained by calling the ISystemDriverDatabase.getHandledSystems() method
      Parameters:
      db -
    • unregister

      void unregister(IDatabase db)
      Unregister a database and all its mappings
      Parameters:
      db -
    • getAllDatabases

      Collection<IDatabase> getAllDatabases()
      Returns:
      The list of all databases registered on the hub (read-only)
    • getObsDatabaseByNum

      IObsSystemDatabase getObsDatabaseByNum(int dbNum)
      Provides direct (potentially read/write) access to the obs system database with the specified number
      Parameters:
      dbNum - Database number (unique on a given hub instance)
      Returns:
      The database instance or null if none has been assigned the specified number
    • getObsDatabaseByModuleID

      IObsSystemDatabase getObsDatabaseByModuleID(String moduleID)
      Provides direct (potentially read/write) access to the database with the specified module ID
      Parameters:
      moduleID - Id of the database module
      Returns:
      The database instance
      Throws:
      IllegalArgumentException - if no database module with the given ID exists
    • getObsSystemDatabases

      Collection<IObsSystemDatabase> getObsSystemDatabases()
      Returns:
      The list of all obs system databases registered on the hub (read-only)
    • getProcedureDatabases

      Collection<IProcedureDatabase> getProcedureDatabases()
      Returns:
      The list of all procedure databases registered on the hub (read-only)
    • getProcedureDatabaseByNum

      IProcedureDatabase getProcedureDatabaseByNum(int dbNum)
      Provides direct (potentially read/write) access to the procedure database with the specified number
      Parameters:
      dbNum - Database number (unique on a given hub instance)
      Returns:
      The database instance or null if none has been assigned the specified number
    • getFeatureDatabases

      Collection<IFeatureDatabase> getFeatureDatabases()
      Returns:
      The list of all feature databases registered on the hub (read-only)
    • getFeatureDatabaseByNum

      IFeatureDatabase getFeatureDatabaseByNum(int dbNum)
      Provides direct (potentially read/write) access to the feature database with the specified number
      Parameters:
      dbNum - Database number (unique on a given hub instance)
      Returns:
      The database instance or null if none has been assigned the specified number
    • getFederatedDatabase

      IFederatedDatabase getFederatedDatabase()
      Returns:
      This hub's federated observation database.
      See class description for more information about the federated DB