All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ibm.beans.demos.travel.flight.FlightInfoDap

java.lang.Object
   |
   +----com.ibm.beans.demos.travel.flight.FlightInfoDap

public class FlightInfoDap
extends Object
implements Serializable, FlightInfoDapProperties, TravelInfoChangedListener, FlightRequestedListener

This class is part of the travel demo and implements the flight information data access part (DAP) bean. The DAP bean serves as the event sink for the TravelInfoChanged event and the FlightRequested event. The TravelInfoChanged event is sent by the itinerary bean when the user selects an origin city, a destination city, and a departure date. The FlightRequested event is sent by the itinerary bean when the user requests confirmation for a selected flight itinerary.

This DAP bean serves as the event source for the FlightInformationChanged and the FlightReserved events. The FlightInformationChanged event is sent to the flight selector bean when the DAP bean receives the TravelInfoChanged event notification from the itinerary bean. The FlightReserved event is sent to the itinerary bean when the DAP bean receives the FlightRequested event notification from the itinerary bean.

See Also:
FlightInfoEvent, FlightInfoListener, FlightReservedEvent, FlightReservedListener, FlightInfoDapBeanInfo, FlightInformation, FlightRequestedEvent, FlightRequestedListener

Constructor Index

 o FlightInfoDap()
Constructs an instance of the FlightInfoDap bean.

Method Index

 o addFlightInfoListener(FlightInfoListener)
Allows other beans to listen to the FlightInfo events this bean generates.
 o addFlightReservedListener(FlightReservedListener)
Allows other beans to listen to the FlightReserved events this bean generates.
 o addPropertyChangeListener(PropertyChangeListener)
Adds a listener to be notified when the SQLString property or the flightInfo property has been changed.
 o addVetoableChangeListener(VetoableChangeListener)
Adds a listener to be notified when the SQLString property or the flightInfo property is about to be changed.
 o fireFlightInfo(FlightInfoEvent)
Notifies all registered listeners.
 o fireFlightReserved(FlightReservedEvent)
Notifies all registered listeners that a flight has been reserved.
 o FlightRequested(FlightRequestedEvent)
Responds to a FlightRequested event.
 o getFlightInfo()
Accessor (get) method for the FlightInfo property.
 o getSQLString()
Accessor (get) method for the SQLString property.
 o queryDataBase(TravelInfoChangedEvent)
Queries the database to find all of the possible flight choices that match the user request of origin city, destination city, departure date, and return date.
 o removeFlightInfoListener(FlightInfoListener)
Allows beans to remove themselves from the listener list for this bean's FlightInfo event.
 o removeFlightReservedListener(FlightReservedListener)
Allows beans to remove themselves from the listener list for this bean's FlightReserved event.
 o removePropertyChangeListener(PropertyChangeListener)
Removes a listener from the notification list.
 o removeVetoableChangeListener(VetoableChangeListener)
Removes a listener from the notification list.
 o reserveFlight(FlightRequestedEvent)
Attempts to reserve the specified flight(s).
 o setFlightInfo(Vector)
Accessor (set) method for the FlightInfo property.
 o setSQLString(String)
Accessor (set) method for the SQLString property.
 o TravelInfoChanged(TravelInfoChangedEvent)
Responds to a TravelInfoChanged event.

Constructors

 o FlightInfoDap
 public FlightInfoDap()
Constructs an instance of the FlightInfoDap bean. The constructor initializes instance data.

Methods

 o TravelInfoChanged
 public void TravelInfoChanged(TravelInfoChangedEvent travelInfoChange)
Responds to a TravelInfoChanged event. This method is invoked when the Itinerary bean has been wired to this DAP bean and the user submits preliminary information needed to query the database for flights that meet the users preliminary requirements.

Parameters:
travelInfoChange - The event containing the preliminary travel requirements
 o FlightRequested
 public void FlightRequested(FlightRequestedEvent flightRequestedEvent)
Responds to a FlightRequested event. This method is invoked when the itinerary bean has been wired to this DAP bean and the user has selected a preferred itinerary. If the itinerary is approved, notification is sent back to the itinerary bean via a FlightReserveredEvent.

Parameters:
flightRequestedEvent - The FlightRequestedEvent containing the preferred flight itinerary.
 o addFlightInfoListener
 public synchronized void addFlightInfoListener(FlightInfoListener fIL)
Allows other beans to listen to the FlightInfo events this bean generates. This is the addListener method for all listeners that want to be notified when a FlightInformationChanged event occurs. In the demo, the flight selector bean is wired to this DAP bean and is notified when the FlightInformationChanged event happens.

Parameters:
fIL - The registering listener.
See Also:
removeFlightInfoListener
 o removeFlightInfoListener
 public synchronized void removeFlightInfoListener(FlightInfoListener fIL)
