Class GetFlightReportStatistics

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

public class GetFlightReportStatistics extends DAO
A Data Access Object to retrieve Flight Report statistics.
Since:
2.1
Version:
11.6
Author:
Luke
  • Constructor Details

    • GetFlightReportStatistics

      public GetFlightReportStatistics(Connection c)
      Initializes the Data Access Object.
      Parameters:
      c - the JDBC connection to use
  • Method Details

    • setDayFilter

      public void setDayFilter(int days)
      Sets the maximum number of days in the past to include.
      Parameters:
      days - the number of days
      Since:
      2.1
    • getAirport

      public Collection<RoutePair> getAirport(boolean isACARS) throws DAOException
      Returns Airports with flights.
      Parameters:
      isACARS - TRUE to include only ACARS flights, otherwise FALSE
      Returns:
      a Collection of RoutePair objects
      Throws:
      DAOException - if a JDBC error occurs
    • getPopularRoutes

      public Collection<RouteStats> getPopularRoutes(int pilotID) throws DAOException
      Retrieves the most popular route pairs filed by a particular Pilot.
      Parameters:
      pilotID - the Pilot database ID
      Returns:
      a Collection of RouteStats beans
      Throws:
      DAOException - if a JDBC error occurs
    • getPopularRoutes

      public Collection<ScheduleRoute> getPopularRoutes(boolean noRoutes, boolean allFlights) throws DAOException
      Returns the most popular route pairs filed by Pilots.
      Parameters:
      noRoutes - TRUE to include pairs without dispatch routes only, otherwise FALSE
      allFlights - TRUE to include Flight Reports without ACARS, otherwise FALSE
      Returns:
      a Collection of RoutePair beans
      Throws:
      DAOException - if a JDBC error occurs
    • getLandings

      public Collection<LandingStatistics> getLandings(String eqType, int minLandings) throws DAOException
      Returns statistical information about landing speeds and variations between them.
      Parameters:
      eqType - the aircraft type
      minLandings - the minimum number of landings to qualify
      Returns:
      a Collection of LandingStatistics beans
      Throws:
      DAOException - if a JDBC error occurs
    • getLandingData

      public Collection<TouchdownData> getLandingData(int pilotID) throws DAOException
      Returns touchdown speed and runway distance data for all of a Pilot's flights.
      Parameters:
      pilotID - the Pilot's database ID
      Returns:
      a Collection of TouchdownData beans
      Throws:
      DAOException - if a JDBC error occurs
    • getLandings

      public List<LandingStatistics> getLandings(int pilotID) throws DAOException
      Returns statistical information about a pilot's landing speeds and variations between them.
      Parameters:
      pilotID - the Pilot's database ID
      Returns:
      a List of LandingStatistics beans
      Throws:
      DAOException - if a JDBC error occurs
    • getLandingCounts

      public Map<Integer,Integer> getLandingCounts(int pilotID, int range) throws DAOException
      Returns the number of landings within a particular vertical speed range.
      Parameters:
      pilotID - the Pilot's database ID
      range - the size of the vertical speed ranges
      Returns:
      a Map of landing counts keyed by vertical speed range
      Throws:
      DAOException - if a JDBC error occurs
    • getLandingScores

      public Collection<LandingStatsEntry> getLandingScores(int pilotID) throws DAOException
      Calculcates landing scores over time.
      Parameters:
      pilotID - the Pilot's database ID
      Returns:
      a Collection of LandingStatsEntry beans
      Throws:
      DAOException - if a JDBC error occurs
    • getEQPIREPStatistics

      public Collection<FlightStatsEntry> getEQPIREPStatistics(String eqType, String groupBy, String orderBy) throws DAOException
      Retrieves aggregated approved Flight Report statistics for Flights flown using aircraft that are Primary Ratings for a particular Equipment Type program.
      Parameters:
      eqType - the Equipment type name
      groupBy - the "GROUP BY" column name
      orderBy - the "ORDER BY" column name
      Returns:
      a Collection of FlightStatsEntry beans
      Throws:
      DAOException - if a JDBC error occurs
    • getCharterStatistics

      public Collection<FlightStatsEntry> getCharterStatistics(FlightStatsSort s, FlightStatsGroup grp) throws DAOException
      Retrieves aggregated Charter Flight Report statistics.
      Parameters:
      s - the statistics sorting option
      grp - the statistics grouping option
      Returns:
      a Collection of FlightStatsEntry beans
      Throws:
      DAOException - if a JDBC error occurs
    • getPilotTotals

      public List<YearlyTotal> getPilotTotals(LocalDate sd) throws DAOException
      Loads flight/distance statistics by Pilot for a one year interval.
      Parameters:
      sd - the start date
      Returns:
      a List of YearlyTotal beans
      Throws:
      DAOException - if a JDBC error occurs
      See Also:
    • getCharterCount

      public int getCharterCount(int pilotID, int days, Instant dt) throws DAOException
      Returns the number of Charter flights flown by a Pilot in a particular time interval.
      Parameters:
      pilotID - the Pilot's datbase ID
      days - the number of days backwards, zero for all
      dt - the end date/time
      Returns:
      the number of approved Charter flights
      Throws:
      DAOException - if a JDBC error occurs
    • getStageStatistics

      public Collection<StageStatsEntry> getStageStatistics(int pilotID) throws DAOException
      Returns flight statistics by date and stage.
      Parameters:
      pilotID - the Pilot's database ID or zero for all pilots
      Returns:
      a Collection of StageStatsEntry beans
      Throws:
      DAOException - if a JDBC error occurs
    • getSimulatorStatistics

      public Collection<SimStatsEntry> getSimulatorStatistics(int pilotID) throws DAOException
      Returns simulator statistics by date and stage.
      Parameters:
      pilotID - the Pilot's database ID or zero for all pilots
      Returns:
      a Collection of SimStatsEntry beans
      Throws:
      DAOException - if a JDBC error occurs
    • getUnscoredFlights

      public Collection<Integer> getUnscoredFlights() throws DAOException
      Returns all the Flight Reports without an Elite score.
      Returns:
      a Collection of Flight Report database IDs
      Throws:
      DAOException - if a JDBC error occurs
    • getStatistics

      public Collection<FlightStatsEntry> getStatistics(Collection<Integer> IDs, int days, FlightStatsSort s) throws DAOException
      Retrieves flight statistics for an arbitrary set of Pilots.
      Parameters:
      IDs - a Collection of database IDs
      days - the number of days back to aggregate
      s - the statistics sorting option
      Returns:
      a Collection of FlightStatsEntry beans
      Throws:
      DAOException - if a JDBC error occurs
    • getPIREPStatistics

      public Collection<FlightStatsEntry> getPIREPStatistics(int pilotID, FlightStatsSort s, FlightStatsGroup grp) throws DAOException
      Retrieves aggregated approved Flight Report statistics.
      Parameters:
      pilotID - the Pilot's database ID, or zero if airline-wide
      s - the statistics sorting option
      grp - the statistics grouping option
      Returns:
      a Collection of FlightStatsEntry beans
      Throws:
      DAOException - if a JDBC error occurs