topdown.service
Interface Bank

All Known Implementing Classes:
BankMemDB

public interface Bank

The Bank interface.


Method Summary
 java.lang.String addNewAccount(java.lang.String name, float initBalance)
          Adds a new account.
 Account getAccount(java.lang.String id)
          Returns the account that has the given ID.
 java.util.List getAccounts()
          Returns a list of all account in the bank.
 

Method Detail

addNewAccount

public java.lang.String addNewAccount(java.lang.String name,
                                      float initBalance)
                               throws AccountException
Adds a new account.

Parameters:
name - the account owner's name.
initBalance - the initial balance for the account.
Returns:
the generated account ID.
Throws:
topdown.service.AccountException - if the initial balance is insufficent (<= 0).
AccountException

getAccount

public Account getAccount(java.lang.String id)
Returns the account that has the given ID.

Parameters:
id - the account ID.
Returns:
the account.

getAccounts

public java.util.List getAccounts()
Returns a list of all account in the bank.

Returns:
the list of accounts.