Package energy.eddie.aiida.streamers
Interface AiidaStreamer
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
MqttStreamer
Streams the records of a permission to the streaming target (EP) and receives
PermissionCommands from it.
Implementations should initialize and prepare any necessary resources on creation, but only open connections and
stream data after connect() was called.-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Unsubscribe from any Flux and free any used resources in this method.voidcloseTerminally(AiidaConnectionStatusMessageDto statusMessage) Sends aAiidaConnectionStatusMessageDtowith the passedstatusbefore closing this streamer for good.voidconnect()Open required connections to the streaming target (EP) in this method, not beforehand.booleanReturns whether this streamer is currently connected to the streaming target (EP).voidpublishSchemaPayload(UUID permissionId, AiidaSchema schema, String payload) Publishes a payload of the provided schema to the permission of the provided id.voidsetTransmissionEnabled(boolean enabled) Enables or disables data transmission for this streamer.voidupdateRecordFlux(reactor.core.publisher.Flux<AiidaRecord> recordFlux) Replaces the record flux this streamer is subscribed to and resubscribes.
-
Method Details
-
connect
void connect()Open required connections to the streaming target (EP) in this method, not beforehand. Subscribe to the Fluxes in this method, to receive records and status messages that shall be sent. Start listening for termination requests from the EP. -
isConnected
boolean isConnected()Returns whether this streamer is currently connected to the streaming target (EP). -
close
void close()Unsubscribe from any Flux and free any used resources in this method. May flush all queued messages beforehand.- Specified by:
closein interfaceAutoCloseable
-
closeTerminally
Sends aAiidaConnectionStatusMessageDtowith the passedstatusbefore closing this streamer for good. May block until the passedstatusMessageis transmitted.- See Also:
-
setTransmissionEnabled
void setTransmissionEnabled(boolean enabled) Enables or disables data transmission for this streamer. While disabled, records are not published to the EP. -
updateRecordFlux
Replaces the record flux this streamer is subscribed to and resubscribes. Used to apply a new transmission schedule, which re-aggregates the upstream records on a different cadence. -
publishSchemaPayload
Publishes a payload of the provided schema to the permission of the provided id.
-