|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.apache.geronimo.samples.daytrader.TradeAction
The TradeAction class provides the generic client side access to each of the
Trade brokerage user operations. These include login, logout, buy, sell,
getQuote, etc. The TradeAction class does not handle user interface
processing and should be used by a class that is UI specific. For example,
trade_client.TradeServletActionmanages a web interface to Trade,
making calls to TradeAction methods to actually performance each operation.
| Constructor Summary | |
TradeAction()
|
|
TradeAction(TradeServices trade)
|
|
| Method Summary | |
OrderDataBean |
buy(java.lang.String userID,
java.lang.String symbol,
double quantity,
int orderProcessingMode)
Purchase a stock and create a new holding for the given user. |
void |
cancelOrder(java.lang.Integer orderID,
boolean twoPhase)
Cancel the Order identified by orderID Orders are submitted through JMS to a Trading Broker and completed asynchronously. |
OrderDataBean |
completeOrder(java.lang.Integer orderID,
boolean twoPhase)
Complete the Order identefied by orderID Orders are submitted through JMS to a Trading agent and completed asynchronously. |
QuoteDataBean |
createQuote(java.lang.String symbol,
java.lang.String companyName,
java.math.BigDecimal price)
Given a market symbol, price, and details, create and return a new QuoteDataBean |
AccountDataBean |
getAccountData(java.lang.String userID)
Return an AccountDataBean object for userID describing the account |
AccountProfileDataBean |
getAccountProfileData(java.lang.String userID)
Return an AccountProfileDataBean for userID providing the users profile |
java.util.Collection |
getAllQuotes()
Return a collection of QuoteDataBeandescribing all current
quotes |
java.util.Collection |
getClosedOrders(java.lang.String userID)
Get the collection of completed orders for a given account that need to be alerted to the user |
HoldingDataBean |
getHolding(java.lang.Integer holdingID)
Return a specific user stock holding identifed by the holdingID |
java.util.Collection |
getHoldings(java.lang.String userID)
Return the portfolio of stock holdings for the specified customer as a collection of HoldingDataBeans |
MarketSummaryDataBean |
getMarketSummary()
Compute and return a snapshot of the current market conditions This includes the TSIA - an index of the price of the top 100 Trade stock quotes The openTSIA ( the index at the open) The volume of shares traded, Top Stocks gain and loss |
java.util.Collection |
getOrders(java.lang.String userID)
Get the collection of all orders for a given account |
QuoteDataBean |
getQuote(java.lang.String symbol)
Return a QuoteDataBeandescribing a current quote for the given
stock symbol |
AccountDataBean |
login(java.lang.String userID,
java.lang.String password)
Attempt to authenticate and login a user with the given password |
void |
logout(java.lang.String userID)
Logout the given user |
void |
orderCompleted(java.lang.String userID,
java.lang.Integer orderID)
Signify an order has been completed for the given userID |
void |
queueOrder(java.lang.Integer orderID,
boolean twoPhase)
Queue the Order identified by orderID to be processed Orders are submitted through JMS to a Trading Broker and completed asynchronously. |
AccountDataBean |
register(java.lang.String userID,
java.lang.String password,
java.lang.String fullname,
java.lang.String address,
java.lang.String email,
java.lang.String creditCard,
java.math.BigDecimal openBalance)
Register a new Trade customer. |
AccountDataBean |
register(java.lang.String userID,
java.lang.String password,
java.lang.String fullname,
java.lang.String address,
java.lang.String email,
java.lang.String creditCard,
java.lang.String openBalanceString)
|
RunStatsDataBean |
resetTrade(boolean deleteAll)
Reset the TradeData by - removing all newly registered users by scenario servlet (i.e. |
OrderDataBean |
sell(java.lang.String userID,
java.lang.Integer holdingID,
int orderProcessingMode)
Sell a stock holding and removed the holding for the given user. |
OrderDataBean |
sell(java.lang.String userID,
int holdingID,
int orderProcessingMode)
Sell(SOAP 2.2 Wrapper converting int to Integer) a stock holding and removed the holding for the given user. |
AccountProfileDataBean |
updateAccountProfile(AccountProfileDataBean accountProfileData)
Update userID's account profile information using the provided AccountProfileDataBean object |
QuoteDataBean |
updateQuotePriceVolume(java.lang.String symbol,
java.math.BigDecimal changeFactor,
double sharesTraded)
Update the stock quote price for the specified stock symbol |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public TradeAction()
public TradeAction(TradeServices trade)
| Method Detail |
public MarketSummaryDataBean getMarketSummary()
throws java.lang.Exception
getMarketSummary in interface TradeServicesjava.lang.Exception
public OrderDataBean buy(java.lang.String userID,
java.lang.String symbol,
double quantity,
int orderProcessingMode)
throws java.lang.Exception
buy in interface TradeServicesuserID - the customer requesting the stock purchasesymbol - the symbol of the stock being purchasedquantity - the quantity of shares to purchase
java.lang.Exception
public OrderDataBean sell(java.lang.String userID,
int holdingID,
int orderProcessingMode)
throws java.lang.Exception
userID - the customer requesting the sellholdingID - the users holding to be sold
java.lang.Exception
public OrderDataBean sell(java.lang.String userID,
java.lang.Integer holdingID,
int orderProcessingMode)
throws java.lang.Exception
sell in interface TradeServicesuserID - the customer requesting the sellholdingID - the users holding to be sold
java.lang.Exception
public void queueOrder(java.lang.Integer orderID,
boolean twoPhase)
queueOrder in interface TradeServicesorderID - the Order being queued for processing
public OrderDataBean completeOrder(java.lang.Integer orderID,
boolean twoPhase)
completeOrder in interface TradeServicesorderID - the Order to complete
public void cancelOrder(java.lang.Integer orderID,
boolean twoPhase)
cancelOrder in interface TradeServicesorderID - the Order being queued for processing
public void orderCompleted(java.lang.String userID,
java.lang.Integer orderID)
throws java.lang.Exception
TradeServices
orderCompleted in interface TradeServicesuserID - the user for which an order has completedorderID - the order which has completed
java.lang.Exception
public java.util.Collection getOrders(java.lang.String userID)
throws java.lang.Exception
getOrders in interface TradeServicesuserID - the customer account to retrieve orders for
java.lang.Exception
public java.util.Collection getClosedOrders(java.lang.String userID)
throws java.lang.Exception
getClosedOrders in interface TradeServicesuserID - the customer account to retrieve orders for
java.lang.Exception
public QuoteDataBean createQuote(java.lang.String symbol,
java.lang.String companyName,
java.math.BigDecimal price)
throws java.lang.Exception
QuoteDataBean
createQuote in interface TradeServicessymbol - the symbol of the stockprice - the current stock price
java.lang.Exception
public java.util.Collection getAllQuotes()
throws java.lang.Exception
QuoteDataBeandescribing all current
quotes
getAllQuotes in interface TradeServicesjava.lang.Exception
public QuoteDataBean getQuote(java.lang.String symbol)
throws java.lang.Exception
QuoteDataBeandescribing a current quote for the given
stock symbol
getQuote in interface TradeServicessymbol - the stock symbol to retrieve the current Quote
java.lang.Exception
public QuoteDataBean updateQuotePriceVolume(java.lang.String symbol,
java.math.BigDecimal changeFactor,
double sharesTraded)
throws java.lang.Exception
updateQuotePriceVolume in interface TradeServicessymbol - for stock quote to update
java.lang.Exception
public java.util.Collection getHoldings(java.lang.String userID)
throws java.lang.Exception
getHoldings in interface TradeServicesuserID - the customer requesting the portfolio
java.lang.Exception
public HoldingDataBean getHolding(java.lang.Integer holdingID)
throws java.lang.Exception
getHolding in interface TradeServicesholdingID - the holdingID to return
java.lang.Exception
public AccountDataBean getAccountData(java.lang.String userID)
throws javax.ejb.FinderException,
java.rmi.RemoteException
getAccountData in interface TradeServicesuserID - the account userID to lookup
javax.ejb.FinderException
java.rmi.RemoteException
public AccountProfileDataBean getAccountProfileData(java.lang.String userID)
throws java.lang.Exception
getAccountProfileData in interface TradeServicesuserID - the account userID to lookup
java.lang.Exception
public AccountProfileDataBean updateAccountProfile(AccountProfileDataBean accountProfileData)
throws java.lang.Exception
updateAccountProfile in interface TradeServicesjava.lang.Exception
public AccountDataBean login(java.lang.String userID,
java.lang.String password)
throws java.lang.Exception
login in interface TradeServicesuserID - the customer to loginpassword - the password entered by the customer for authentication
java.lang.Exception
public void logout(java.lang.String userID)
throws java.lang.Exception
logout in interface TradeServicesuserID - the customer to logout
java.lang.Exception
public AccountDataBean register(java.lang.String userID,
java.lang.String password,
java.lang.String fullname,
java.lang.String address,
java.lang.String email,
java.lang.String creditCard,
java.math.BigDecimal openBalance)
throws java.lang.Exception
register in interface TradeServicesuserID - the new customer to registerpassword - the customers passwordfullname - the customers fullnameaddress - the customers street addressemail - the customers email addresscreditCard - the customers creditcard number
java.lang.Exception
public AccountDataBean register(java.lang.String userID,
java.lang.String password,
java.lang.String fullname,
java.lang.String address,
java.lang.String email,
java.lang.String creditCard,
java.lang.String openBalanceString)
throws java.lang.Exception
java.lang.Exception
public RunStatsDataBean resetTrade(boolean deleteAll)
throws java.lang.Exception
resetTrade in interface TradeServicesjava.lang.Exception
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||