All Packages  Class Hierarchy  This Package  Previous  Next  Index
  Class atm.transaction.Transaction
java.lang.Object
   |
   +----atm.transaction.Transaction
  -  public abstract class Transaction
  -  extends Object
Abstract base class for classes representing the various kinds of
  transaction the ATM can perform
   
  -   ASKING_DO_ANOTHER_STATE ASKING_DO_ANOTHER_STATE
-  Asking if customer wants to do another transaction
  
-   atm atm
-  ATM to use for communication with the customer
  
-   balances balances
-  Used to return account balances from the bank
  
-   card card
-  Customer card for the session this transaction is part of
  
-   COMPLETING_TRANSACTION_STATE COMPLETING_TRANSACTION_STATE
-  Completing transaction
  
-   GETTING_SPECIFICS_STATE GETTING_SPECIFICS_STATE
-  Getting specifics of the transaction from customer
  
-   INVALID_PIN_STATE INVALID_PIN_STATE
-  Performing invalid PIN extension
  
-   message message
-  Message to bank describing this transaction
  
-   nextSerialNumber nextSerialNumber
-  Next serial number - used to assign a unique serial number to
  each transaction
  
-   pin pin
-  PIN entered or re-entered by customer
  
-   PRINTING_RECEIPT_STATE PRINTING_RECEIPT_STATE
-  Printing receipt
  
-   SENDING_TO_BANK_STATE SENDING_TO_BANK_STATE
-  Sending transaction to bank
  
-   serialNumber serialNumber
-  Serial number of this transaction
  
-   session session
-  Session in which this transaction is being performed
  
-   state state
-  The current state of the transaction
  
-   TRANSACTION_TYPES_MENU TRANSACTION_TYPES_MENU
-  List of available transaction types to display as a menu
   
  -   Transaction(ATM, Session, Card, int) Transaction(ATM, Session, Card, int)
-  Constructor
  
   
  -   completeTransaction() completeTransaction()
-  Complete an approved transaction  - each subclass must implement
  this appropriately.
  
-   getSerialNumber() getSerialNumber()
-  Get serial number of this transaction
  
  
-   getSpecificsFromCustomer() getSpecificsFromCustomer()
-  Get specifics for the transaction from the customer - each
  subclass must implement this appropriately.
  
-   makeTransaction(ATM, Session, Card, int) makeTransaction(ATM, Session, Card, int)
-  Create a transaction of an appropriate type by asking the customer
  what type of transaction is desired and then returning a newly-created
  member of the appropriate subclass
  
  
-   performInvalidPINExtension() performInvalidPINExtension()
-  Perform the Invalid PIN Extension - reset session pin to new value if successful
  
  
-   performTransaction() performTransaction()
-  Peform a transaction.
   
 atm
atm
 protected ATM atm
  -  ATM to use for communication with the customer
 
 session
session
 protected Session session
  -  Session in which this transaction is being performed
 
 card
card
 protected Card card
  -  Customer card for the session this transaction is part of
 
 pin
pin
 protected int pin
  -  PIN entered or re-entered by customer
 
 serialNumber
serialNumber
 protected int serialNumber
  -  Serial number of this transaction
 
 message
message
 protected Message message
  -  Message to bank describing this transaction
 
 balances
balances
 protected Balances balances
  -  Used to return account balances from the bank
 
 TRANSACTION_TYPES_MENU
TRANSACTION_TYPES_MENU
 private static final String TRANSACTION_TYPES_MENU[]
  -  List of available transaction types to display as a menu
 
 nextSerialNumber
nextSerialNumber
 private static int nextSerialNumber
  -  Next serial number - used to assign a unique serial number to
  each transaction
 
 state
state
 private int state
  -  The current state of the transaction
 
 GETTING_SPECIFICS_STATE
GETTING_SPECIFICS_STATE
 private static final int GETTING_SPECIFICS_STATE
  -  Getting specifics of the transaction from customer
 
 SENDING_TO_BANK_STATE
