org.jasig.portlet.weather.dao.worldwide
Class WorldWeatherOnlineDaoImpl

java.lang.Object
  extended by 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 java.lang.Object
implements IWeatherDao, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean


Constructor Summary
WorldWeatherOnlineDaoImpl()
           
 
Method Summary
 void afterPropertiesSet()
           
protected  java.util.List<Location> deserializeSearchResults(java.io.InputStream inputStream)
           
protected  Weather deserializeWeatherResult(java.io.InputStream inputStream, TemperatureUnit unit)
           
 void destroy()
           
 java.util.Collection<Location> find(java.lang.String location)
           
protected  java.lang.Object getAndDeserialize(java.lang.String url, TemperatureUnit unit)
           
 Weather getWeather(java.lang.String locationCode, TemperatureUnit unit)
          Gets the weather from an implemented source.
 java.lang.String getWeatherProviderLink()
           
 java.lang.String getWeatherProviderName()
           
 void setConnectionTimeout(int connectionTimeout)
           
 void setImageMapping(org.springframework.core.io.Resource imageMapping)
           
 void setKey(java.lang.String key)
           
 void setReadTimeout(int readTimeout)
           
 void setTimesToRetry(int timesToRetry)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WorldWeatherOnlineDaoImpl

public WorldWeatherOnlineDaoImpl()
Method Detail

setConnectionTimeout

public void setConnectionTimeout(int connectionTimeout)

setReadTimeout

public void setReadTimeout(int readTimeout)

setTimesToRetry

public void setTimesToRetry(int timesToRetry)

setKey

public void setKey(java.lang.String key)

setImageMapping

public void setImageMapping(org.springframework.core.io.Resource imageMapping)

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.

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.

getWeatherProviderName

public java.lang.String getWeatherProviderName()
Specified by:
getWeatherProviderName in interface IWeatherDao

getWeatherProviderLink

public java.lang.String getWeatherProviderLink()
Specified by:
getWeatherProviderLink in interface IWeatherDao

getAndDeserialize

protected java.lang.Object getAndDeserialize(java.lang.String url,
                                             TemperatureUnit unit)

deserializeWeatherResult

protected Weather deserializeWeatherResult(java.io.InputStream inputStream,
                                           TemperatureUnit unit)
                                    throws javax.xml.bind.JAXBException,
                                           java.text.ParseException
Throws:
javax.xml.bind.JAXBException
java.text.ParseException

deserializeSearchResults

protected java.util.List<Location> deserializeSearchResults(java.io.InputStream inputStream)
                                                     throws javax.xml.bind.JAXBException
Throws:
javax.xml.bind.JAXBException


Copyright © 2010 Jasig. All Rights Reserved.