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
-
Field Summary
Fields inherited from class energy.eddie.aiida.adapters.datasource.DataSourceAdapter
dataSource, healthSink, recordSink -
Constructor Summary
ConstructorsConstructorDescriptionSimulationAdapter(SimulationDataSource dataSource) Creates a new SimulationDataSource with the given name. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Stops the periodic generation ofAiidaRecords with random values and emit a complete signal on the Flux that was returned bystart().org.springframework.boot.actuate.health.Healthhealth()reactor.core.publisher.Flux<AiidaRecord> start()Periodically creates anAiidaRecordfor each OBIS code and publishes it on the returned Flux.Methods inherited from class energy.eddie.aiida.adapters.datasource.DataSourceAdapter
create, dataSource, emitAiidaRecordMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.boot.actuate.health.HealthIndicator
getHealth
-
Constructor Details
-
SimulationAdapter
Creates a new SimulationDataSource with the given name. It will publish anAiidaRecordwith a random value inpollingIntervaltime 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
Periodically creates anAiidaRecordfor each OBIS code and publishes it on the returned Flux. Callingclose()will stop the generation.Schedulers.parallel()is used as Scheduler for the Flux that creates the values.- Specified by:
startin classDataSourceAdapter<SimulationDataSource>- Returns:
- Flux of the generated records.
-
close
public void close()Stops the periodic generation ofAiidaRecords with random values and emit a complete signal on the Flux that was returned bystart().- Specified by:
closein interfaceAutoCloseable- Specified by:
closein classDataSourceAdapter<SimulationDataSource>
-
health
public org.springframework.boot.actuate.health.Health health()
-