Allows beans to remove themselves from the listener list for this bean's FlightInfo event. This is the removeListener method for all listeners that want to be notified when a FlightInformationChanged event occurs. In the demo, the flight selector bean is wired to this DAP bean and is notified when the FlightInformationChanged event happens.

Parameters:
fIL - The unregistering listener.
See Also:
addFlightInfoListener
 o addFlightReservedListener
 public synchronized void addFlightReservedListener(FlightReservedListener fRL)
Allows other beans to listen to the FlightReserved events this bean generates. This is the addListener method for all listeners that want to be notified when a FlightReserved event occurs. In the demo, this DAP bean is wired to the itinerary viewer bean and is notified by this DAP bean when the FlightReserved event happens.

Parameters:
fRL - The registering listener.
See Also:
removeFlightReservedListener
 o removeFlightReservedListener
 public synchronized void removeFlightReservedListener(FlightReservedListener fRL)
Allows beans to remove themselves from the listener list for this bean's FlightReserved event. This is the removeListener method for all listeners that want to be notified when a FlightReserved event occurs. In the demo, this DAP bean is wired to the itinerary viewer bean and is notified by this DAP bean when the FlightReserved event happens.

Parameters:
fRL - The registering FlightReservedListener object.
See Also:
addFlightReservedListener
 o addVetoableChangeListener
 public void addVetoableChangeListener(VetoableChangeListener listener)
Adds a listener to be notified when the SQLString property or the flightInfo property is about to be changed.

Parameters:
listener - The object to be notified.
 o removeVetoableChangeListener
 public void removeVetoableChangeListener(VetoableChangeListener listener)
Removes a listener from the notification list.

Parameters:
listener - The object to be removed from the notification list.
 o addPropertyChangeListener
 public void addPropertyChangeListener(PropertyChangeListener listener)
Adds a listener to be notified when the SQLString property or the flightInfo property has been changed.

Parameters:
listener - The object to be notified.
 o removePropertyChangeListener
 public void removePropertyChangeListener(PropertyChangeListener listener)
Removes a listener from the notification list.

Parameters:
listener - The object to be removed from the notification list.
 o queryDataBase
 public FlightInfoEvent queryDataBase(TravelInfoChangedEvent travelInfoChange)
Queries the database to find all of the possible flight choices that match the user request of origin city, destination city, departure date, and return date.

Parameters:
travelInfoChange - The TravelInfoChanged event containing the travel info
Returns:
The FlightInfoEvent containing the flight info
 o reserveFlight
 public FlightReservedEvent reserveFlight(FlightRequestedEvent flightRequestedEvent)
Attempts to reserve the specified flight(s).

Parameters:
flightRequestedEvent - The FlightRequestedEvent containing the preferred flight itinerary.
Returns:
The FlightReservedEvent containing the actually reserved flight itinerary.
 o fireFlightReserved
 public void fireFlightReserved(FlightReservedEvent fRE)
Notifies all registered listeners that a flight has been reserved. In the demo, this event fires in response to a FlightRequested event notification from the itinerary bean when the requested flight itinerary is confirmed.

Parameters:
fRE - The FlightReservedEvent containing the preferred flight itinerary.
 o fireFlightInfo
 public void fireFlightInfo(FlightInfoEvent fIE)
Notifies all registered listeners. A list of flights are sent as a Vector. In the demo, this event fires in response to a TavelInfoChangedEvent which is fired by the itinerary bean after a user has entered the origin and destination cities and dates and has pressed the submit button. This DAP then queries the database for matching flights, builds this information into a vector, and fires the FlightInformationChanged notification to the flight selector bean.

Parameters:
fIE - The FlightInfoEvent containing the possible flight selections.
 o setFlightInfo
 public void setFlightInfo(Vector newValue) throws PropertyVetoException
Accessor (set) method for the FlightInfo property.

Parameters:
newValue - A Vector representing the FlightInformation.
Throws: PropertyVetoException
Indicates that a constrained property listener has vetoed the change to the flightInfo property.
 o getFlightInfo
 public Vector getFlightInfo()
Accessor (get) method for the FlightInfo property.

Returns:
The Vector containing FlightInformation objects.
 o setSQLString
 public void setSQLString(String SQLString) throws PropertyVetoException
Accessor (set) method for the SQLString property.

Parameters:
SQLString - The String representing the SQL property of the bean.
Throws: PropertyVetoException
Indicates that a constrained property listener has vetoed the change to the SQLString property.
 o getSQLString
 public String getSQLString()
Accessor (get) method for the SQLString property.

Returns:
The String containing the SQL database query

All Packages  Class Hierarchy  This Package  Previous  Next  Index