コード例 #1
0
ファイル: AccountService.java プロジェクト: zberhe/EA
  public void withdraw(long accountNumber, double amount) {

    Account account = accountDAO.loadAccount(accountNumber);
    account.withdraw(amount);
    accountDAO.updateAccount(account);
    logger.log("withdraw with parameters accountNumber= " + accountNumber + " , amount= " + amount);
  }
コード例 #2
0
ファイル: AccountService.java プロジェクト: zberhe/EA
  public void transferFunds(
      long fromAccountNumber, long toAccountNumber, double amount, String description) {

    Account fromAccount = accountDAO.loadAccount(fromAccountNumber);
    Account toAccount = accountDAO.loadAccount(toAccountNumber);
    fromAccount.transferFunds(toAccount, amount, description);
    accountDAO.updateAccount(fromAccount);
    accountDAO.updateAccount(toAccount);
    logger.log(
        "transferFunds with parameters fromAccountNumber= "
            + fromAccountNumber
            + " , toAccountNumber= "
            + toAccountNumber
            + " , amount= "
            + amount
            + " , description= "
            + description);
    if (amount > 10000) {
      jmsSender.sendJMSMessage(
          "TransferFunds of $ "
              + amount
              + " from account with accountNumber= "
              + fromAccount
              + " to account with accountNumber= "
              + toAccount);
    }
  }
コード例 #3
0
ファイル: AccountService.java プロジェクト: zberhe/EA
  public void withdrawEuros(long accountNumber, double amount) {

    Account account = accountDAO.loadAccount(accountNumber);
    double amountDollars = currencyConverter.euroToDollars(amount);
    account.withdraw(amountDollars);
    accountDAO.updateAccount(account);
    logger.log(
        "withdrawEuros with parameters accountNumber= " + accountNumber + " , amount= " + amount);
  }
コード例 #4
0
ファイル: AccountService.java プロジェクト: zberhe/EA
  public void deposit(long accountNumber, double amount) {

    Account account = accountDAO.loadAccount(accountNumber);
    account.deposit(amount);
    accountDAO.updateAccount(account);
    logger.log("deposit with parameters accountNumber= " + accountNumber + " , amount= " + amount);
    if (amount > 10000) {
      jmsSender.sendJMSMessage(
          "Deposit of $ " + amount + " to account with accountNumber= " + accountNumber);
    }
  }
コード例 #5
0
ファイル: AccountService.java プロジェクト: zberhe/EA
  public void depositEuros(long accountNumber, double amount) {

    Account account = accountDAO.loadAccount(accountNumber);
    double amountDollars = currencyConverter.euroToDollars(amount);
    account.deposit(amountDollars);
    accountDAO.updateAccount(account);
    logger.log(
        "depositEuros with parameters accountNumber= " + accountNumber + " , amount= " + amount);
    if (amountDollars > 10000) {
      jmsSender.sendJMSMessage(
          "Deposit of $ " + amount + " to account with accountNumber= " + accountNumber);
    }
  }
コード例 #6
0
ファイル: AccountService.java プロジェクト: zberhe/EA
  public Account createAccount(long accountNumber, String customerName) {

    Account account = new Account(accountNumber);
    Customer customer = new Customer(customerName);
    account.setCustomer(customer);
    accountDAO.saveAccount(account);
    logger.log(
        "createAccount with parameters accountNumber= "
            + accountNumber
            + " , customerName= "
            + customerName);

    return account;
  }
コード例 #7
0
ファイル: AccountService.java プロジェクト: zberhe/EA
  public Collection<Account> getAllAccounts() {

    Collection<Account> accounts = accountDAO.getAccounts();

    return accounts;
  }
コード例 #8
0
ファイル: AccountService.java プロジェクト: zberhe/EA
  public Account getAccount(long accountNumber) {

    Account account = accountDAO.loadAccount(accountNumber);

    return account;
  }