Interface ForecastSnapshotReceiver
- All Superinterfaces:
StreamingResponseReceiver
- All Known Subinterfaces:
ForecastSnapshotSubscribedReceiver
Streaming receiver for updated forecast snapshot data and errors from subscriber.
The current request handling can be terminated in any of these methods by throwing an exception.
Errors originating from the subscriber thread will be sent to
StreamingResponseReceiver.error(StreamingGetException)
-
Method Summary
Modifier and TypeMethodDescriptionvoid
beginResource
(String resourceId) Invoked to indicate that a new resource has been found while parsing.void
Invoked when a new snapshot is received.void
Invoked when the end of a set of ratings for the current resource has been encountered.void
Invoked when the snapshot has reached its end.void
header
(ForecastSnapshotHeader header) Invoked when the header has been processed.void
period
(ForecastPeriodSnapshot period) Invoked as a new rating value set is encountered in the streamMethods inherited from interface energy.trolie.client.StreamingResponseReceiver
error
-
Method Details
-
beginSnapshot
void beginSnapshot()Invoked when a new snapshot is received. This will be the first method invoked when the snapshot is received. -
header
Invoked when the header has been processed. Will be invoked before processing resources- Parameters:
header
- parsed header
-
beginResource
Invoked to indicate that a new resource has been found while parsing. Implementations may assume that all period ratings for this resource will be consumed through invocations toperiod(ForecastPeriodSnapshot)
untilendResource()
is invoked.- Parameters:
resourceId
- the next resource Id.
-
period
Invoked as a new rating value set is encountered in the stream- Parameters:
period
- rating data for a given period. The resource ID is implied from the context, assuming the last call tobeginResource(String)
.
-
endResource
void endResource()Invoked when the end of a set of ratings for the current resource has been encountered. Users may assume that the last resource set bybeginResource(String)
is no longer valid. -
endSnapshot
void endSnapshot()Invoked when the snapshot has reached its end.
-