org.jasig.portlet.weather.dao.accuweather.xstream
Class WeatherDaoImpl
java.lang.Object
org.jasig.portlet.weather.dao.accuweather.xstream.WeatherDaoImpl
- All Implemented Interfaces:
- net.sf.ehcache.constructs.blocking.CacheEntryFactory, IWeatherDao, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean
@Repository
public class WeatherDaoImpl
- extends java.lang.Object
- implements IWeatherDao, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, net.sf.ehcache.constructs.blocking.CacheEntryFactory
AccuWeather.com weather data implementation using Xstream to parse XML.
- Version:
- $Id$
- Author:
- Dustin Schultz
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
WeatherDaoImpl
public WeatherDaoImpl()
setConnectionTimeout
public void setConnectionTimeout(int connectionTimeout)
setReadTimeout
public void setReadTimeout(int readTimeout)
setTimesToRetry
public void setTimesToRetry(int timesToRetry)
setWeatherDataCache
public void setWeatherDataCache(net.sf.ehcache.Ehcache ehcache)
setWeatherDataErrorCache
public void setWeatherDataErrorCache(net.sf.ehcache.Ehcache weatherDataErrorCache)
afterPropertiesSet
public void afterPropertiesSet()
throws java.lang.Exception
- Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
- Throws:
java.lang.Exception
destroy
public void destroy()
throws java.lang.Exception
- Specified by:
destroy in interface org.springframework.beans.factory.DisposableBean
- Throws:
java.lang.Exception
find
public java.util.Collection<Location> find(java.lang.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.
createEntry
public java.lang.Object createEntry(java.lang.Object o)
throws java.lang.Exception
- Specified by:
createEntry in interface net.sf.ehcache.constructs.blocking.CacheEntryFactory
- Throws:
java.lang.Exception
getWeather
public Weather getWeather(java.lang.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.
checkCachedException
protected void checkCachedException(java.util.Map<java.lang.String,java.lang.Object> key)
getAndDeserialize
protected java.lang.Object getAndDeserialize(java.lang.String url,
com.thoughtworks.xstream.XStream deserializer)
Copyright © 2009 Jasig. All Rights Reserved.