org.jasig.portlet.weather.dao.worldwide
Class WorldWeatherOnlineDaoImpl
java.lang.Object
org.jasig.portlet.weather.dao.worldwide.WorldWeatherOnlineDaoImpl
- All Implemented Interfaces:
- IWeatherDao, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean
public class WorldWeatherOnlineDaoImpl
- extends Object
- implements IWeatherDao, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
WorldWeatherOnlineDaoImpl
public WorldWeatherOnlineDaoImpl()
setConnectionTimeout
public void setConnectionTimeout(int connectionTimeout)
setReadTimeout
public void setReadTimeout(int readTimeout)
setTimesToRetry
public void setTimesToRetry(int timesToRetry)
setKey
public void setKey(String key)
setImageMapping
public void setImageMapping(org.springframework.core.io.Resource imageMapping)
afterPropertiesSet
public void afterPropertiesSet()
throws Exception
- Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
- Throws:
Exception
destroy
public void destroy()
throws Exception
- Specified by:
destroy in interface org.springframework.beans.factory.DisposableBean
- Throws:
Exception
find
public Collection<Location> find(String location)
- Specified by:
find in interface IWeatherDao
- Parameters:
location - A String representing a location to find
- Returns:
- A collection of locations representing the possible location or
an empty or null collection representing location not found.
getWeather
public Weather getWeather(String locationCode,
TemperatureUnit unit)
- Description copied from interface:
IWeatherDao
- Gets the weather from an implemented source.
- Specified by:
getWeather in interface IWeatherDao
- Parameters:
locationCode - A string value representing the location to retrieve weather
from.
- Returns:
- A Weather object representing the current weather and an optional
forecast.
getWeatherProviderName
public String getWeatherProviderName()
- Specified by:
getWeatherProviderName in interface IWeatherDao
getWeatherProviderLink
public String getWeatherProviderLink()
- Specified by:
getWeatherProviderLink in interface IWeatherDao
getAndDeserialize
protected Object getAndDeserialize(String url,
TemperatureUnit unit)
deserializeWeatherResult
protected Weather deserializeWeatherResult(InputStream inputStream,
TemperatureUnit unit)
throws javax.xml.bind.JAXBException,
ParseException
- Throws:
javax.xml.bind.JAXBException
ParseException
deserializeSearchResults
protected List<Location> deserializeSearchResults(InputStream inputStream)
throws javax.xml.bind.JAXBException
- Throws:
javax.xml.bind.JAXBException
Copyright © 2011 Jasig. All Rights Reserved.