Class GreenButtonClient
java.lang.Object
energy.eddie.regionconnector.us.green.button.client.GreenButtonClient
- All Implemented Interfaces:
GreenButtonApi
-
Constructor Summary
ConstructorsConstructorDescriptionGreenButtonClient(org.springframework.web.reactive.function.client.WebClient webClient, GreenButtonConfiguration config) -
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Flux<com.rometools.rome.feed.synd.SyndFeed> batchSubscription(String authId, String accessToken, Iterable<String> meters, ZonedDateTime publishedMin, ZonedDateTime publishedMax) reactor.core.publisher.Mono<HistoricalCollectionResponse> collectHistoricalData(List<String> meterIds, String company) Triggers historical data collection for the meters.reactor.core.publisher.Mono<Meter> fetchMeter(String meterId, String company) Fetches the details for one meter.reactor.core.publisher.Flux<MeterListing> fetchMeters(Pages slurp, List<String> authIds, String company) Fetches all meters that have been shared with this utility user.reactor.core.publisher.Mono<Boolean> isAlive()reactor.core.publisher.Mono<org.naesb.espi.ServiceStatus> reactor.core.publisher.Mono<com.rometools.rome.feed.synd.SyndFeed> retailCustomer(String authId, String accessToken) reactor.core.publisher.Mono<Authorization>
-
Constructor Details
-
GreenButtonClient
public GreenButtonClient(org.springframework.web.reactive.function.client.WebClient webClient, GreenButtonConfiguration config)
-
-
Method Details
-
readServiceStatus
public reactor.core.publisher.Mono<org.naesb.espi.ServiceStatus> readServiceStatus()- Specified by:
readServiceStatusin interfaceGreenButtonApi
-
isAlive
- Specified by:
isAlivein interfaceGreenButtonApi
-
batchSubscription
public reactor.core.publisher.Flux<com.rometools.rome.feed.synd.SyndFeed> batchSubscription(String authId, String accessToken, Iterable<String> meters, ZonedDateTime publishedMin, ZonedDateTime publishedMax) - Specified by:
batchSubscriptionin interfaceGreenButtonApi
-
retailCustomer
public reactor.core.publisher.Mono<com.rometools.rome.feed.synd.SyndFeed> retailCustomer(String authId, String accessToken) - Specified by:
retailCustomerin interfaceGreenButtonApi
-
collectHistoricalData
public reactor.core.publisher.Mono<HistoricalCollectionResponse> collectHistoricalData(List<String> meterIds, String company) Description copied from interface:GreenButtonApiTriggers historical data collection for the meters.- Specified by:
collectHistoricalDatain interfaceGreenButtonApi- Parameters:
meterIds- the meters for which the collection should be triggeredcompany- the company to which the meters belong to- Returns:
- the result of the API call
-
fetchMeters
public reactor.core.publisher.Flux<MeterListing> fetchMeters(Pages slurp, List<String> authIds, String company) Description copied from interface:GreenButtonApiFetches all meters that have been shared with this utility user. Uses the JSON API to fetch the meter data: https://utilityapi.com/docs/api/meters/list. The API supports pagination, so it's possible to only request the first page or all pages.- Specified by:
fetchMetersin interfaceGreenButtonApi- Parameters:
slurp- if all pages should be requestedauthIds- auth IDs of the meters of interestcompany- the company which the meters belong to- Returns:
- shared meter
-
fetchMeter
Description copied from interface:GreenButtonApiFetches the details for one meter.- Specified by:
fetchMeterin interfaceGreenButtonApi- Parameters:
meterId- the UID of the metercompany- the company of the meter- Returns:
- the meter details
-
revoke
- Specified by:
revokein interfaceGreenButtonApi
-