Class ValidatedHistoricalDataStream
- All Implemented Interfaces:
AutoCloseable
Before emitting, data need constraints (energy type and granularity) are enforced:
if the received data does not satisfy the constraints stored on the permission request,
the request is marked PermissionProcessStatus.UNFULFILLABLE and no data is published.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidpublish(DePermissionRequest permissionRequest, EtaPlusMeteredData data) Validates data need constraints and, if satisfied, publishes validated historical data to the stream and updates the latest reading state.voidpublishRetransmission(DePermissionRequest permissionRequest, EtaPlusMeteredData data) Publishes retransmitted validated historical data to the outbound stream without mutating permission state.reactor.core.publisher.Flux<IdentifiableValidatedHistoricalData> Get the flux of validated historical data.
-
Constructor Details
-
Method Details
-
validatedHistoricalData
Get the flux of validated historical data. Subscribers (like JsonRawDataProvider) use this.- Returns:
- the flux of identifiable validated historical data
-
publish
Validates data need constraints and, if satisfied, publishes validated historical data to the stream and updates the latest reading state.When the permission request carries an energy type (VHD data needs), the following checks are applied to the received readings:
- Energy type: the unit of the first reading must correspond to
DePermissionRequest.energyType(). A mismatch means the MDA is serving the wrong commodity (e.g. gas instead of electricity). - Granularity: when at least two readings are present, the interval between
the first two sorted readings must match
DePermissionRequest.granularity(). If the interval cannot be mapped to a knownGranularity, it passes through (the MDA may have a temporary data gap).
PermissionProcessStatus.UNFULFILLABLEevent is committed and no data is published to the stream.- Parameters:
permissionRequest- the permission request the data belongs todata- the validated historical data from ETA Plus
- Energy type: the unit of the first reading must correspond to
-
publishRetransmission
Publishes retransmitted validated historical data to the outbound stream without mutating permission state.Unlike
publish(DePermissionRequest, EtaPlusMeteredData), this method neither updates the latest-meter-reading watermark nor emits any status event. A retransmission re-delivers data the eligible party already received for a window in the past, so it must not regress the fulfillment watermark — which would otherwise trigger redundant re-polling of the whole range — nor change the permission's status (e.g. toPermissionProcessStatus.UNFULFILLABLE). The data still reaches the outbound connectors through the same stream consumed by the raw-data and CIM providers.- Parameters:
permissionRequest- the permission request the data belongs todata- the validated historical data fetched for the retransmission window
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-