|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.aries.samples.ariestrader.persist.jdbc.TradeJdbc
public class TradeJdbc
TradeJdbc uses direct JDBC access to a
javax.sql.DataSource to implement the business methods of 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. and are
specified in the org.apache.aries.samples.ariestrader.TradeServices
interface
Note: In order for this class to be thread-safe, a new TradeJDBC must be
created for each call to a method from the TradeInterface interface.
Otherwise, pooled connections may not be released.
org.apache.aries.samples.ariestrader.TradeServices| Constructor Summary | |
|---|---|
TradeJdbc()
Zero arg constructor for TradeJdbc |
|
TradeJdbc(boolean inSession)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TradeJdbc()
public TradeJdbc(boolean inSession)
| Method Detail |
|---|
public void setDataSource(DataSource dataSource)
public void setInSession(boolean inSession)
public MarketSummaryDataBean getMarketSummary()
throws Exception
getMarketSummary in interface TradeServicesExceptionTradeServices.getMarketSummary()
public OrderDataBean buy(String userID,
String symbol,
double quantity,
int orderProcessingMode)
throws Exception
buy in interface TradeServicesExceptionTradeServices#buy(String, String, double)
public OrderDataBean sell(String userID,
Integer holdingID,
int orderProcessingMode)
throws Exception
sell in interface TradeServicesExceptionTradeServices#sell(String, Integer)
public void queueOrder(Integer orderID,
boolean twoPhase)
throws Exception
queueOrder in interface TradeServicesExceptionTradeServices#queueOrder(Integer)
public OrderDataBean completeOrder(Integer orderID,
boolean twoPhase)
throws Exception
completeOrder in interface TradeServicesExceptionTradeServices#completeOrder(Integer)
public void cancelOrder(Integer orderID,
boolean twoPhase)
throws Exception
cancelOrder in interface TradeServicesExceptionTradeServices.cancelOrder(Integer, boolean)
public void orderCompleted(String userID,
Integer orderID)
throws Exception
orderCompleted in interface TradeServicesException
public Collection getOrders(String userID)
throws Exception
getOrders in interface TradeServicesExceptionTradeServices.getOrders(String)
public Collection getClosedOrders(String userID)
throws Exception
getClosedOrders in interface TradeServicesExceptionTradeServices.getClosedOrders(String)
public QuoteDataBean createQuote(String symbol,
String companyName,
BigDecimal price)
throws Exception
createQuote in interface TradeServicesExceptionTradeServices.createQuote(String, String, BigDecimal)
public QuoteDataBean getQuote(String symbol)
throws Exception
getQuote in interface TradeServicesExceptionTradeServices.getQuote(String)
public Collection getAllQuotes()
throws Exception
getAllQuotes in interface TradeServicesExceptionTradeServices#getAllQuotes(String)
public Collection getHoldings(String userID)
throws Exception
getHoldings in interface TradeServicesExceptionTradeServices.getHoldings(String)
public HoldingDataBean getHolding(Integer holdingID)
throws Exception
getHolding in interface TradeServicesExceptionTradeServices.getHolding(Integer)
public AccountDataBean getAccountData(String userID)
throws Exception
getAccountData in interface TradeServicesExceptionTradeServices.getAccountData(String)
public AccountDataBean getAccountData(int accountID)
throws Exception
ExceptionTradeServices.getAccountData(String)
public AccountProfileDataBean getAccountProfileData(String userID)
throws Exception
getAccountProfileData in interface TradeServicesExceptionTradeServices.getAccountProfileData(String)
public AccountProfileDataBean updateAccountProfile(String userID,
String password,
String fullName,
String address,
String email,
String creditcard)
throws Exception
updateAccountProfile in interface TradeServicesExceptionTradeServices#updateAccountProfile(AccountProfileDataBean)
public QuoteDataBean updateQuotePriceVolume(String symbol,
BigDecimal changeFactor,
double sharesTraded)
throws Exception
updateQuotePriceVolume in interface TradeServicesException
public QuoteDataBean updateQuotePriceVolumeInt(String symbol,
BigDecimal changeFactor,
double sharesTraded,
boolean publishQuotePriceChange)
throws Exception
symbol - The PK of the quotechangeFactor - the percent to change the old price by (between 50% and 150%)sharedTraded - the ammount to add to the current volumepublishQuotePriceChange - used by the PingJDBCWrite Primitive to ensure no JMS is used, should be true for all normal calls to
this API
Exception
public AccountDataBean login(String userID,
String password)
throws Exception
login in interface TradeServicesExceptionTradeServices.login(String, String)
public void logout(String userID)
throws Exception
logout in interface TradeServicesExceptionTradeServices.logout(String)
public AccountDataBean register(String userID,
String password,
String fullname,
String address,
String email,
String creditCard,
BigDecimal openBalance)
throws Exception
register in interface TradeServicesExceptionTradeServices#register(String, String, String, String, String, String, BigDecimal, boolean)public void init()
public void destroy()
public TradeConfig.ModeType getMode()
getMode in interface TradeServices
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||