Package com.bigbank.account

Examples of com.bigbank.account.AccountReport


        return null;
    }

    public AccountReport getAccountReport(int customerID) {
        final AccountFactory accountFactory = AccountFactory.INSTANCE;
        AccountReport accountReport = accountFactory.createAccountReport();
        List accounts = accountReport.getAccountSummaries();

        AccountSummary account = accountFactory.createAccountSummary();
        account.setAccountType("1111");
        account.setAccountNumber("22-22-22");
        account.setBalance(123.45F);
        accounts.add(account);

        account = accountFactory.createAccountSummary();
        account.setAccountType("04-11-19");
        account.setAccountNumber("11-23");
        account.setBalance(543.21F);
        accounts.add(account);

        List stocks = accountReport.getStockSummaries();
        StockSummary stock = accountFactory.createStockSummary();
        stock.setSymbol("IBM");
        stock.setPurchaseDate("1999-11-23");
        stock.setPurchaseLotNumber(101);
        stock.setPurchasePrice(33.33F);
View Full Code Here


    }

    public AccountReport getAccountReport(final int customerID) throws RemoteException {
        try {
            final AccountFactory accountFactory = AccountFactory.INSTANCE;
            final AccountReport accountReport = accountFactory.createAccountReport();
            InputStream mapping = createConfigStream();

            Connection conn = getConnection();
            DAS das = DAS.FACTORY.createDAS(mapping, conn);

            Command select = das.createCommand("SELECT accountNumber, accountType, balance FROM accounts where id = ?");
            select.setParameter(1, customerID);

            DataObject root = select.executeQuery();
            accountReport.getAccountSummaries().addAll(root.getList("AccountSummary"));

            // Get Stocks

            select = das.createCommand("SELECT Symbol, quantity, purchasePrice, purchaseDate, purchaseLotNumber  FROM stocks where id = ?");
            select.setParameter(1, customerID);

            // select.addConverter("STOCKS.PURCHASEDATE", DateConverter.class.getName());

            root = select.executeQuery();
            accountReport.getStockSummaries().addAll(root.getList("StockSummary"));

            conn.close();

            return accountReport;
        } catch (Exception e) {
View Full Code Here

    @SuppressWarnings("unchecked")
    public AccountReport getAccountReport(int customerID) throws RemoteException {

        try {
            AccountReport accountReport = accountDataService.getAccountReport(customerID);
            // convert to local currency.
            List<AccountSummary> accounts = accountReport.getAccountSummaries();
            for (AccountSummary accountSummary : accounts) {
                accountSummary.setBalance(fromUSDollarToCurrency(accountSummary.getBalance()));

            }
            return updateStockInformation(accountReport);
View Full Code Here

        tuscany.start();
        ModuleContext moduleContext = CurrentModuleContext.getContext();

        AccountService accountService = (AccountService) moduleContext.locateService("AccountServiceComponent");

        AccountReport accountReport = accountService.getAccountReport(12345);

        for (Iterator i = accountReport.getAccountSummaries().iterator(); i.hasNext();) {
            AccountSummary accountSummary = (AccountSummary) i.next();

            System.out.println(accountSummary.getAccountNumber());
            System.out.println(accountSummary.getAccountType());
            System.out.println(accountSummary.getBalance());
View Full Code Here

        return null;
    }

    public AccountReport getAccountReport(int customerID) {
        final AccountFactory accountFactory = AccountFactory.INSTANCE;
        AccountReport accountReport = accountFactory.createAccountReport();
        List accounts = accountReport.getAccountSummaries();

        AccountSummary account = accountFactory.createAccountSummary();
        account.setAccountType("1111");
        account.setAccountNumber("22-22-22");
        account.setBalance(123.45F);
        accounts.add(account);

        account = accountFactory.createAccountSummary();
        account.setAccountType("04-11-19");
        account.setAccountNumber("11-23");
        account.setBalance(543.21F);
        accounts.add(account);

        List stocks = accountReport.getStockSummaries();
        StockSummary stock = accountFactory.createStockSummary();
        stock.setSymbol("IBM");
        stock.setPurchaseDate("1999-11-23");
        stock.setPurchaseLotNumber(101);
        stock.setPurchasePrice(33.33F);
View Full Code Here

    }

    public AccountReport getAccountReport(final int customerID) throws RemoteException {
        try {
            final AccountFactory accountFactory = AccountFactory.INSTANCE;
            final AccountReport accountReport = accountFactory.createAccountReport();
            InputStream mapping = createConfigStream();

            Command select = Command.FACTORY.createCommand("SELECT accountNumber, accountType, balance FROM accounts where id = :id", mapping);
            Connection conn = getConnection();
            select.setConnection(conn);
            select.setParameterValue("id", customerID);
            TypeHelper helper = TypeHelper.INSTANCE;
            select.setDataObjectModel(helper.getType(DataGraphRoot.class));
            DataGraphRoot root = (DataGraphRoot) select.executeQuery();
            accountReport.getAccountSummaries().addAll(root.getAccountSummaries());

            // Get Stocks

            select = Command.FACTORY.createCommand(
                    "SELECT Symbol, quantity, purchasePrice, purchaseDate, purchaseLotNumber  FROM stocks where id = :id", createConfigStream());
            select.setConnection(conn);
            select.setParameterValue("id", customerID);
            select.setDataObjectModel(helper.getType(DataGraphRoot.class));

            // select.addConverter("STOCKS.PURCHASEDATE", DateConverter.class.getName());

            root = (DataGraphRoot) select.executeQuery();
            accountReport.getStockSummaries().addAll(root.getStockSummaries());

            conn.close();

            return accountReport;
        } catch (Exception e) {
View Full Code Here

        tuscany.start();
        ModuleContext moduleContext = CurrentModuleContext.getContext();

        AccountService accountService = (AccountService) moduleContext.locateService("AccountServiceComponent");

        AccountReport report = accountService.getAccountReport(12345);
        List summaries = report.getAccountSummaries();

        System.out.println("retrieved " + summaries.size() + " summaries");

        tuscany.stop();
    }
View Full Code Here

        if (service == null) {
            throw new JspException("Service [" + mAccountService + "] not found in current module context");
        }
        List summaries;
        try {
            AccountReport accountReport = service.getAccountReport(profile.getId());
            pageContext.setAttribute("StockSummaries", accountReport.getStockSummaries());
            summaries = accountReport.getAccountSummaries();
        } catch (Exception e) {
            throw new JspException(e);
        }
        mIterator = summaries.iterator();
        if (mIterator.hasNext()) {
View Full Code Here

    @SuppressWarnings("unchecked")
    public AccountReport getAccountReport(int customerID) throws RemoteException {

        try {
            AccountReport accountReport = accountDataService.getAccountReport(customerID);
            //convert to local currency.
            List<AccountSummary> accounts = accountReport.getAccountSummaries();
            for(AccountSummary accountSummary : accounts){
                accountSummary.setBalance(fromUSDollarToCurrency(accountSummary.getBalance()));
               
            }
            return updateStockInformation(accountReport);
View Full Code Here

        if (service == null) {
            throw new JspException("Service [" + mAccountService + "] not found in current module context");
        }
        List summaries;
        try {
            AccountReport accountReport = service.getAccountReport(profile.getId());
            pageContext.setAttribute("StockSummaries", accountReport.getStockSummaries());
            summaries = accountReport.getAccountSummaries();
        } catch (Exception e) {
            throw new JspException(e);
        }
        mIterator = summaries.iterator();
        if (mIterator.hasNext()) {
View Full Code Here

TOP

Related Classes of com.bigbank.account.AccountReport

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.