Interface ForecastSnapshotReceiver

All Superinterfaces:
StreamingResponseReceiver
All Known Subinterfaces:
ForecastSnapshotSubscribedReceiver

public interface ForecastSnapshotReceiver extends StreamingResponseReceiver
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 Type
    Method
    Description
    void
    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
    Invoked when the header has been processed.
    void
    Invoked as a new rating value set is encountered in the stream

    Methods 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

      void header(ForecastSnapshotHeader header)
      Invoked when the header has been processed. Will be invoked before processing resources
      Parameters:
      header - parsed header
    • beginResource

      void beginResource(String resourceId)
      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 to period(ForecastPeriodSnapshot) until endResource() is invoked.
      Parameters:
      resourceId - the next resource Id.
    • period

      void period(ForecastPeriodSnapshot 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 to beginResource(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 by beginResource(String) is no longer valid.
    • endSnapshot

      void endSnapshot()
      Invoked when the snapshot has reached its end.