Class EtaPlusApiClient
java.lang.Object
energy.eddie.regionconnector.de.eta.client.EtaPlusApiClient
Client for the ETA Plus API.
This client is responsible for fetching validated historical data from the German ETA Plus system.
-
Constructor Summary
ConstructorsConstructorDescriptionEtaPlusApiClient(org.springframework.web.reactive.function.client.WebClient webClient, DeEtaPlusConfiguration configuration) -
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono<EtaPlusAccountingPointData> fetchAccountingPointData(DePermissionRequest permissionRequest, String accessToken) Fetch accounting point master data for a permission request.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).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.reactor.core.publisher.Mono<Boolean> isAlive()Lightweight reachability probe for the ETA Plus API, used by the health indicator.
-
Constructor Details
-
EtaPlusApiClient
public EtaPlusApiClient(org.springframework.web.reactive.function.client.WebClient webClient, DeEtaPlusConfiguration configuration)
-
-
Method Details
-
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
truewhen the API is reachable,falseotherwise
-
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 detailsaccessToken- 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); seeRetransmissionValidation.- Parameters:
permissionRequest- the permission request containing connection detailsaccessToken- the customer's OAuth bearer tokenfrom- inclusive lower bound of the request windowto- 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 wantaccessToken- the customer's OAuth bearer- Returns:
- a Mono emitting the accounting point data or an error
-