org.apache.jetspeed.webservices.finance.stockmarket
Class JetspeedStockQuoteService

java.lang.Object
  extended byorg.apache.turbine.services.BaseInitable
      extended byorg.apache.turbine.services.BaseService
          extended byorg.apache.turbine.services.TurbineBaseService
              extended byorg.apache.jetspeed.webservices.finance.stockmarket.JetspeedStockQuoteService
All Implemented Interfaces:
org.apache.turbine.services.Initable, org.apache.turbine.services.Service, StockQuoteService

public class JetspeedStockQuoteService
extends org.apache.turbine.services.TurbineBaseService
implements StockQuoteService

Implements StockQuoteService, providing a web service for getting stock quotes.

Version:
$Id: JetspeedStockQuoteService.java,v 1.9 2004/08/31 19:06:32 jford Exp $
Author:
David Sean Taylor

Field Summary
 
Fields inherited from class org.apache.turbine.services.BaseService
configuration, name, properties, serviceBroker
 
Fields inherited from class org.apache.turbine.services.BaseInitable
initableBroker, isInitialized
 
Fields inherited from interface org.apache.jetspeed.webservices.finance.stockmarket.StockQuoteService
SERVICE_NAME
 
Constructor Summary
JetspeedStockQuoteService()
           
 
Method Summary
 StockQuote fullQuote(java.lang.String symbol)
          Get a single stock quote record, given a symbol return a StockQuote object.
 StockQuote[] fullQuotes(java.lang.String[] symbols)
          Get an array of quote records, given a array of stock symbols.
 java.lang.String getWebService()
          Get the name of the web service used by this service to retrieve stock quotes.
 void init(javax.servlet.ServletConfig conf)
           
static void main(java.lang.String[] args)
          usage: java JetspeedStockQuoteService [option] method [params] method: parameter: description: ---------------------------------------------------------------------- quote symbol get the price for the given symbol quotes symbols..
 java.lang.String quote(java.lang.String symbol)
          Get a single stock quote, given a symbol return the current price.
 void setWebService(java.lang.String service)
          Set the name of the web service used by this service to retrieve stock quotes.
 
Methods inherited from class org.apache.turbine.services.TurbineBaseService
init, init, init, shutdown
 
Methods inherited from class org.apache.turbine.services.BaseService
getConfiguration, getName, getProperties, getServiceBroker, setName, setServiceBroker
 
Methods inherited from class org.apache.turbine.services.BaseInitable
getInit, getInitableBroker, setInit, setInitableBroker
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.turbine.services.Service
getConfiguration, getName, getProperties, setName, setServiceBroker
 
Methods inherited from interface org.apache.turbine.services.Initable
getInit, init, init, setInitableBroker, shutdown
 

Constructor Detail

JetspeedStockQuoteService

public JetspeedStockQuoteService()
Method Detail

quote

public java.lang.String quote(java.lang.String symbol)
                       throws java.rmi.RemoteException
Get a single stock quote, given a symbol return the current price.

Specified by:
quote in interface StockQuoteService
Parameters:
symbol - The stock symbol.
Returns:
String The current price.
Throws:
java.rmi.RemoteException

fullQuote

public StockQuote fullQuote(java.lang.String symbol)
                     throws java.rmi.RemoteException
Get a single stock quote record, given a symbol return a StockQuote object.

Specified by:
fullQuote in interface StockQuoteService
Parameters:
symbol - The stock symbol.
Returns:
StockQuote A full stock quote record.
Throws:
java.rmi.RemoteException

fullQuotes

public StockQuote[] fullQuotes(java.lang.String[] symbols)
                        throws java.rmi.RemoteException
Get an array of quote records, given a array of stock symbols.

Specified by:
fullQuotes in interface StockQuoteService
Returns:
StockQuote[] An array of full stock quotes for each stock symbol.
Throws:
java.rmi.RemoteException

setWebService

public void setWebService(java.lang.String service)
Set the name of the web service used by this service to retrieve stock quotes.

Specified by:
setWebService in interface StockQuoteService
Parameters:
service - The name of the web service.

getWebService

public java.lang.String getWebService()
Get the name of the web service used by this service to retrieve stock quotes.

Specified by:
getWebService in interface StockQuoteService
Returns:
String The name of the web service.

main

public static void main(java.lang.String[] args)
usage: java JetspeedStockQuoteService [option] method [params] method: parameter: description: ---------------------------------------------------------------------- quote symbol get the price for the given symbol quotes symbols.. get the prices for 1..n symbols fullQuote symbol get a stock quote record for the given symbol fullQuotes symbols... 1..n symbols to look up multiple stock quote records options: -------- -debug print to stdout the SOAP request and response packets Examples: java JetspeedStockQuoteService quote IBM java JetspeedStockQuoteService quotes IONA CSCO NOK ADSK java JetspeedStockQuoteService -debug fullQuote DST java JetspeedStockQuoteService fullQuotes SUNW MSFT ORCL


init

public void init(javax.servlet.ServletConfig conf)
          throws org.apache.turbine.services.InitializationException
Throws:
org.apache.turbine.services.InitializationException


Copyright © 2000-2005 Apache Software Foundation. All Rights Reserved.