Class GetFlightReportStatistics
java.lang.Object
org.deltava.dao.DAO
org.deltava.dao.GetFlightReportStatistics
A Data Access Object to retrieve Flight Report statistics.
- Since:
- 2.1
- Version:
- 12.4
- Author:
- Luke
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class DAO
_queryMax, _queryStart, _queryTimeout, WGS84_SRIDModifier and TypeFieldDescriptionprotected intThe maximum number of rows to return.protected intThe row number at which to start returning results.protected intThe query timeout, in seconds.protected static final intThe SRID used for geolocation queries. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAirport(boolean isACARS) Returns Airports with flights.intgetCharterCount(int pilotID, int days, Instant dt) Returns the number of Charter flights flown by a Pilot in a particular time interval.Retrieves aggregated Charter Flight Report statistics.getEQPIREPStatistics(String eqType, String groupBy, String orderBy) Retrieves aggregated approved Flight Report statistics for Flights flown using aircraft that are Primary Ratings for a particular Equipment Type program.intgetFlightCount(int pilotID, int year) Returns the number of Flight legs completed by a Pilot in a given calendar year.getLandingCounts(int pilotID, int range) Returns the number of landings within a particular vertical speed range.getLandingData(int pilotID) Returns touchdown speed and runway distance data for all of a Pilot's flights.getLandings(int pilotID) Returns statistical information about a pilot's landing speeds and variations between them.getLandings(String eqType, int minLandings) Returns statistical information about landing speeds and variations between them.getLandingScores(int pilotID) Calculcates landing scores over time.Loads flight/distance statistics by Pilot for a one year interval.getPIREPStatistics(int pilotID, FlightStatsSort s, FlightStatsGroup grp) Retrieves aggregated approved Flight Report statistics.getPopularRoutes(boolean noRoutes, boolean allFlights) Returns the most popular route pairs filed by Pilots.getPopularRoutes(int pilotID) Retrieves the most popular route pairs filed by a particular Pilot.getSimulatorStatistics(int pilotID) Returns simulator statistics by date and stage.getStageStatistics(int pilotID) Returns flight statistics by date and stage.getStatistics(Collection<Integer> IDs, int days, FlightStatsSort s) Retrieves flight statistics for an arbitrary set of Pilots.Returns all the Flight Reports without an Elite score.voidsetDayFilter(int days) Sets the maximum number of days in the past to include.Methods inherited from class DAO
commitTransaction, createTimestamp, executeIDs, executeUpdate, executeUpdate, expandDate, formatDBName, formatLocation, getNewID, getQueryCount, prepare, prepareWithoutLimits, rollbackTransaction, setQueryMax, setQueryStart, setQueryTimeout, startTransaction, toID, toID, toInstantModifier and TypeMethodDescriptionprotected voidCommits a multi-step transaction to the database.protected static TimestampNull-safe conversion of an Instant to a Timestamp.Helper method to extract database ID data from the result set.protected static intexecuteUpdate(PreparedStatement ps, int minUpdateCount) Executes an UPDATE transaction on a prepared statement, and throws aSQLExceptionif less than the expected number of rows were updated.protected static intexecuteUpdate(PreparedStatement ps, int minPerUpdate, int minTotal) Executes an batched UPDATE transaction on a prepared statement, and throws aSQLExceptionif less than the expected number of rows were updated per batch entry.protected static InstantexpandDate(Date dt) Converts a date-only JDBC value into a full timestamp.protected static StringformatDBName(String db) Formats a database name by converting to lowercase.protected static StringConverts a geographic location into a MySQL WKT formatted point.protected intgetNewID()Returns the AUTO_INC column value generated by the previous JDBC transaction.static final longReturns the total number of queries executed since the JVM was started.protected PreparedStatementInitialize the prepared statement with an arbitrary SQL statement.protected PreparedStatementInitialize the prepared statement with an abitrary SQL statement, without applying the DAO's query result limitations.protected voidRolls back a multi-step transaction before it is completed.final voidsetQueryMax(int maxRows) Sets the maximum number of rows in the returned result set.final voidsetQueryStart(int rowStart) Sets the first row of the results to return.voidsetQueryTimeout(int timeout) Sets the timeout for any SQL operations.protected voidMarks the start of a multi-step database transaction.protected static IntegerConverts a Database bean or an Integer into an Integer.protected static Collection<Integer> toID(Collection<?> ids) Converts a collection of Objects into Integer IDs.protected static InstantNull-safe conversion of a Timestamp to an Instant.
-
Constructor Details
-
GetFlightReportStatistics
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
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
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 FALSEallFlights- 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 typeminLandings- the minimum number of landings to qualify- Returns:
- a Collection of LandingStatistics beans
- Throws:
DAOException- if a JDBC error occurs
-
getLandingData
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
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
Returns the number of landings within a particular vertical speed range.- Parameters:
pilotID- the Pilot's database IDrange- 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
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 namegroupBy- the "GROUP BY" column nameorderBy- 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 optiongrp- the statistics grouping option- Returns:
- a Collection of FlightStatsEntry beans
- Throws:
DAOException- if a JDBC error occurs
-
getPilotTotals
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:
-
getFlightCount
Returns the number of Flight legs completed by a Pilot in a given calendar year.- Parameters:
pilotID- the Pilot database IDyear- the calendar year- Returns:
- the number of Flight legs completed in the year
- Throws:
DAOException- if a JDBC error occurs
-
getCharterCount
Returns the number of Charter flights flown by a Pilot in a particular time interval.- Parameters:
pilotID- the Pilot's datbase IDdays- the number of days backwards, zero for alldt- the end date/time- Returns:
- the number of approved Charter flights
- Throws:
DAOException- if a JDBC error occurs
-
getStageStatistics
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
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
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 IDsdays- the number of days back to aggregates- 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-wides- the statistics sorting optiongrp- the statistics grouping option- Returns:
- a Collection of FlightStatsEntry beans
- Throws:
DAOException- if a JDBC error occurs
-