⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 trademanagementsessionremote.java

📁 Oracle的J2EE Sample
💻 JAVA
字号:
/*
 * @author  : Pushkala
 * @version : 1.0
 *
 * Development Environment : Oracle9i JDeveloper
 *
 * Name of the File : TradeManagementSessionRemote.java
 *
 * Creation / Modification History
 *    Pushkala        26-Apr-2002        Created
 *
 */
package oracle.otnsamples.ibfbs.trademanagement.ejb;

import java.rmi.RemoteException;
import java.sql.SQLException;

import java.util.Collection;
import java.util.Hashtable;

/**
 * This acts as a remote interface to the Session Bean namely
 * 'TradeManagementSessionFacadeBean'. This Session facade bean manages
 * all the Trade Management Functionality such as
 * a) Getting / Setting Portfolio
 * b) Getting / Setting TradeDetails
 * c) Adding Portfolio / TradeDetails
 * d) Updating Portfolio / TradeDetails
 * e) Rollback of Portfolio / TradeDetails
 * f) Getting the Stock Rate information
 * g) Interacting with UserManagement EJB to get User Account Information,
 *    Contact Information
 *
 * Note that the data for all the above functionality comes from UserAccount
 * Local Entity Bean, Portfolio Local Entity Bean and TradeDetails Local
 * Entity Bean. The client never invokes those Entity Beans directly but all
 * the calls to the Entity Beans goes through this Session Bean and thus we
 * demonstrate Session Facade Design Pattern.
 *
 * Also note that the clients while calling the methods in this Session Bean,
 * pass the Value Object - A Granular object encapsulating a set of related
 * fields. The usage of Value Object Design Pattern, helps in reducing network
 * traffic between client and bean.
 *
 * @version 1.0
 * @since   1.0
 */
public interface TradeManagementSessionRemote extends javax.ejb.EJBObject {

  // Declare the TradeManagement Related Methods which will be
  // invoked by the client

  /**
   * This method gets the Portfolio Information for the input Account Number.
   * A User can have multiple Portfolio details, so a collection of Portfolio
   * Information is returned.
   *
   * @param accountNumber Account Number
   * @param recordNumber  Record Number
   * @param linesPerPage  Lines Per Page
   * @return The Collection of Portfolio Information for the
   *         input Account Number
   * @exception RemoteException
   * @since 1.0
   */
  public Collection getPortfolio(Integer accountNumber, String recordNumber,
                                 int linesPerPage)
      throws RemoteException;

  /**
   * This method gets the Portfolio Valuation Information for the input
   * Account Number. A User can have multiple Portfolio details, so a
   * collection of Portfolio Valuation Information is returned.
   *
   * @param accountNumber Account Number
   * @param recordNumber  Record Number
   * @param linesPerPage  Lines Per Page
   * @return The Collection of Portfolio Valuation Information for the
   *         input Account Number
   * @exception RemoteException
   * @since 1.0
   */
  public Collection getPortfolioValuation(Integer accountNumber,
                                          String recordNumber,
                                          int linesPerPage)
      throws RemoteException;

  /**
   * This method gets the TradeDetails corresponding to a particular User.
   * The user can have multiple trade details for the account. Hence
   * this method returns a collection of the Trade Details information.
   *
   * @param accountNumber Account Number
   * @param recordNumber  Record Number
   * @param linesPerPage  Lines Per Page
   * @return Returns the Collection of Trade details Information for
   *         input User Account Number
   * @exception RemoteException
   * @since 1.0
   */
  public Collection getTradeDetails(Integer accountNumber, String recordNumber,
                                    int linesPerPage)
      throws RemoteException;

  /**
   * This method is called from TradeManagementHelper when the user buys
   * stock using the application. If the User has enough balance to carry out
   * the transaction, the trade amount is deducted from his account and
   * Portfolio Details, Trade Details are added. The Order Details are sent by
   * calling the method sendOrderDetails. If the available balance for the user
   * is not sufficient for the transaction, corresponding message is returned.
   * If everything goes through fine, 'SUCCESS' message is returned.
   * Else On 'FAILURE', corresponding message is returned.
   *
   * @param accountNo  Account Number
   * @param quantity   Quantity of stocks bought
   * @param symbol     Stock Symbol
   * @param isTraded   Boolean indicating if the symbol is traded or not
   * @param userEmail  Email id of the Logged in User
   * @param systemDate Formatted String containing value of System Date
   * @return The return message indicates whether the buy transaction
   *         was a success or failure.
   * @exception RemoteException
   * @exception SQLException
   * @since 1.0
   */
  public String buyStock(Integer accountNo, Integer quantity, String symbol,
                         boolean isTraded, String userEmail, Hashtable connHash, String systemDate)
      throws RemoteException, SQLException;

  /**
   * This method is called by TradeManagementHelper and is used by the
   * AdminHelper to transfer stocks from a corporate to an individual.
   * Portfolio details and Trade Details are added.
   * The Order Details are sent by calling the method sendOrderDetails.
   *
   * @param toAccountNumber Account Number to which Stocks are
   *                        to be transfered
   * @param symbol       Stock Symbol
   * @param qty          Quantity
   * @param price        Price
   * @param isTraded     Boolean indicating if the symbol
   *                     is traded or not
   * @param userEmail    Email id of the Logged in User
   * @param systemDate   Formatted String containing value of System Date
   * @return An integer indicating success or failure,
   *         0 indicates success and -1 indicates failure
   * @exception RemoteException
   * @since 1.0
   */
  public Integer corporateTransfer(Integer toAccountNumber, String symbol,
                                   Integer qty, Float price, boolean isTraded,
                                   String userEmail, Hashtable connHash, String systemDate)
      throws RemoteException;

  /**
   * This method is called from TradeManagementHelper when the user sells stock
   * using the application. The trade amount is calculated after getting the
   * current stock price. Trade Details are added. Portfolio details are
   * updated. The User's Available balance is updated depending on whether the
   * stock was bought by the user or obtained through corporate transfer.
   * In case of corporate transfer only the difference between the current
   * stock value and the stock value when it was transfered (ie,. the profit)
   * is updated. In case the profit is negative, the balance remains unchanged.
   * Order Details are sent by calling the method sendOrderDetails.
   *
   * @param accountNo    User Account Number
   * @param qtyValues    String Array of Stock Quantity Values
   * @param lineNos      String Array of Line Numbers
   * @param symbols      String Array of Stock Symbols
   * @param tradeId      String Array of Trade Id
   * @param isTradedFlag String Array containing 'Y' if the symbol is traded
   *                     or 'N' if not
   * @param userEmail    Email id of the Logged in User
   * @param systemDate   Formatted String containing value of System Date
   * @return The return message is a string which contains details
   *         about the failure or success of the sell transactions.
   * @exception RemoteException
   * @exception SQLException
   * @since 1.0
   */
  public String sellStock(Integer accountNo, String[] qtyValues,
                          String[] lineNos, String[] symbols,
                          String[] tradeId, String[] isTraded,
                          String userEmail, Hashtable connHash, String systemDate)
      throws RemoteException, SQLException;

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -