Class WeatherConfiguration
- java.lang.Object
-
- org.apache.camel.component.weather.WeatherConfiguration
-
@UriParams public class WeatherConfiguration extends Object
-
-
Constructor Summary
Constructors Constructor Description WeatherConfiguration()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetAppid()IntegergetCnt()StringgetGeolocationAccessKey()GeoLocationProvidergetGeoLocationProvider()StringgetGeolocationRequestHostIP()StringgetHeaderName()org.apache.http.impl.client.CloseableHttpClientgetHttpClient()List<String>getIds()WeatherLanguagegetLanguage()StringgetLat()StringgetLocation()StringgetLon()WeatherModegetMode()StringgetName()StringgetPeriod()StringgetRightLon()StringgetTopLat()WeatherUnitsgetUnits()WeatherApigetWeatherApi()StringgetZip()IntegergetZoom()voidsetAppid(String appid)APPID ID used to authenticate the user connected to the API ServervoidsetCnt(Integer cnt)Number of results to be foundvoidsetGeolocationAccessKey(String geolocationAccessKey)The geolocation service now needs an accessKey to be usedvoidsetGeoLocationProvider(GeoLocationProvider geoLocationProvider)A custum geolocation provider to determine the longitude and latitude to use when no location information is set.voidsetGeolocationRequestHostIP(String geolocationRequestHostIP)The geolocation service now needs to specify the IP associated to the accessKey you're usingvoidsetHeaderName(String headerName)To store the weather result in this header instead of the message body.voidsetHttpClient(org.apache.http.impl.client.CloseableHttpClient httpClient)To use an existing configured http client (for example with http proxy)voidsetIds(String id)List of id's of city/stations.voidsetIds(List<String> ids)voidsetLanguage(WeatherLanguage language)Language of the response.voidsetLat(String lat)Latitude of location.voidsetLocation(String location)If null Camel will try and determine your current location using the geolocation of your ip address, else specify the city,country.voidsetLon(String lon)Longitude of location.voidsetMode(WeatherMode mode)The output format of the weather data.voidsetName(String name)voidsetPeriod(String period)If null, the current weather will be returned, else use values of 5, 7, 14 days.voidsetRightLon(String rightLon)For boxed queries this is the right longtitude.voidsetTopLat(String topLat)For boxed queries this is the top latitude.voidsetUnits(WeatherUnits units)The units for temperature measurement.voidsetWeatherApi(WeatherApi weatherApi)The API to use (current, forecast/3 hour, forecast daily, station)voidsetZip(String zip)Zip-code, e.g.voidsetZoom(Integer zoom)For boxed queries this is the zoom.
-
-
-
Method Detail
-
getPeriod
public String getPeriod()
-
setPeriod
public void setPeriod(String period)
If null, the current weather will be returned, else use values of 5, 7, 14 days. Only the numeric value for the forecast period is actually parsed, so spelling, capitalisation of the time period is up to you (its ignored)
-
getName
public String getName()
-
setName
public void setName(String name)
-
getMode
public WeatherMode getMode()
-
setMode
public void setMode(WeatherMode mode)
The output format of the weather data.
-
getUnits
public WeatherUnits getUnits()
-
setUnits
public void setUnits(WeatherUnits units)
The units for temperature measurement.
-
getLocation
public String getLocation()
-
setLocation
public void setLocation(String location)
If null Camel will try and determine your current location using the geolocation of your ip address, else specify the city,country. For well known city names, Open Weather Map will determine the best fit, but multiple results may be returned. Hence specifying and country as well will return more accurate data. If you specify "current" as the location then the component will try to get the current latitude and longitude and use that to get the weather details. You can use lat and lon options instead of location.
-
getHeaderName
public String getHeaderName()
-
setHeaderName
public void setHeaderName(String headerName)
To store the weather result in this header instead of the message body. This is useable if you want to keep current message body as-is.
-
getLat
public String getLat()
-
setLat
public void setLat(String lat)
Latitude of location. You can use lat and lon options instead of location. For boxed queries this is the bottom latitude.
-
getLon
public String getLon()
-
setLon
public void setLon(String lon)
Longitude of location. You can use lat and lon options instead of location. For boxed queries this is the left longtitude.
-
setAppid
public void setAppid(String appid)
APPID ID used to authenticate the user connected to the API Server
-
getAppid
public String getAppid()
-
getLanguage
public WeatherLanguage getLanguage()
-
setLanguage
public void setLanguage(WeatherLanguage language)
Language of the response.
-
getRightLon
public String getRightLon()
-
setRightLon
public void setRightLon(String rightLon)
For boxed queries this is the right longtitude. Needs to be used in combination with topLat and zoom.
-
getTopLat
public String getTopLat()
-
setTopLat
public void setTopLat(String topLat)
For boxed queries this is the top latitude. Needs to be used in combination with rightLon and zoom.
-
getZoom
public Integer getZoom()
-
setZoom
public void setZoom(Integer zoom)
For boxed queries this is the zoom. Needs to be used in combination with rightLon and topLat.
-
getZip
public String getZip()
-
setZip
public void setZip(String zip)
Zip-code, e.g. 94040,us
-
setIds
public void setIds(String id)
List of id's of city/stations. You can separate multiple ids by comma.
-
getCnt
public Integer getCnt()
-
setCnt
public void setCnt(Integer cnt)
Number of results to be found
-
getWeatherApi
public WeatherApi getWeatherApi()
-
setWeatherApi
public void setWeatherApi(WeatherApi weatherApi)
The API to use (current, forecast/3 hour, forecast daily, station)
-
getGeolocationAccessKey
public String getGeolocationAccessKey()
-
setGeolocationAccessKey
public void setGeolocationAccessKey(String geolocationAccessKey)
The geolocation service now needs an accessKey to be used
-
getGeolocationRequestHostIP
public String getGeolocationRequestHostIP()
-
setGeolocationRequestHostIP
public void setGeolocationRequestHostIP(String geolocationRequestHostIP)
The geolocation service now needs to specify the IP associated to the accessKey you're using
-
getHttpClient
public org.apache.http.impl.client.CloseableHttpClient getHttpClient()
-
setHttpClient
public void setHttpClient(org.apache.http.impl.client.CloseableHttpClient httpClient)
To use an existing configured http client (for example with http proxy)
-
getGeoLocationProvider
public GeoLocationProvider getGeoLocationProvider()
-
setGeoLocationProvider
public void setGeoLocationProvider(GeoLocationProvider geoLocationProvider)
A custum geolocation provider to determine the longitude and latitude to use when no location information is set. The default implementaion uses the ipstack API and requires geolocationAccessKey and geolocationRequestHostIP
-
-