|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.servlet.GenericServlet | +--javax.servlet.http.HttpServlet | +--com.faa.flyfaa.xmlAirportStatusServlet
A servlet class to do the bulk of the work in generating the flyFAA Airport Status in XML. Uses JDOM to generate the XML tags. This class provides anonymous inner classes UpdateTimeElement, ClosureElement, GSElement, GDPElement and ArrivalDepartureElement to assist with the generation of these elements.
Field Summary | |
private java.lang.String |
dbDriver
The type of drivers to be used (thin or thick). |
static java.lang.String |
DOCTYPE
A string to represent the <!DOCTYPE> tag |
static java.lang.String |
DTD
A string to represent the dtd reference for fly.faa.gov's XML Airport Status page |
private static java.util.Properties |
flyProps
The properties file for the flyfaa java application. |
private static java.lang.String |
jdbcLogFile
Contains the name of the log file. |
private oracle.jdbc.pool.OracleConnectionPoolDataSource |
l_ocpds
The source of the database connection pool. |
(package private) static java.lang.String |
Logf
Pointer to the log file, which will be named FLYlogyyyy_Monddhhmm.txt (for example, FLYlog2003_Jan291940.txt) and is currently set up to reside in the /web/trace/atcscc/java_logs directory. |
protected static javax.sql.PooledConnection |
m_connectionPool
The pool of connections |
(package private) boolean |
MadeLog
Flag to let me know whether the log file has been created. |
private static oracle.jdbc.pool.OracleConnectionCacheImpl |
ocacheimpl
|
private oracle.jdbc.pool.OracleConnectionEventListener |
ocel
|
private static java.io.PrintWriter |
out
A printWriter for the log. |
Fields inherited from class javax.servlet.http.HttpServlet |
HEADER_IFMODSINCE, HEADER_LASTMOD, LSTRING_FILE, lStrings, METHOD_DELETE, METHOD_GET, METHOD_HEAD, METHOD_OPTIONS, METHOD_POST, METHOD_PUT, METHOD_TRACE |
Fields inherited from class javax.servlet.GenericServlet |
config |
Constructor Summary | |
xmlAirportStatusServlet()
|
Method Summary | |
private boolean |
CreateLog(java.lang.String LogName)
Creates a new PrintWriter , using the given
filename, for writing log messages. |
void |
doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Handle the HTTP GET method; build the flyFAA XML Airport Status web page. |
void |
doPost(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Handle the HTTP POST method; forwards request and response to the doGet method to build the flyFAA XML Airport Status web page. |
org.jdom.Element |
getClosureGroup(FlyFAAProjectBean proj)
Generates an element containing all the Airport Closure information. |
org.jdom.Element |
getDelaysGroup(FlyFAAProjectBean proj)
Generates an element containing all the General Arrival and Departure Delay information. |
org.jdom.Element |
getGroundDelayProgramsGroup(FlyFAAProjectBean proj)
Generates an element containing all the Ground Delay Program information. |
org.jdom.Element |
getGroundStopGroup(FlyFAAProjectBean proj)
Generates an element containing all the Ground Stop information. |
static java.lang.String |
headWithTitle(java.lang.String title)
Returns an HTML string containing a document title suitable for use at the beginning of a webpage. |
void |
init(javax.servlet.ServletConfig config)
Initializes the servlet. |
(package private) static void |
logging(int lvl,
java.lang.String msg)
Writes a message at a FlyLog.DebugLevel specified by lvl to the log file. |
(package private) static void |
logging(int lvl,
java.lang.Throwable e,
java.lang.String msg)
Writes a message at a DebugLevel specified by lvl with an Exception
to the log file. |
(package private) static void |
logging(java.lang.String msg)
Writes a message to the log file prefixed by a date/timestamp. |
(package private) static void |
logging(java.lang.Throwable e,
java.lang.String msg)
Writes a FlyLog.DebugLevel message with an Exception to the log file. |
org.jdom.Document |
XMLDocument(FlyFAAProjectBean proj)
Generates a JDOM Document containing the complete contents of the flyFAA XML Airport Status. |
Methods inherited from class javax.servlet.http.HttpServlet |
|
Methods inherited from class javax.servlet.GenericServlet |
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
Field Detail |
static java.lang.String Logf
private static java.io.PrintWriter out
private static java.lang.String jdbcLogFile
boolean MadeLog
protected static javax.sql.PooledConnection m_connectionPool
private oracle.jdbc.pool.OracleConnectionPoolDataSource l_ocpds
private static oracle.jdbc.pool.OracleConnectionCacheImpl ocacheimpl
private oracle.jdbc.pool.OracleConnectionEventListener ocel
private static java.util.Properties flyProps
private java.lang.String dbDriver
public static final java.lang.String DOCTYPE
public static final java.lang.String DTD
Constructor Detail |
public xmlAirportStatusServlet()
Method Detail |
public static java.lang.String headWithTitle(java.lang.String title)
title
- The string to be used as the document's titlepublic void init(javax.servlet.ServletConfig config) throws javax.servlet.ServletException
init
in class javax.servlet.GenericServlet
javax.servlet.ServletException
- If the properties file cannot be found or read,
or if the connection pool cache cannot be createdprivate boolean CreateLog(java.lang.String LogName)
PrintWriter
, using the given
filename, for writing log messages. If the file cannot be opened, standard
error is opened instead.LogName
- The name of the file to be used as the log file.true
if the log was created successfully, false
otherwise.static void logging(java.lang.String msg)
msg
- The message to be written to the log file.static void logging(int lvl, java.lang.String msg)
lvl
to the log file.
The message is prefixed with a custom Date/Timestamp of a form similar to
'9/30/02 20:26:03.389:' followed by either '[DEBUG]' or '[ERROR]' depending on the
given lvl
. The message is only written if the 'enableLog' flag from the
properties file is set and the 'FlyLog.DebugLevel' property from the properties file is
greater than or equal to the given lvl
.
lvl
- int representing the FlyLog.DebugLevel of this log message.
If the FlyLog.DebugLevel property is at least this value, the message will be printed.msg
- String containing the log message to be printedstatic void logging(java.lang.Throwable e, java.lang.String msg)
msg
if the FlyLog.DebugLevel is FlyLog.DebugLevel, that is, if all
log messages are supposed to be printed.
e
- Throwable object (usually an Exception)msg
- String containing the log message to be printedstatic void logging(int lvl, java.lang.Throwable e, java.lang.String msg)
lvl
with an Exception
to the log file. The message is prefixed with a medium format Date/Timestamp of a
form similar to '4/23/02 8:26:03 PM:'. The message is only written if the 'enableLog'
flag from the properties file is set and the 'DebugLevel' property from the properties
file is greater than or equal to the given lvl
.
lvl
- int representing the DebugLevel of this log message.e
- Throwable object (usually an Exception)msg
- String containing the log message to be printedpublic void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException
doGet
in class javax.servlet.http.HttpServlet
request
- HttpServletRequest objectresponse
- HttpServletResponse objectjavax.servlet.ServletException
- java.io.IOException
- public void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException
doPost
in class javax.servlet.http.HttpServlet
request
- HttpServletRequest objectresponse
- HttpServletResponse objectjavax.servlet.ServletException
- java.io.IOException
- public org.jdom.Document XMLDocument(FlyFAAProjectBean proj)
proj
- FlyFAAProjectBean referencepublic org.jdom.Element getClosureGroup(FlyFAAProjectBean proj)
<Name>Airport Closures</Name> <Airport_Closure_List> <Airport> <ARPT>HPN</ARPT> <Reason>SNOW REMOVAL</Reason> <Start>Dec 5 at 9:45 am EST.</Start> <Reopen>Dec 5 at 10:30 am EST.</Reopen> </Airport> </Airport_Closure_List> </Delay_type>
proj
- FlyFAAProjectBean referencepublic org.jdom.Element getGroundStopGroup(FlyFAAProjectBean proj)
<Name>Ground Stop Programs</Name> <Ground_Stop_List> <Program> <ARPT>HPN</ARPT> <Reason>WX BELOW MINIMUMS</Reason> <End_Time>1:30 pm EST.</End_Time> </Program> </Ground_Stop_List> </Delay_type>
proj
- FlyFAAProjectBean referencepublic org.jdom.Element getGroundDelayProgramsGroup(FlyFAAProjectBean proj)
<Delay_type> <Name>Ground Delay Programs</Name> <Ground_Delay_List> <Ground_Delay> <ARPT>EWR</ARPT> <Reason>WEATHER, SNOW/SNOW REMOVAL</Reason> <Avg>4 hours and 9 minutes</Avg> <Max>9 hours and 19 minutes</Max> </Ground_Delay> </Ground_Delay_List> </Delay_type>
proj
- FlyFAAProjectBean referencepublic org.jdom.Element getDelaysGroup(FlyFAAProjectBean proj)
<Delay_type> <Name>General Arrival/Departure Delay Info</Name> <Arrival_Departure_Delay_List> <Delay> <ARPT>LGA</ARPT> <Reason>ZNY HOLDING DUE TO SNOW</Reason> <Arrival_Departure Type="Arrival"> <Min>46 minutes</Min> <Max>1 hour</Max> <Trend>Increasing</Trend> </Arrival_Departure> </Delay> </Arrival_Departure_Delay_List> </Delay_type>
proj
- FlyFAAProjectBean reference
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |