/** * Sell a stock holding and removed the holding for the given user. Given a * Holding, retrieve current quote, credit user's account, and reduce * holdings in user's portfolio. * * @param userID the customer requesting the sell * @param holdingID the users holding to be sold * @return OrderDataBean providing the status of the newly created sell * order */ public OrderDataBean sell(String userID, Integer holdingID, int orderProcessingMode) throws Exception { if (Log.doActionTrace()) Log.trace("TradeAction:sell", userID, holdingID, new Integer(orderProcessingMode)); OrderDataBean orderData; orderData = trade.sell(userID, holdingID, orderProcessingMode); if (!(orderData.getOrderStatus().equalsIgnoreCase("cancelled"))) //after the purchase or sell of a stock, update the stocks volume // and price updateQuotePriceVolume(orderData.getSymbol(), TradeConfig.getRandomPriceChangeFactor(), orderData.getQuantity()); return orderData; }
/** * Sell a stock holding and removed the holding for the given user. Given a * Holding, retrieve current quote, credit user's account, and reduce * holdings in user's portfolio. * * @param userID the customer requesting the sell * @param holdingID the users holding to be sold * @return OrderDataBean providing the status of the newly created sell * order */ public OrderDataBean sell(String userID, Integer holdingID, int orderProcessingMode) throws Exception { if (Log.doActionTrace()) Log.trace("TradeAction:sell", userID, holdingID, new Integer(orderProcessingMode)); OrderDataBean orderData; orderData = trade.sell(userID, holdingID, orderProcessingMode); if (!(orderData.getOrderStatus().equalsIgnoreCase("cancelled"))) //after the purchase or sell of a stock, update the stocks volume // and price updateQuotePriceVolume(orderData.getSymbol(), TradeConfig.getRandomPriceChangeFactor(), orderData.getQuantity()); return orderData; }
updateQuotePriceVolume(order.getSymbol(), TradeConfig.getRandomPriceChangeFactor(), order.getQuantity());
updateQuotePriceVolume(order.getSymbol(), TradeConfig.getRandomPriceChangeFactor(), order.getQuantity());
public String toHTML() { return "<BR>Order <B>" + getOrderID() + "</B>" + "<LI> orderType: " + getOrderType() + "</LI>" + "<LI> orderStatus: " + getOrderStatus() + "</LI>" + "<LI> openDate: " + getOpenDate() + "</LI>" + "<LI> completionDate: " + getCompletionDate() + "</LI>" + "<LI> quantity: " + getQuantity() + "</LI>" + "<LI> price: " + getPrice() + "</LI>" + "<LI> orderFee: " + getOrderFee() + "</LI>" + "<LI> symbol: " + getSymbol() + "</LI>" ; }
public String toHTML() { return "<BR>Order <B>" + getOrderID() + "</B>" + "<LI> orderType: " + getOrderType() + "</LI>" + "<LI> orderStatus: " + getOrderStatus() + "</LI>" + "<LI> openDate: " + getOpenDate() + "</LI>" + "<LI> completionDate: " + getCompletionDate() + "</LI>" + "<LI> quantity: " + getQuantity() + "</LI>" + "<LI> price: " + getPrice() + "</LI>" + "<LI> orderFee: " + getOrderFee() + "</LI>" + "<LI> symbol: " + getSymbol() + "</LI>" ; }
updateQuotePriceVolume(order.getSymbol(), TradeConfig.getRandomPriceChangeFactor(), order.getQuantity());
updateQuotePriceVolume(order.getSymbol(), TradeConfig.getRandomPriceChangeFactor(), order.getQuantity());
public String toString() { return "Order " + getOrderID() + "\n\t orderType: " + getOrderType() + "\n\t orderStatus: " + getOrderStatus() + "\n\t openDate: " + getOpenDate() + "\n\t completionDate: " + getCompletionDate() + "\n\t quantity: " + getQuantity() + "\n\t price: " + getPrice() + "\n\t orderFee: " + getOrderFee() + "\n\t symbol: " + getSymbol() ; } public String toHTML()
public String toString() { return "Order " + getOrderID() + "\n\t orderType: " + getOrderType() + "\n\t orderStatus: " + getOrderStatus() + "\n\t openDate: " + getOpenDate() + "\n\t completionDate: " + getCompletionDate() + "\n\t quantity: " + getQuantity() + "\n\t price: " + getPrice() + "\n\t orderFee: " + getOrderFee() + "\n\t symbol: " + getSymbol() ; } public String toHTML()
static OrderDataBean convertOrderDataBean(org.apache.geronimo.samples.daytrader.beans.OrderDataBean bean) { OrderDataBean wsBean = new OrderDataBean(); wsBean.setOrderID(bean.getOrderID()); wsBean.setOrderType(bean.getOrderType()); wsBean.setOrderStatus(bean.getOrderStatus()); wsBean.setOpenDate(toCalendar(bean.getOpenDate())); wsBean.setCompletionDate(toCalendar(bean.getCompletionDate())); wsBean.setQuantity(bean.getQuantity()); wsBean.setPrice(bean.getPrice()); wsBean.setOrderFee(bean.getOrderFee()); wsBean.setSymbol(bean.getSymbol()); return wsBean; }
static OrderDataBean convertOrderDataBean(org.apache.geronimo.samples.daytrader.beans.OrderDataBean bean) { OrderDataBean wsBean = new OrderDataBean(); wsBean.setOrderID(bean.getOrderID()); wsBean.setOrderType(bean.getOrderType()); wsBean.setOrderStatus(bean.getOrderStatus()); wsBean.setOpenDate(toCalendar(bean.getOpenDate())); wsBean.setCompletionDate(toCalendar(bean.getCompletionDate())); wsBean.setQuantity(bean.getQuantity()); wsBean.setPrice(bean.getPrice()); wsBean.setOrderFee(bean.getOrderFee()); wsBean.setSymbol(bean.getSymbol()); return wsBean; }