All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class JBMSTours.serializabletypes.TransferFlight

java.lang.Object
   |
   +----JBMSTours.serializabletypes.Flight
           |
           +----JBMSTours.serializabletypes.OneStopFlight
                   |
                   +----JBMSTours.serializabletypes.TransferFlight

public class TransferFlight
extends OneStopFlight
implements Serializable
Look at the Source.

Definition of a flight with one transfer.


Variable Index

 o segment2ID

Constructor Index

 o TransferFlight()
Default niladic constructor for a flight with one transfer.
 o TransferFlight(Flight, Flight)
Constructs a TransferFlight flight from its two legs.

Method Index

 o checkSegmentAvailability(Connection, Date, short, int)
Checks whether the flight is available on the specified date for the specified number of seats.
 o getAltFlightId()
Get the flight id of the second leg.
 o getType()
Get the flight type.
 o getUniqueId()
 o storeBookingInfoForAirline(Connection, int, Date, int, BigDecimal, short)
"Books" the flight by extracting the pertinent information to a separate table (FlightBookings).
 o toString()
Prints out this object.

Variables

 o segment2ID
 public String segment2ID

Constructors

 o TransferFlight
 public TransferFlight()
Default niladic constructor for a flight with one transfer.

 o TransferFlight
 public TransferFlight(Flight segone,
                       Flight segtwo)
Constructs a TransferFlight flight from its two legs.

Parameters:
segone - Flight object for first flight.
segtwo - Flight object for second flight.

Methods

 o toString
 public String toString()
Prints out this object.

Overrides:
toString in class OneStopFlight
 o getAltFlightId
 public String getAltFlightId()
Get the flight id of the second leg.

Returns:
flight id of the second leg.
Overrides:
getAltFlightId in class OneStopFlight
 o getType
 public String getType()
Get the flight type.

Returns:
flight type.
Overrides:
getType in class OneStopFlight
 o getUniqueId
 public String getUniqueId()
Overrides:
getUniqueId in class OneStopFlight
 o storeBookingInfoForAirline
 public int storeBookingInfoForAirline(Connection conn,
                                       int gid,
                                       Date travelDate,
                                       int numberSeats,
                                       BigDecimal fixedRate,
                                       short level) throws SQLException
"Books" the flight by extracting the pertinent information to a separate table (FlightBookings). This is the information that eventually goes to the airline.

Parameters:
conn - Connection
gid - The group_id
travelDate - Date that travel begins.
numberSeats - number of seats reserved
fixedRate - the rate for those seats
The - level of the tour. See the static variables in Tour.java.
Returns:
> 0 if FlightBookings table successfully updated.
Throws: SQLException
in case anything goes wrong during a SQL operation
Overrides:
storeBookingInfoForAirline in class OneStopFlight
 o checkSegmentAvailability
 public boolean checkSegmentAvailability(Connection conn,
                                         Date travel,
                                         short kindOfSeats,
                                         int numberOfSeatsNeeded) throws SQLException
Checks whether the flight is available on the specified date for the specified number of seats. Called by CustomerFlight.checkAvailability().

Parameters:
conn - Connection
travel - The date flying.
kindOfSeats - the name of the column in FlightAvailability to select from
numberSeats - number of seats needed
Returns:
true, if the flight is available
Throws: SQLException
in case anything goes wrong during a SQL operation
Overrides:
checkSegmentAvailability in class OneStopFlight

All Packages  Class Hierarchy  This Package  Previous  Next  Index