All Packages  Class Hierarchy  This Package  Previous  Next  Index

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

java.lang.Object
   |
   +----java.rmi.server.RemoteObject
           |
           +----java.rmi.server.RemoteServer
                   |
                   +----java.rmi.server.UnicastRemoteObject
                           |
                           +----com.ibm.beans.demos.travel.flight.FlightInfoDapServer

public class FlightInfoDapServer
extends UnicastRemoteObject
implements Serializable, FlightInfoDapProperties, FlightInfoDapServerExports

This class is part of the remote travel demo and implements the flight information data access part (DAP) Server bean. For the remote travel demo, the flight information data access part (DAP) bean has been divided into a FlightInfoDapClient bean and a FlightInfoDapServer bean. The FlightInfoDapServer bean implements the FlightInfoDapProperties interface which contains methods that are used by the dips from the FlightRules.jar (from the com.ibm.beans.demos.travel.flight.rules package) to alter the flight data returned from the database query. The FlightInfoDapServerExports interface is also implemented. This interface contains the methods that are called on the FlightInfoDapServer from the FlightInfoDapClient to query that database for matching flights and to reserve a particular flight schedule.

A customizer is provided for this server so that a user can configure whether or not to access the database via JDBC or to access database values from the FlightResourceBundle.

See Also:
FlightInfoDapServerCustomizer, FlightInfoDapServerBeanInfo, FlightInfoDapServerExports, FlightInfoDapClient, FlightInfoDapClientCustomizer, FlightInfoDapClientBeanInfo, FlightInfoDapProperties, FlightInformation, TravelInfoChangedEvent, FlightInfoEvent, FlightRequestedEvent, FlightReservedEvent

Constructor Index

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

Method Index

 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 bindWithRegistry()
Create and install the security manager and rebind the FlightInfoDapServer name to this object instance.
 o finalize()
Unbind the FlightInfoDapServer
 o getbUseJDBC()
Accessor (get) method for the bUseJDBC property.
 o getdbTableName()
Accessor (get) method for the dbTableName property.
 o getFlightInfo()
Accessor (get) method for the flightInfo property.
 o getJDBCURL()
Accessor (get) method for the JDBCURL property.
 o getSQLString()
Accessor (get) method for the SQLString property.
 o main(String[])
Runs the FlightInfoDapServer as an application.
 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 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 setbUseJDBC(Boolean)
Accessor (set) method for the bUseJDBC property.
 o setdbTableName(String)
Accessor (set) method for the dbTableName property.
 o setFlightInfo(Vector)
Accessor (set) method for the flightInfo property.
 o setJDBCURL(String)
Accessor (set) method for the JDBCURL property.
 o setSQLString(String)
Accessor (set) method for the SQLString property.

Constructors

 o FlightInfoDapServer
 public FlightInfoDapServer() throws RemoteException
Constructs an instance of the FlightInfoDapServer bean. The constructor initializes instance data.

Throws: RemoteException
Thrown if registry could not be contacted

Methods

 o main
 public static void main(String argv[])
Runs the FlightInfoDapServer as an application. By default, Beans.instantiate() is used, passing "com.ibm.beans.demos.travel.flight.FlightInfoDapServer" as the name of the object to be instantiated; however, if "-dippable" is specified, it will use "com.ibm.beans.demos.travel.flight.FlightInfoDapServerDippable" as the name of the object to be instantiated. Note that by using Beans.instantiate, this allows for a customized version of the FlightInfoDapServer to be used, so long as it is named FlightInfoDapServer.ser (or FlightInfoDapServerDippable.ser, if the "-dippable" option is specified).

 o bindWithRegistry
 public void bindWithRegistry()
Create and install the security manager and rebind the FlightInfoDapServer name to this object instance.

 o finalize
 protected void finalize()
Unbind the FlightInfoDapServer

Overrides:
finalize in class Object
 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) throws RemoteException
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
Throws: RemoteException
Thrown if registry could not be contacted
 o reserveFlight
 public FlightReservedEvent reserveFlight(FlightRequestedEvent flightRequestedEvent) throws RemoteException
Attempts to reserve the specified flight(s). This method is invoked by the FlightInfoDapClient when the Itinerary bean has been wired to the FlightInfoDapClient bean and the user has selected a preferred itinerary.

Parameters:
flightRequestedEvent - The FlightRequestedEvent containing the preferred flight itinerary.
Returns:
The FlightReservedEvent containing the reserved flight itinerary.
 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
 o setJDBCURL
 public void setJDBCURL(String JDBCURL) throws PropertyVetoException
Accessor (set) method for the JDBCURL property.

Parameters:
JDBCURL - The JDBC URL for the JDBC connection
Throws: PropertyVetoException
Indicates that a constrained property listener has vetoed the change to the JDBCURL property.
 o getJDBCURL
 public String getJDBCURL()
Accessor (get) method for the JDBCURL property.

Returns:
The string containing the JDBCURL value.
 o setbUseJDBC
 public void setbUseJDBC(Boolean bUseJDBC) throws PropertyVetoException
Accessor (set) method for the bUseJDBC property.

Parameters:
bUseJDBC - A boolean that signifies whether a JDBC database or the hard coded database will be used.
Throws: PropertyVetoException
Indicates that a constrained property listener has vetoed the change to the bUseJDBC property.
 o getbUseJDBC
 public Boolean getbUseJDBC()
Accessor (get) method for the bUseJDBC property.

Returns:
The Boolean object containing the bUseJDBC value.
 o setdbTableName
 public void setdbTableName(String dbTableName) throws PropertyVetoException
Accessor (set) method for the dbTableName property.

Parameters:
dbTableName - The database table name
Throws: PropertyVetoException
Indicates that a constrained property listener has vetoed the change to the dbTableName property.
 o getdbTableName
 public String getdbTableName()
Accessor (get) method for the dbTableName property.

Returns:
The string containing the dbTableName value.

All Packages  Class Hierarchy  This Package  Previous  Next  Index