Class GetAirport

java.lang.Object
org.deltava.dao.DAO
org.deltava.dao.GetAirport

public class GetAirport extends DAO
A Data Access Object to load Airport data.
Since:
1.0
Version:
10.6
Author:
Luke
  • Constructor Details

    • GetAirport

      public GetAirport(Connection c)
      Creates the DAO with a JDBC connection.
      Parameters:
      c - the JDBC connection to usea
  • Method Details

    • setAppCode

      public void setAppCode(String code)
      Overrides the application code (for use by the ACARS server).
      Parameters:
      code - the new application code
      Throws:
      NullPointerException - if code is null
    • get

      public Airport get(String code) throws DAOException
      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 occurs
      NullPointerException - if code is null
    • getByAirline

      public Collection<Airport> getByAirline(Airline al, String sortBy) throws DAOException
      Returns all Airports served by a particular Airline.
      Parameters:
      al - the Airline to query with
      sortBy - the SORT BY column
      Returns:
      a List of Airport objects
      Throws:
      DAOException - if a JDBC error occurs
      NullPointerException - if al is null
    • getByPilot

      public Collection<Airport> getByPilot(int id) throws DAOException
      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

      public Collection<Airport> getEventAirports() throws DAOException
      Returns all Airports with upcoming Online Events.
      Returns:
      a Collection of Airports
      Throws:
      DAOException - if a JDBC error occurs
    • getTourAirports

      public Collection<Airport> getTourAirports(String dbName) throws DAOException
      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

      public Collection<Airport> getWithTerminalRoutes() throws DAOException
      Returns all Airports with Terminal Routes.
      Returns:
      a Collection of Airport beans
      Throws:
      DAOException - if a JDBC error occurs
    • getAll

      public Map<String,Airport> getAll() throws DAOException
      Returns all airports.
      Returns:
      a Map of Airports, keyed by IATA/ICAO codes
      Throws:
      DAOException - if a JDBC error occurs
    • getICAO

      public String getICAO(String iata) throws DAOException
      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

      public Map<Airline,Integer> getAirportCounts() throws DAOException
      Returns the number of Airports served by each Airline.
      Returns:
      a Map of counts, keyed by Airline
      Throws:
      DAOException - if a JDBC error occurs