airline
Class Connection

java.lang.Object
  extended by airline.Connection
Direct Known Subclasses:
TextConnection

public abstract class Connection
extends Object

An abstract class representing the front-end connection to a system. Concrete subclasses The required behaviors include interactions with both customers and administrators. Subclasses must implement the various user dialogs.

Author:
Michael Goldwasser

Field Summary
protected  AirlineSystem system
          The AirlineSystem with which this instance is connected.
 
Constructor Summary
protected Connection(AirlineSystem system)
          Creates a new collection to a particular AirlineSystem.
 
Method Summary
 void connect()
          Initiates the connection, starting with a login screen.
abstract  AdministratorSession.AdminMenuChoice getAdminMainMenuChoice()
          This dialog is responsible for offering the main administrator menu and returning the user's choice.
abstract  AdministratorSession.NewFlightDetails getNewFlightInfo()
          This dialog is responsible for gathering information from an administrator while adding a new flight to the system.
abstract  User loginDialog()
          This dialog manages the login process.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

system

protected final AirlineSystem system
The AirlineSystem with which this instance is connected.

Constructor Detail

Connection

protected Connection(AirlineSystem system)
Creates a new collection to a particular AirlineSystem.

Parameters:
system - The AirlineSystem.
Method Detail

connect

public void connect()
Initiates the connection, starting with a login screen. Once logged in, control will be passed to mainDialog() for an appropriate UserSession.


getAdminMainMenuChoice

public abstract AdministratorSession.AdminMenuChoice getAdminMainMenuChoice()
This dialog is responsible for offering the main administrator menu and returning the user's choice.

Returns:
The selected choice.

getNewFlightInfo

public abstract AdministratorSession.NewFlightDetails getNewFlightInfo()
This dialog is responsible for gathering information from an administrator while adding a new flight to the system.

Returns:
Details about the new flight.

loginDialog

public abstract User loginDialog()
This dialog manages the login process. It is responsible for returning a reference to an authenticated User, or to return null to signify that the application should exit.

Returns:
reference to the authenticated User (or null if none).