euroLCC
Class Route

java.lang.Object
  |
  +--javax.servlet.GenericServlet
        |
        +--javax.servlet.http.HttpServlet
              |
              +--euroLCC.Route
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class Route
extends javax.servlet.http.HttpServlet

Controller for route display.

alexis.grandemange@pagebox.net

Copyright (c) 2002-2003 Alexis Grandemange

This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU Lesser General Public License
 as published by the Free Software Foundation; version 2.1 of the
 License.
 This library is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 GNU Lesser General Public License for more details.
 A copy of the GNU Lesser General Public License lesser.txt should be
 included in the distribution.

Version:
0, 0, 1
Author:
Alexis Grandemange
See Also:
Serialized Form

Field Summary
(package private)  java.util.HashMap codes
          Map to find an airport name after an airport code.
(package private)  javax.servlet.ServletContext ctx
          Unique to the Web application
(package private)  javax.servlet.RequestDispatcher dispatcher
          Dispatcher to airline.jsp
(package private)  boolean initialized
          True if the route table has been read
(package private)  PageBoxAPI inst
          PageBox API instance
(package private)  PageBoxLib.LogIF log
          Logging object
(package private)  RouteBean rb
          Model object
(package private)  java.lang.String workDir
          Directory where API.txt is defined
 
Fields inherited from class javax.servlet.http.HttpServlet
 
Fields inherited from class javax.servlet.GenericServlet
 
Constructor Summary
Route()
           
 
Method Summary
 void destroy()
          Called by the servlet container to indicate to a servlet that the servlet is being taken out of service.
 void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          GET request handling.
 void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          POST request handling.
private  java.lang.String findRoutes(java.lang.String oc, java.lang.String dc)
          Find routes between an origin and a destination airport.
 void init(javax.servlet.ServletConfig config)
          Invoked by Servlet container.
(package private)  java.lang.String initialize()
          Builds a map whose key is the airport name and value is the airport code.
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dispatcher

javax.servlet.RequestDispatcher dispatcher
Dispatcher to airline.jsp


inst

PageBoxAPI inst
PageBox API instance


log

PageBoxLib.LogIF log
Logging object


rb

RouteBean rb
Model object


codes

java.util.HashMap codes
Map to find an airport name after an airport code.
Key: airport code
Value: airport name


workDir

java.lang.String workDir
Directory where API.txt is defined


ctx

javax.servlet.ServletContext ctx
Unique to the Web application


initialized

boolean initialized
True if the route table has been read

Constructor Detail

Route

public Route()
Method Detail

init

public void init(javax.servlet.ServletConfig config)
          throws javax.servlet.ServletException
Invoked by Servlet container.

Specified by:
init in interface javax.servlet.Servlet
Overrides:
init in class javax.servlet.GenericServlet
Parameters:
config - servlet configuration
javax.servlet.ServletException

destroy

public void destroy()
Called by the servlet container to indicate to a servlet that the servlet is being taken out of service. Ends the publish thread and closes the connections.

Specified by:
destroy in interface javax.servlet.Servlet
Overrides:
destroy in class javax.servlet.GenericServlet

initialize

java.lang.String initialize()
Builds a map whose key is the airport name and value is the airport code.

Returns:
error message

doGet

public void doGet(javax.servlet.http.HttpServletRequest request,
                  javax.servlet.http.HttpServletResponse response)
           throws javax.servlet.ServletException,
                  java.io.IOException
GET request handling.

Overrides:
doGet in class javax.servlet.http.HttpServlet
Parameters:
request - HttpServletRequest
response - HttpServletResponse
javax.servlet.ServletException
java.io.IOException

findRoutes

private java.lang.String findRoutes(java.lang.String oc,
                                    java.lang.String dc)
Find routes between an origin and a destination airport.

Parameters:
oc - origin airport code
dc - destination airport code

doPost

public void doPost(javax.servlet.http.HttpServletRequest request,
                   javax.servlet.http.HttpServletResponse response)
            throws javax.servlet.ServletException,
                   java.io.IOException
POST request handling.

Overrides:
doPost in class javax.servlet.http.HttpServlet
Parameters:
request - HttpServletRequest
response - HttpServletResponse
javax.servlet.ServletException
java.io.IOException