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
-
FlightInfoDap()
- Constructs an instance of the FlightInfoDap bean.
-
addFlightInfoListener(FlightInfoListener)
- Allows other beans to listen to the FlightInfo events this bean generates.
-
addFlightReservedListener(FlightReservedListener)
- Allows other beans to listen to the FlightReserved events this bean generates.
-
addPropertyChangeListener(PropertyChangeListener)
- Adds a listener to be notified when the SQLString property or the flightInfo property has been changed.
-
addVetoableChangeListener(VetoableChangeListener)
- Adds a listener to be notified when the SQLString property or the
flightInfo property is about to be changed.
-
fireFlightInfo(FlightInfoEvent)
- Notifies all registered listeners.
-
fireFlightReserved(FlightReservedEvent)
- Notifies all registered listeners that a flight has been reserved.
-
FlightRequested(FlightRequestedEvent)
- Responds to a FlightRequested event.
-
getFlightInfo()
- Accessor (get) method for the FlightInfo property.
-
getSQLString()
- Accessor (get) method for the SQLString property.
-
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.
-
removeFlightInfoListener(FlightInfoListener)
- Allows beans to remove themselves from the listener list for this bean's
FlightInfo event.
-
removeFlightReservedListener(FlightReservedListener)
- Allows beans to remove themselves from the listener list for this bean's
FlightReserved event.
-
removePropertyChangeListener(PropertyChangeListener)
- Removes a listener from the notification list.
-
removeVetoableChangeListener(VetoableChangeListener)
- Removes a listener from the notification list.
-
reserveFlight(FlightRequestedEvent)
- Attempts to reserve the specified flight(s).
-
setFlightInfo(Vector)
- Accessor (set) method for the FlightInfo property.
-
setSQLString(String)
- Accessor (set) method for the SQLString property.
-
TravelInfoChanged(TravelInfoChangedEvent)
- Responds to a TravelInfoChanged event.
FlightInfoDap
public FlightInfoDap()
- Constructs an instance of the FlightInfoDap bean. The constructor initializes
instance data.
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
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.
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
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
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
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
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.
removeVetoableChangeListener
public void removeVetoableChangeListener(VetoableChangeListener listener)
- Removes a listener from the notification list.
- Parameters:
- listener - The object to be removed from the notification list.
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.
removePropertyChangeListener
public void removePropertyChangeListener(PropertyChangeListener listener)
- Removes a listener from the notification list.
- Parameters:
- listener - The object to be removed from the notification list.
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
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.
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.
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.
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.
getFlightInfo
public Vector getFlightInfo()
- Accessor (get) method for the FlightInfo property.
- Returns:
- The Vector containing FlightInformation objects.
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.
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