Beispiel #1
0
  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);
    }
  }
Beispiel #2
0
  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);
  }
Beispiel #3
0
  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);
  }
Beispiel #4
0
  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);
    }
  }
Beispiel #5
0
  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);
    }
  }
Beispiel #6
0
  public Account getAccount(long accountNumber) {

    Account account = accountDAO.loadAccount(accountNumber);

    return account;
  }