com.webalgorithm.weather.service
Class WeatherService

java.lang.Object
  |
  +--com.webalgorithm.weather.service.WeatherService

public class WeatherService
extends java.lang.Object

Description: Weather.com Service Provides with easy and simple access to current weather

Copyright: Copyright (c) 2003

Company: WebAlgorithm, Inc

Version:
1.0

Field Summary
private static org.apache.commons.logging.Log log
           
 
Constructor Summary
WeatherService()
           
 
Method Summary
static com.webalgorithm.weather.vo.LocationVO[] lookupLocations(java.lang.String location)
          Location lookup is usefull when user does not have a zip code or location id, but still wishes to utilize the weather service.
static com.webalgorithm.weather.vo.WeatherVO lookupWeather(java.lang.String locationId, int days, java.lang.String unit, java.lang.String partnerId, java.lang.String licenseKey)
          This method looks up weather for a given location.
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static org.apache.commons.logging.Log log
Constructor Detail

WeatherService

public WeatherService()
Method Detail

lookupWeather

public static com.webalgorithm.weather.vo.WeatherVO lookupWeather(java.lang.String locationId,
                                                                  int days,
                                                                  java.lang.String unit,
                                                                  java.lang.String partnerId,
                                                                  java.lang.String licenseKey)
                                                           throws WeatherException
This method looks up weather for a given location.

Parameters:
locationId - - Location zipcode or Weather.com Location Id. Location Id my be obtained by utilizing a location search available as part of this service.
days - - Days ahead to look 1-10
unit - - 'm' - metric, 's' - standard
partnerId - - partnerId, this is your partnerId with weather.com, it is FREE but you need to register. For information on how to obtain parterId please visit http://registration.weather.com/registration/xmloap/step1
licenseKey - - this is your license key as issued by weather.com, this key will be emailed to you once you complete registration. It is free!!!
Returns:
- Returned the WeatherVO object
Throws:
java.lang.Exception - - In case of Network, IO or parsing issues.
WeatherException

lookupLocations

public static com.webalgorithm.weather.vo.LocationVO[] lookupLocations(java.lang.String location)
                                                                throws SearchException
Location lookup is usefull when user does not have a zip code or location id, but still wishes to utilize the weather service.

Parameters:
location - This is a name of your location, for example: Dallas, New York, etc
Returns:
Return array of LocationVO objects.
Throws:
java.lang.Exception
SearchException

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
java.lang.Exception


Copyright © 2003 WebAlgorithm, Inc All Rights Reserved.