Class GetAirport
java.lang.Object
org.deltava.dao.DAO
org.deltava.dao.GetAirport
A Data Access Object to load Airport data.
- Since:
- 1.0
- Version:
- 10.6
- Author:
- Luke
-
Field Summary
Fields inherited from class org.deltava.dao.DAO
_queryMax, _queryStart, _queryTimeout, WGS84_SRID
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns an airport object by its IATA or ICAO code.Returns the number of Airports served by each Airline.getAll()
Returns all airports.getByAirline
(Airline al, String sortBy) Returns all Airports served by a particular Airline.getByPilot
(int id) Returns all Airports visited by a particular Pilot.Returns all Airports with upcoming Online Events.Returns the ICAO code for a particular airport from the DAFIF database.getTourAirports
(String dbName) Returns all Airports with active Flight Tours.Returns all Airports with Terminal Routes.void
setAppCode
(String code) Overrides the application code (for use by the ACARS server).Methods inherited from class org.deltava.dao.DAO
commitTransaction, createTimestamp, executeIDs, executeUpdate, executeUpdate, expandDate, formatDBName, formatLocation, getNewID, getQueryCount, prepare, prepareWithoutLimits, rollbackTransaction, setQueryMax, setQueryStart, setQueryTimeout, startTransaction, toID, toID, toInstant
-
Constructor Details
-
GetAirport
Creates the DAO with a JDBC connection.- Parameters:
c
- the JDBC connection to usea
-
-
Method Details
-
setAppCode
Overrides the application code (for use by the ACARS server).- Parameters:
code
- the new application code- Throws:
NullPointerException
- if code is null
-
get
Returns an airport object by its IATA or ICAO code.- Parameters:
code
- the airport IATA or ICAO code- Returns:
- an Airport object matching the requested code, or null if not found
- Throws:
DAOException
- if a JDBC error occursNullPointerException
- if code is null
-
getByAirline
Returns all Airports served by a particular Airline.- Parameters:
al
- the Airline to query withsortBy
- the SORT BY column- Returns:
- a List of Airport objects
- Throws:
DAOException
- if a JDBC error occursNullPointerException
- if al is null
-
getByPilot
Returns all Airports visited by a particular Pilot.- Parameters:
id
- the Pilot's database ID- Returns:
- a Collection of Airport beans
- Throws:
DAOException
- if a JDBC error occurs
-
getEventAirports
Returns all Airports with upcoming Online Events.- Returns:
- a Collection of Airports
- Throws:
DAOException
- if a JDBC error occurs
-
getTourAirports
Returns all Airports with active Flight Tours.- Parameters:
dbName
- the database name- Returns:
- a Collection of Airports
- Throws:
DAOException
- if a JDBC error occurs
-
getWithTerminalRoutes
Returns all Airports with Terminal Routes.- Returns:
- a Collection of Airport beans
- Throws:
DAOException
- if a JDBC error occurs
-
getAll
Returns all airports.- Returns:
- a Map of Airports, keyed by IATA/ICAO codes
- Throws:
DAOException
- if a JDBC error occurs
-
getICAO
Returns the ICAO code for a particular airport from the DAFIF database.- Parameters:
iata
- the IATA code- Returns:
- the ICAO code, or null if not found
- Throws:
DAOException
- if a JDBC error occurs
-
getAirportCounts
Returns the number of Airports served by each Airline.- Returns:
- a Map of counts, keyed by Airline
- Throws:
DAOException
- if a JDBC error occurs
-