Class TellerImpl
- java.lang.Object
-
- ejava.examples.ejbsessionbank.blimpl.TellerImpl
-
- All Implemented Interfaces:
Teller
public class TellerImpl extends Object implements Teller
This class implements the business logic of the Teller. Its logically implemented in 2 halves; Account and Owner + Account. The Account-only half is used to demonstrate some of the basics. The Owner+Account half is used to add a small amount of complexity to the data model to demo some lazy load issues within the remote facade/EJB layer.
-
-
Field Summary
Fields Modifier and Type Field Description private AccountDAOacctDAOstatic StringALL_ACCOUNTS(package private) org.slf4j.Loggerlogstatic StringOVERDRAWN_ACCOUNTSprivate OwnerDAOownerDAO
-
Constructor Summary
Constructors Constructor Description TellerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OwneraddOwner(long ownerId, String accountNumber)AccountcloseAccount(String accountNum)AccountcreateAccount(String accountNum)OwnercreateOwner(String firstName, String lastName, String ssn)AccountgetAccount(String accountNum)List<Account>getAccounts(int index, int count)LedgergetLedger()doublegetLedgerAveBalance()longgetLedgerCount()doublegetLedgerSum()List<Account>getOverdrawnAccounts(int index, int count)List<Owner>getOwners(int index, int count)OwneropenAccount(long ownerId, String accountNumber)voidremoveOwner(long ownerId)voidsetAcctDAO(AccountDAO acctDAO)voidsetOwnerDAO(OwnerDAO ownerDAO)voidupdateAccount(Account account)
-
-
-
Field Detail
-
log
org.slf4j.Logger log
-
OVERDRAWN_ACCOUNTS
public static final String OVERDRAWN_ACCOUNTS
- See Also:
- Constant Field Values
-
ALL_ACCOUNTS
public static final String ALL_ACCOUNTS
- See Also:
- Constant Field Values
-
acctDAO
private AccountDAO acctDAO
-
ownerDAO
private OwnerDAO ownerDAO
-
-
Method Detail
-
setAcctDAO
public void setAcctDAO(AccountDAO acctDAO)
-
setOwnerDAO
public void setOwnerDAO(OwnerDAO ownerDAO)
-
createAccount
public Account createAccount(String accountNum) throws BankException
- Specified by:
createAccountin interfaceTeller- Throws:
BankException
-
getAccount
public Account getAccount(String accountNum) throws BankException
- Specified by:
getAccountin interfaceTeller- Throws:
BankException
-
getOverdrawnAccounts
public List<Account> getOverdrawnAccounts(int index, int count) throws BankException
- Specified by:
getOverdrawnAccountsin interfaceTeller- Throws:
BankException
-
getAccounts
public List<Account> getAccounts(int index, int count) throws BankException
- Specified by:
getAccountsin interfaceTeller- Throws:
BankException
-
closeAccount
public Account closeAccount(String accountNum) throws BankException
- Specified by:
closeAccountin interfaceTeller- Throws:
BankException
-
updateAccount
public void updateAccount(Account account) throws BankException
- Specified by:
updateAccountin interfaceTeller- Throws:
BankException
-
getLedger
public Ledger getLedger() throws BankException
- Specified by:
getLedgerin interfaceTeller- Throws:
BankException
-
getLedgerAveBalance
public double getLedgerAveBalance() throws BankException- Specified by:
getLedgerAveBalancein interfaceTeller- Throws:
BankException
-
getLedgerCount
public long getLedgerCount() throws BankException- Specified by:
getLedgerCountin interfaceTeller- Throws:
BankException
-
getLedgerSum
public double getLedgerSum() throws BankException- Specified by:
getLedgerSumin interfaceTeller- Throws:
BankException
-
addOwner
public Owner addOwner(long ownerId, String accountNumber) throws BankException
- Specified by:
addOwnerin interfaceTeller- Throws:
BankException
-
createOwner
public Owner createOwner(String firstName, String lastName, String ssn) throws BankException
- Specified by:
createOwnerin interfaceTeller- Throws:
BankException
-
removeOwner
public void removeOwner(long ownerId)
- Specified by:
removeOwnerin interfaceTeller
-
getOwners
public List<Owner> getOwners(int index, int count) throws BankException
- Specified by:
getOwnersin interfaceTeller- Throws:
BankException
-
openAccount
public Owner openAccount(long ownerId, String accountNumber) throws BankException
- Specified by:
openAccountin interfaceTeller- Throws:
BankException
-
-