public class StockQuoteHandler extends Object
Constructor and Description |
---|
StockQuoteHandler() |
Modifier and Type | Method and Description |
---|---|
static org.apache.axiom.om.OMElement |
createCustomQuoteRequest(String symbol)
Create a new custom quote request with a body as follows
|
static org.apache.axiom.om.OMElement |
createFullQuoteRequest(String symbol)
Create a new full quote request with a body as follows
|
static org.apache.axiom.om.OMElement |
createMarketActivityRequest()
Create a new market activity request with a body as follows
|
static org.apache.axiom.om.OMElement |
createPlaceOrderRequest(double purchPrice,
int qty,
String symbol)
Create a new order for a quantiry of a stock at a given price
|
static org.apache.axiom.om.OMElement |
createStandardQuoteRequest(String symbol,
int itrCount)
Create a new quote request with a body as follows
|
static String |
parseCustomQuoteResponse(org.apache.axiom.om.OMElement result)
Digests the custom quote response and extracts the last trade price
|
static String |
parseFullQuoteResponse(org.apache.axiom.om.OMElement result)
|
static String |
parseMarketActivityResponse(org.apache.axiom.om.OMElement result)
|
static String |
parseStandardQuoteResponse(org.apache.axiom.om.OMElement result)
Digests the standard StockQuote response and extracts the last trade price
|
static String |
randomString(int count)
Return a random String of letters
|
public static org.apache.axiom.om.OMElement createCustomQuoteRequest(String symbol)
symbol
- the stock symbolpublic static org.apache.axiom.om.OMElement createStandardQuoteRequest(String symbol, int itrCount)
symbol
- the stock symbolpublic static org.apache.axiom.om.OMElement createFullQuoteRequest(String symbol)
symbol
- the stock symbolpublic static org.apache.axiom.om.OMElement createMarketActivityRequest()
public static org.apache.axiom.om.OMElement createPlaceOrderRequest(double purchPrice, int qty, String symbol)
purchPrice
- the purchase priceqty
- the quantirysymbol
- the stockpublic static String parseStandardQuoteResponse(org.apache.axiom.om.OMElement result) throws Exception
result
- XMLStreamException
- Exception
public static String parseFullQuoteResponse(org.apache.axiom.om.OMElement result) throws Exception
-2.367492989603466 13.14956711287784 -155.58844623078153 157.47582716569198 Mon Apr 16 23:29:58 LKT 2007 -155.31924118819015 6373750.467022192 IBM Company -154.84071720443495 -17.353258031353164 -1.3910235348298898 170.1979104108393 IBM 8935
3.794122022240518 -8.656536789776045 176.77136802352928 170.28677783945102 Mon Apr 16 23:29:58 LKT 2007 -166.64126635049223 -6112014.916847887 IBM Company -168.30884678174925 -18.644628475049693 -2.29678289479374 -165.19288918603885 IBM 5825
result
- Exception
public static String parseMarketActivityResponse(org.apache.axiom.om.OMElement result) throws Exception
result
- Exception
public static String parseCustomQuoteResponse(org.apache.axiom.om.OMElement result) throws Exception
result
- XMLStreamException
- IBM
Exception
public static String randomString(int count)
count
- number of lettersCopyright © 2005-2017 Apache Software Foundation. All Rights Reserved.