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 AccountDAO
acctDAO
static String
ALL_ACCOUNTS
(package private) org.slf4j.Logger
log
static String
OVERDRAWN_ACCOUNTS
private OwnerDAO
ownerDAO
-
Constructor Summary
Constructors Constructor Description TellerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Owner
addOwner(long ownerId, String accountNumber)
Account
closeAccount(String accountNum)
Account
createAccount(String accountNum)
Owner
createOwner(String firstName, String lastName, String ssn)
Account
getAccount(String accountNum)
List<Account>
getAccounts(int index, int count)
Ledger
getLedger()
double
getLedgerAveBalance()
long
getLedgerCount()
double
getLedgerSum()
List<Account>
getOverdrawnAccounts(int index, int count)
List<Owner>
getOwners(int index, int count)
Owner
openAccount(long ownerId, String accountNumber)
void
removeOwner(long ownerId)
void
setAcctDAO(AccountDAO acctDAO)
void
setOwnerDAO(OwnerDAO ownerDAO)
void
updateAccount(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:
createAccount
in interfaceTeller
- Throws:
BankException
-
getAccount
public Account getAccount(String accountNum) throws BankException
- Specified by:
getAccount
in interfaceTeller
- Throws:
BankException
-
getOverdrawnAccounts
public List<Account> getOverdrawnAccounts(int index, int count) throws BankException
- Specified by:
getOverdrawnAccounts
in interfaceTeller
- Throws:
BankException
-
getAccounts
public List<Account> getAccounts(int index, int count) throws BankException
- Specified by:
getAccounts
in interfaceTeller
- Throws:
BankException
-
closeAccount
public Account closeAccount(String accountNum) throws BankException
- Specified by:
closeAccount
in interfaceTeller
- Throws:
BankException
-
updateAccount
public void updateAccount(Account account) throws BankException
- Specified by:
updateAccount
in interfaceTeller
- Throws:
BankException
-
getLedger
public Ledger getLedger() throws BankException
- Specified by:
getLedger
in interfaceTeller
- Throws:
BankException
-
getLedgerAveBalance
public double getLedgerAveBalance() throws BankException
- Specified by:
getLedgerAveBalance
in interfaceTeller
- Throws:
BankException
-
getLedgerCount
public long getLedgerCount() throws BankException
- Specified by:
getLedgerCount
in interfaceTeller
- Throws:
BankException
-
getLedgerSum
public double getLedgerSum() throws BankException
- Specified by:
getLedgerSum
in interfaceTeller
- Throws:
BankException
-
addOwner
public Owner addOwner(long ownerId, String accountNumber) throws BankException
- Specified by:
addOwner
in interfaceTeller
- Throws:
BankException
-
createOwner
public Owner createOwner(String firstName, String lastName, String ssn) throws BankException
- Specified by:
createOwner
in interfaceTeller
- Throws:
BankException
-
removeOwner
public void removeOwner(long ownerId)
- Specified by:
removeOwner
in interfaceTeller
-
getOwners
public List<Owner> getOwners(int index, int count) throws BankException
- Specified by:
getOwners
in interfaceTeller
- Throws:
BankException
-
openAccount
public Owner openAccount(long ownerId, String accountNumber) throws BankException
- Specified by:
openAccount
in interfaceTeller
- Throws:
BankException
-
-