Interface WeatherServiceRequester
- All Known Implementing Classes:
AccuWeatherRequester,OpenWeatherMapRequester,YahooWeatherRequester
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Requester of a remote weather service to fetch weather forecast data over several days.
- Author:
- mmoquillon
-
Method Summary
Modifier and TypeMethodDescriptionstatic WeatherServiceRequestergetForService(String serviceName) Gets the requester relative to the specified weather service.Request weather forecast data of the specified city.
-
Method Details
-
getForService
Gets the requester relative to the specified weather service.- Parameters:
serviceName- a name of the weather service- Returns:
- the requester for the specified weather service. If the service isn't supported, then returns the default weather service used by Silverpeas.
-
request
Request weather forecast data of the specified city. If the requesting fails, then aWebApplicationExceptionis thrown.- Parameters:
cityId- a unique identifier of a city. Such identifiers are specific to the weather service.- Returns:
- a JSON or an XML representation of the weather forecast data.
-