|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TradeServices
TradeServices interface specifies the business methods provided by the Trade online broker application.
These business methods represent the features and operations that can be performed by customers of
the brokerage such as login, logout, get a stock quote, buy or sell a stock, etc.
This interface is implemented by Trade
providing an EJB implementation of these
business methods and also by TradeDirect
providing a JDBC implementation.
Trade
,
TradeDirect
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 identefied by orderID The boolean twoPhase specifies to the server implementation whether or not the method is to participate in a global transaction |
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. |
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. |
AccountProfileDataBean |
updateAccountProfile(AccountProfileDataBean profileData)
Update userID's account profile information using the provided AccountProfileDataBean object |
QuoteDataBean |
updateQuotePriceVolume(String symbol,
BigDecimal newPrice,
double sharesTraded)
Update the stock quote price and volume for the specified stock symbol |
Method Detail |
---|
MarketSummaryDataBean getMarketSummary() throws Exception, RemoteException
Exception
RemoteException
OrderDataBean buy(String userID, String symbol, double quantity, int orderProcessingMode) throws Exception, RemoteException
userID
- the customer requesting the stock purchasesymbol
- the symbol of the stock being purchasedquantity
- the quantity of shares to purchase
Exception
RemoteException
OrderDataBean sell(String userID, Integer holdingID, int orderProcessingMode) throws Exception, RemoteException
userID
- the customer requesting the sellholdingID
- the users holding to be sold
Exception
RemoteException
void queueOrder(Integer orderID, boolean twoPhase) throws Exception, RemoteException
orderID
- the Order being queued for processing
Exception
RemoteException
OrderDataBean completeOrder(Integer orderID, boolean twoPhase) throws Exception, RemoteException
orderID
- the Order to complete
Exception
RemoteException
void cancelOrder(Integer orderID, boolean twoPhase) throws Exception, RemoteException
orderID
- the Order to complete
Exception
RemoteException
void orderCompleted(String userID, Integer orderID) throws Exception, RemoteException
userID
- the user for which an order has completedorderID
- the order which has completed
Exception
RemoteException
Collection getOrders(String userID) throws Exception, RemoteException
userID
- the customer account to retrieve orders for
Exception
RemoteException
Collection getClosedOrders(String userID) throws Exception, RemoteException
userID
- the customer account to retrieve orders for
Exception
RemoteException
QuoteDataBean createQuote(String symbol, String companyName, BigDecimal price) throws Exception, RemoteException
QuoteDataBean
symbol
- the symbol of the stockprice
- the current stock pricedetails
- a short description of the stock or company
Exception
RemoteException
QuoteDataBean getQuote(String symbol) throws Exception, RemoteException
QuoteDataBean
describing a current quote for the given stock symbol
symbol
- the stock symbol to retrieve the current Quote
Exception
RemoteException
Collection getAllQuotes() throws Exception, RemoteException
Collection
of QuoteDataBean
describing all current quotes
Exception
RemoteException
QuoteDataBean updateQuotePriceVolume(String symbol, BigDecimal newPrice, double sharesTraded) throws Exception, RemoteException
symbol
- for stock quote to updateprice
- the updated quote price
Exception
RemoteException
Collection getHoldings(String userID) throws Exception, RemoteException
userID
- the customer requesting the portfolio
Exception
RemoteException
HoldingDataBean getHolding(Integer holdingID) throws Exception, RemoteException
holdingID
- the holdingID to return
Exception
RemoteException
AccountDataBean getAccountData(String userID) throws FinderException, RemoteException
userID
- the account userID to lookup
FinderException
RemoteException
AccountProfileDataBean getAccountProfileData(String userID) throws Exception, RemoteException
userID
- the account userID to lookupUser
- account profile data in AccountProfileDataBean
Exception
RemoteException
AccountProfileDataBean updateAccountProfile(AccountProfileDataBean profileData) throws Exception, RemoteException
userID
- the account userID to lookupUser
- account profile data in AccountProfileDataBean
Exception
RemoteException
AccountDataBean login(String userID, String password) throws Exception, RemoteException
userID
- the customer to loginpassword
- the password entered by the customer for authentication
Exception
RemoteException
void logout(String userID) throws Exception, RemoteException
userID
- the customer to logout
Exception
RemoteException
AccountDataBean register(String userID, String password, String fullname, String address, String email, String creditcard, BigDecimal openBalance) throws Exception, RemoteException
userID
- the new customer to registerpassword
- the customers passwordfullname
- the customers fullnameaddress
- the customers street addressemail
- the customers email addresscreditcard
- the customers creditcard numberinitialBalance
- the amount to charge to the customers credit to open the account and set the initial balance
Exception
RemoteException
RunStatsDataBean resetTrade(boolean deleteAll) throws Exception, RemoteException
Exception
RemoteException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |