|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.geronimo.samples.daytrader.TradeAction
public class 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.TradeServletAction}manages 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(String userID,
String symbol,
double quantity,
int orderProcessingMode)
Purchase a stock and create a new holding for the given user. |
void |
cancelOrder(Integer orderID,
boolean twoPhase)
Cancel the Order identified by orderID Orders are submitted through JMS to a Trading Broker and completed asynchronously. |
OrderDataBean |
completeOrder(Integer orderID,
boolean twoPhase)
Complete the Order identefied by orderID Orders are submitted through JMS to a Trading agent and completed asynchronously. |
QuoteDataBean |
createQuote(String symbol,
String companyName,
BigDecimal price)
Given a market symbol, price, and details, create and return a new QuoteDataBean |
AccountDataBean |
getAccountData(String userID)
Return an AccountDataBean object for userID describing the account |
AccountProfileDataBean |
getAccountProfileData(String userID)
Return an AccountProfileDataBean for userID providing the users profile |
Collection |
getAllQuotes()
Return a collection of QuoteDataBean describing all current
quotes |
Collection |
getClosedOrders(String userID)
Get the collection of completed orders for a given account that need to be alerted to the user |
HoldingDataBean |
getHolding(Integer holdingID)
Return a specific user stock holding identifed by the holdingID |
Collection |
getHoldings(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 |
Collection |
getOrders(String userID)
Get the collection of all orders for a given account |
QuoteDataBean |
getQuote(String symbol)
Return a QuoteDataBean describing a current quote for the given
stock symbol |
AccountDataBean |
login(String userID,
String password)
Attempt to authenticate and login a user with the given password |
void |
logout(String userID)
Logout the given user |
void |
orderCompleted(String userID,
Integer orderID)
Signify an order has been completed for the given userID |
void |
queueOrder(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(String userID,
String password,
String fullname,
String address,
String email,
String creditCard,
BigDecimal openBalance)
Register a new Trade customer. |
AccountDataBean |
register(String userID,
String password,
String fullname,
String address,
String email,
String creditCard,
String openBalanceString)
|
RunStatsDataBean |
resetTrade(boolean deleteAll)
Reset the TradeData by - removing all newly registered users by scenario servlet (i.e. users with userID's beginning with "ru:") * - removing all buy/sell order pairs - setting logoutCount = loginCount return statistics for this benchmark run |
OrderDataBean |
sell(String userID,
Integer holdingID,
int orderProcessingMode)
Sell a stock holding and removed the holding for the given user. |
OrderDataBean |
sell(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(String symbol,
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 Exception
getMarketSummary
in interface TradeServices
Exception
public OrderDataBean buy(String userID, String symbol, double quantity, int orderProcessingMode) throws Exception
buy
in interface TradeServices
userID
- the customer requesting the stock purchasesymbol
- the symbol of the stock being purchasedquantity
- the quantity of shares to purchase
Exception
public OrderDataBean sell(String userID, int holdingID, int orderProcessingMode) throws Exception
userID
- the customer requesting the sellholdingID
- the users holding to be sold
Exception
public OrderDataBean sell(String userID, Integer holdingID, int orderProcessingMode) throws Exception
sell
in interface TradeServices
userID
- the customer requesting the sellholdingID
- the users holding to be sold
Exception
public void queueOrder(Integer orderID, boolean twoPhase)
queueOrder
in interface TradeServices
orderID
- the Order being queued for processingpublic OrderDataBean completeOrder(Integer orderID, boolean twoPhase)
completeOrder
in interface TradeServices
orderID
- the Order to complete
public void cancelOrder(Integer orderID, boolean twoPhase)
cancelOrder
in interface TradeServices
orderID
- the Order being queued for processingpublic void orderCompleted(String userID, Integer orderID) throws Exception
TradeServices
orderCompleted
in interface TradeServices
userID
- the user for which an order has completedorderID
- the order which has completed
Exception
public Collection getOrders(String userID) throws Exception
getOrders
in interface TradeServices
userID
- the customer account to retrieve orders for
Exception
public Collection getClosedOrders(String userID) throws Exception
getClosedOrders
in interface TradeServices
userID
- the customer account to retrieve orders for
Exception
public QuoteDataBean createQuote(String symbol, String companyName, BigDecimal price) throws Exception
QuoteDataBean
createQuote
in interface TradeServices
symbol
- the symbol of the stockprice
- the current stock price
Exception
public Collection getAllQuotes() throws Exception
QuoteDataBean
describing all current
quotes
getAllQuotes
in interface TradeServices
Exception
public QuoteDataBean getQuote(String symbol) throws Exception
QuoteDataBean
describing a current quote for the given
stock symbol
getQuote
in interface TradeServices
symbol
- the stock symbol to retrieve the current Quote
Exception
public QuoteDataBean updateQuotePriceVolume(String symbol, BigDecimal changeFactor, double sharesTraded) throws Exception
updateQuotePriceVolume
in interface TradeServices
symbol
- for stock quote to update
Exception
public Collection getHoldings(String userID) throws Exception
getHoldings
in interface TradeServices
userID
- the customer requesting the portfolio
Exception
public HoldingDataBean getHolding(Integer holdingID) throws Exception
getHolding
in interface TradeServices
holdingID
- the holdingID to return
Exception
public AccountDataBean getAccountData(String userID) throws FinderException, RemoteException
getAccountData
in interface TradeServices
userID
- the account userID to lookup
FinderException
RemoteException
public AccountProfileDataBean getAccountProfileData(String userID) throws Exception
getAccountProfileData
in interface TradeServices
userID
- the account userID to lookup
Exception
public AccountProfileDataBean updateAccountProfile(AccountProfileDataBean accountProfileData) throws Exception
updateAccountProfile
in interface TradeServices
accountProfileData
- account profile data in AccountProfileDataBean
Exception
public AccountDataBean login(String userID, String password) throws Exception
login
in interface TradeServices
userID
- the customer to loginpassword
- the password entered by the customer for authentication
Exception
public void logout(String userID) throws Exception
logout
in interface TradeServices
userID
- the customer to logout
Exception
public AccountDataBean register(String userID, String password, String fullname, String address, String email, String creditCard, BigDecimal openBalance) throws Exception
register
in interface TradeServices
userID
- the new customer to registerpassword
- the customers passwordfullname
- the customers fullnameaddress
- the customers street addressemail
- the customers email addresscreditCard
- the customers creditcard numberopenBalance
- the amount to charge to the customers credit to open the
account and set the initial balance
Exception
public AccountDataBean register(String userID, String password, String fullname, String address, String email, String creditCard, String openBalanceString) throws Exception
Exception
public RunStatsDataBean resetTrade(boolean deleteAll) throws Exception
resetTrade
in interface TradeServices
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |