airline
Class AdministratorSession

java.lang.Object
  extended by airline.AdministratorSession
All Implemented Interfaces:
UserSession

public class AdministratorSession
extends Object
implements UserSession

Manages the flow of control for a session with a registered Administrator.

Author:
Michael Goldwasser

Nested Class Summary
static class AdministratorSession.AdminMenuChoice
          Serves as a return value from Connection.getAdminMainMenuChoice().
static class AdministratorSession.NewFlightDetails
          Serves as a return value from Connection.getNewFlightInfo().
 
Field Summary
private  Administrator administrator
          The Administrator instance associated with this session.
private  Connection connect
          The Connection instance managing the front-end interactions for this session.
 
Constructor Summary
AdministratorSession(Administrator administrator, Connection connect)
          Instantiates a new session for the given Administrator and the given front-end Connection.
 
Method Summary
private  void addFlightDialog()
          This dialog is used to add a new flight to the system.
private  void exportDatabaseDialog()
          This dialog is used to save the system data to a file.
private  void importDatabaseDialog()
          This dialog is used to load an existing system from a file.
 void mainDialog()
          The main menu is first presented to an Administrator immediately after logging in.
private  void viewPassengerListDialog()
          This dialog is used to provide a view of the passenger list for a selected flight.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

administrator

private Administrator administrator
The Administrator instance associated with this session.


connect

private Connection connect
The Connection instance managing the front-end interactions for this session.

Constructor Detail

AdministratorSession

public AdministratorSession(Administrator administrator,
                            Connection connect)
Instantiates a new session for the given Administrator and the given front-end Connection. The constructor does not begin any interactions. Those should typically be started by calling mainDialog().

Parameters:
administrator - The Administrator instance associated with this session
connect - The Connection instance managing the front-end interactions for this session
Method Detail

addFlightDialog

private void addFlightDialog()
This dialog is used to add a new flight to the system.


exportDatabaseDialog

private void exportDatabaseDialog()
This dialog is used to save the system data to a file.


importDatabaseDialog

private void importDatabaseDialog()
This dialog is used to load an existing system from a file.


mainDialog

public void mainDialog()
The main menu is first presented to an Administrator immediately after logging in. It offers choices for managing the overall system and the underlying databases of users and flights.

Specified by:
mainDialog in interface UserSession

viewPassengerListDialog

private void viewPassengerListDialog()
This dialog is used to provide a view of the passenger list for a selected flight.