Class EtaPlusApiClient

java.lang.Object
energy.eddie.regionconnector.de.eta.client.EtaPlusApiClient

@Component public class EtaPlusApiClient extends Object
Client for the ETA Plus API. This client is responsible for fetching validated historical data from the German ETA Plus system.
  • Constructor Details

    • EtaPlusApiClient

      public EtaPlusApiClient(org.springframework.web.reactive.function.client.WebClient webClient, DeEtaPlusConfiguration configuration)
  • Method Details

    • isAlive

      public reactor.core.publisher.Mono<Boolean> isAlive()
      Lightweight reachability probe for the ETA Plus API, used by the health indicator. Sends an unauthenticated GET to the API base URL; any received HTTP response other than a 5xx (including 401/404, which still prove the server is up and serving) is treated as alive. 5xx responses, connection failures and timeouts are not alive.
      Returns:
      a Mono emitting true when the API is reachable, false otherwise
    • fetchMeteredData

      public reactor.core.publisher.Mono<EtaPlusMeteredData> fetchMeteredData(DePermissionRequest permissionRequest, String accessToken)
      Fetch validated historical metered data for a permission request over its full range, capped at today (the API holds no data for future dates).
      Parameters:
      permissionRequest - the permission request containing connection details
      accessToken - the customer's OAuth bearer token
      Returns:
      a Mono emitting the metered data or an error
    • fetchMeteredData

      public reactor.core.publisher.Mono<EtaPlusMeteredData> fetchMeteredData(DePermissionRequest permissionRequest, String accessToken, LocalDate from, LocalDate to)
      Fetch validated historical metered data for a permission request over an explicit window. Used for retransmission requests, where the eligible party specifies the timeframe. The caller is responsible for supplying a valid window (within the permission range and in the past); see RetransmissionValidation.
      Parameters:
      permissionRequest - the permission request containing connection details
      accessToken - the customer's OAuth bearer token
      from - inclusive lower bound of the request window
      to - inclusive upper bound of the request window
      Returns:
      a Mono emitting the metered data or an error
    • fetchAccountingPointData

      public reactor.core.publisher.Mono<EtaPlusAccountingPointData> fetchAccountingPointData(DePermissionRequest permissionRequest, String accessToken)
      Fetch accounting point master data for a permission request. Single-shot fetch — caller is responsible for retry / state transitions on failure. Error envelope bodies (4xx/5xx) are not parsed; status code drives the mapping.
      Parameters:
      permissionRequest - the permission request whose metering point we want
      accessToken - the customer's OAuth bearer
      Returns:
      a Mono emitting the accounting point data or an error