SENDING_TO_BANK_STATE
 private static final int SENDING_TO_BANK_STATE
  -  Sending transaction to bank
 
 INVALID_PIN_STATE
INVALID_PIN_STATE
 private static final int INVALID_PIN_STATE
  -  Performing invalid PIN extension
 
 COMPLETING_TRANSACTION_STATE
COMPLETING_TRANSACTION_STATE
 private static final int COMPLETING_TRANSACTION_STATE
  -  Completing transaction
 
 PRINTING_RECEIPT_STATE
PRINTING_RECEIPT_STATE
 private static final int PRINTING_RECEIPT_STATE
  -  Printing receipt
 
 ASKING_DO_ANOTHER_STATE
ASKING_DO_ANOTHER_STATE
 private static final int ASKING_DO_ANOTHER_STATE
  -  Asking if customer wants to do another transaction
 
   
 Transaction
Transaction
 protected Transaction(ATM atm,
                       Session session,
                       Card card,
                       int pin)
  -  Constructor
   
- 
    -  Parameters:
    
-  atm - the ATM used to communicate with customer
    -  session - the session in which this transaction is being performed
    -  card - the customer's card
    -  pin - the PIN entered by the customer
  
 
   
 makeTransaction
makeTransaction
 public static Transaction makeTransaction(ATM atm,
                                           Session session,
                                           Card card,
                                           int pin) throws CustomerConsole. Cancelled
  -  Create a transaction of an appropriate type by asking the customer
  what type of transaction is desired and then returning a newly-created
  member of the appropriate subclass
   
- 
    -  Parameters:
    
-  atm - the ATM used to communicate with customer
    -  session - the session in which this transaction is being performed
    -  card - the customer's card
    -  pin - the PIN entered by the customer
    
-  Returns:
    
-  a newly created Transaction object of the appropriate type
    
-  Throws: CustomerConsole. Cancelled
    
-  if the customer presses cancel instead
         of choosing a transaction type
  
 
 performTransaction
performTransaction
 public boolean performTransaction() throws Transaction. CardRetained
  -  Peform a transaction.  This method depends on the three abstract methods
  that follow to perform the operations unique to each type of transaction
  in the appropriate way.
   
- 
    -  Returns:
    
-  true if customer indicates a desire to do another transaction;
          false if customer does not desire to do another transaction
    
-  Throws: Transaction. CardRetained
    
-  if card was retained due to too many invalid PIN's
  
 
 performInvalidPINExtension
performInvalidPINExtension
 public Status performInvalidPINExtension() throws CustomerConsole. Cancelled, Transaction. CardRetained
  -  Perform the Invalid PIN Extension - reset session pin to new value if successful
   
- 
    -  Returns:
    
-  status code returned by bank from most recent re-submission
          of transaction
    
-  Throws: CustomerConsole. Cancelled
    
-  if customer presses the CANCEL key
             instead of re-entering PIN
    
-  Throws: Transaction. CardRetained
    
-  if card was retained due to too many invalid PIN's
  
 
 getSerialNumber
getSerialNumber
 public int getSerialNumber()
  -  Get serial number of this transaction
   
- 
    -  Returns:
    
-  serial number
  
 
 getSpecificsFromCustomer
getSpecificsFromCustomer
 protected abstract Message getSpecificsFromCustomer() throws CustomerConsole. Cancelled
  -  Get specifics for the transaction from the customer - each
  subclass must implement this appropriately.
   
- 
    -  Returns:
    
-  message to bank for initiating this transaction
    
-  Throws: CustomerConsole. Cancelled
    
-  if customer cancelled this transaction
  
 
 completeTransaction
completeTransaction
 protected abstract Receipt completeTransaction() throws CustomerConsole. Cancelled
  -  Complete an approved transaction  - each subclass must implement
  this appropriately.
   
- 
    -  Returns:
    
-  receipt to be printed for this transaction
    
-  Throws: CustomerConsole. Cancelled
    
-  if customer cancelled this transaction
  
 
All Packages  Class Hierarchy  This Package  Previous  Next  Index