Class SimulationAdapter

java.lang.Object
energy.eddie.aiida.adapters.datasource.DataSourceAdapter<SimulationDataSource>
energy.eddie.aiida.adapters.datasource.simulation.SimulationAdapter
All Implemented Interfaces:
AutoCloseable, org.springframework.boot.actuate.health.HealthContributor, org.springframework.boot.actuate.health.HealthIndicator

public class SimulationAdapter extends DataSourceAdapter<SimulationDataSource>
  • Constructor Details

    • SimulationAdapter

      public SimulationAdapter(SimulationDataSource dataSource)
      Creates a new SimulationDataSource with the given name. It will publish an AiidaRecord with a random value in pollingInterval time gaps for these OBIS codes:
      • 1-0:1.8.0
      • 1-0:2.8.0
      • 1-0:1.7.0
      • 1-0:2.7.0
      Parameters:
      dataSource - The unique identifier (UUID) of this data source.
  • Method Details

    • start

      public reactor.core.publisher.Flux<AiidaRecord> start()
      Periodically creates an AiidaRecord for each OBIS code and publishes it on the returned Flux. Calling close() will stop the generation.

      Schedulers.parallel() is used as Scheduler for the Flux that creates the values.

      Specified by:
      start in class DataSourceAdapter<SimulationDataSource>
      Returns:
      Flux of the generated records.
    • close

      public void close()
      Stops the periodic generation of AiidaRecords with random values and emit a complete signal on the Flux that was returned by start().
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in class DataSourceAdapter<SimulationDataSource>
    • health

      public org.springframework.boot.actuate.health.Health health()