|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.rmi.server.RemoteObject | +--java.rmi.server.RemoteServer | +--java.rmi.server.UnicastRemoteObject | +--cscie160.project.atm.ATMImpl
By David Cheung
CSCIE160 Project
05-16-2001
ATMImpl implements ATM. At init time it will bind to Bank and Security interface. Also, it will create a vector to store callback objects.
To do (from specs in project): 1)notify all registered listeners of the transaction.
2) use security service to authenticate account info.
3) use security service to authorize operation on account.
4) Use bank to obtain account references
5) Use account references to perform transaction
Fields inherited from class java.rmi.server.RemoteObject |
ref |
Constructor Summary | |
ATMImpl()
Constructor: creates a linkedlist and 3 accounts. |
Method Summary | |
void |
addCallBack(ATMListener aListener)
Adds call back. |
void |
deposit(AccountInfo anAccount,
float amount)
Deposit |
float |
getBalance(AccountInfo anAccount)
getBalance |
void |
notifyAll(java.lang.String message)
Sends notification method: when this is called, it will take in a TransactionNotification object and send it to everyone in the list. |
void |
transfer(AccountInfo fromAccount,
AccountInfo toAccount,
float amount)
transfer |
void |
withdraw(AccountInfo anAccount,
float amount)
withdraw |
Methods inherited from class java.rmi.server.UnicastRemoteObject |
clone, exportObject, exportObject, exportObject, unexportObject |
Methods inherited from class java.rmi.server.RemoteServer |
getClientHost, getLog, setLog |
Methods inherited from class java.rmi.server.RemoteObject |
equals, getRef, hashCode, toString, toStub |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ATMImpl() throws java.rmi.RemoteException
Method Detail |
public void addCallBack(ATMListener aListener) throws java.rmi.RemoteException
addCallBack
in interface ATM
public void notifyAll(java.lang.String message)
public void deposit(AccountInfo anAccount, float amount) throws java.rmi.RemoteException, UnpermittedTransactionException, SecurityInvalidPinException
Deposits money unto the account.
List of things to do: 1)notify all registered listeners of the transaction.
2) use security service to authenticate account info
3) use security service to authorize operation on account.
4) Use bank to obtain account references.
5) Use account references to perform transaction
6) catch throws various exceptions when neccessary.
deposit
in interface ATM
userNum:
- account numberamount:
- amount to depositpublic void withdraw(AccountInfo anAccount, float amount) throws java.rmi.RemoteException, UnpermittedTransactionException, OverdrawnException, SecurityInvalidPinException
Withdraws money from a particular account
This will do:
1)notify all registered listeners of the transaction.
2) use security service to authenticate account info
3) use security service to authorize operation on account.
4) Use bank to obtain account references
5) Use account references to perform transaction
6) Throws exceptioni if neccessary
withdraw
in interface ATM
AccountInfo:
- account number and a PIn.amount:
- amount to withdraw.public float getBalance(AccountInfo anAccount) throws java.rmi.RemoteException, UnpermittedTransactionException, SecurityInvalidPinException
Returns the balance of the account.
getBalance
in interface ATM
userNum:
- AccountInfopublic void transfer(AccountInfo fromAccount, AccountInfo toAccount, float amount) throws java.rmi.RemoteException, UnpermittedTransactionException, OverdrawnException, SecurityInvalidPinException
Withdraws money from the fromAccount and deposits it to the toAccount.
This will do:
1)notify all registered listeners of the transaction.
2) use security service to authenticate account info
3) use security service to authorize operation on account.
4) Use bank to obtain account references
5) Use account references to perform transaction
6) Throws exceptioni if neccessary
transfer
in interface ATM
AccountInfo:
- account number and a Pin of from account.AccountInfo:
- account number and pin of to account.amount:
- amount to transfer.
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |