Class GetFlightReportACARS
java.lang.Object
org.deltava.dao.DAO
org.deltava.dao.GetFlightReports
org.deltava.dao.GetFlightReportACARS
A Data Access Object to retrieve ACARS Flight Reports from the database.
- Since:
- 1.0
- Version:
- 11.5
- Author:
- Luke
-
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 TypeMethodDescriptioncheckDupes(String dbName, int acarsID) Checks for duplicate ACARS flight submisions.checkDupes(String dbName, Flight f, int pilotID) Checks for duplicate ACARS flight submissions.getAirframes(String eqType, Airline a, int pilotID) Returns all airframes used for flights in a given Equipment Type and Airline.Returns all Flight Reports flown on a certain date.getByPilot(int id, String orderBy) Returns all Flight Reports for a particular Pilot, using a sort column.Returns alll Flight Reports logged using a specific aircraft SDK.Methods inherited from class GetFlightReports
execute, get, getACARS, getByAssignment, getByEvent, getByNetwork, getByPilot, getByStatus, getByTour, getCaptEQType, getCheckRideQueueSize, getDiversion, getDraft, getDraftReports, getElite, getEliteFlights, getHeld, getLogbookCalendar, getOnlineTotals, getOnlineTotals, getRoutePairs, loadCaptEQTypesModifier and TypeMethodDescriptionprotected static List<FlightReport> Helper method to load PIREP data.Returns a PIREP with a particular database ID.Returns an ACARS-logged PIREP with a particular ACARS Flight ID.getByAssignment(int id, String dbName) Returns all Flight Reports associated with a particular Flight Assignment.getByEvent(int id, String dbName) Returns all Flight Reports associated with a particular Online Event.getByNetwork(OnlineNetwork net, String dbName) Returns approved Flight Reports flown on a particular Online Network.getByPilot(int id, LogbookSearchCriteria criteria) Returns all Flight Reports for a particular Pilot, using a sort column.getByStatus(Collection<FlightStatus> status, String orderBy) Returns all Flight Reports in particular statuses.Returns all Flight Reports associated with a particular Pilot and Flight Tour.voidgetCaptEQType(Collection<FlightReport> pireps) Populates the Equipment Types a collection of PIREPs counts towards promotion in.intgetCheckRideQueueSize(String eqType, boolean includeAcademy) Returns the number of Flight Reports awaiting disposition.getDiversion(Airport a, int pilotID, String db) Retrieves held/submitted Flight diversions for a particular Pilot.Loads a Draft Flight Report.getDraftReports(int pilotID, RoutePair rp, String dbName) Returns Draft Flight Reports for a particular Pilot (with optional city pair).getElite(int id) Returns the Elite program score for a Flight Report.getEliteFlights(int id, int year) Returns all Flight Reports for a given Elite program year.intReturns the number of held Flight Reports for a particular Pilot.getLogbookCalendar(int id, String dbName, Instant startDate, int days) Loads all Flight Reports for a Pilot for a particular date range.voidgetOnlineTotals(Map<Integer, Pilot> pilots, String dbName) Returns online and ACARS legs/hours for a group of Pilots.voidgetOnlineTotals(Pilot p, String dbName) Gets online and ACARS legs/hours for a particular Pilot.getRoutePairs(int pilotID, int days) Returns the city pairs flown by a particular Pilot.voidloadCaptEQTypes(int pilotID, Collection<FlightReport> pireps, String dbName) Load promotion flags for a large number of Flight Reports from a single Pilot.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
-
GetFlightReportACARS
Initializes the Data Access Object.- Parameters:
c- the JDBC connection to use
-
-
Method Details
-
getAirframes
Returns all airframes used for flights in a given Equipment Type and Airline. This will not have populated SimBrief custom airframe IDs.- Parameters:
eqType- the Equipment Typea- the AirlinepilotID- the Pilot database ID, or zero for all Pilots- Returns:
- a List of tail codes, order by descending popularity
- Throws:
DAOException- if a JDBC error occurs
-
getByDate
Returns all Flight Reports flown on a certain date.- Parameters:
dt- the date- Returns:
- a List of FlightReports
- Throws:
DAOException- if a JDBC error occurs
-
getBySDK
Returns alll Flight Reports logged using a specific aircraft SDK.- Parameters:
sdkName- the SDK name- Returns:
- a List of FlightReports
- Throws:
DAOException- if a JDBC error occurs
-
getByPilot
Returns all Flight Reports for a particular Pilot, using a sort column.- Parameters:
id- the Pilot database IDorderBy- the sort column (or null)- Returns:
- a List of FlightReports
- Throws:
DAOException- if a JDBC error occurs
-
checkDupes
Checks for duplicate ACARS flight submissions.- Parameters:
dbName- the database namef- the Flight informationpilotID- the Pilot's database ID- Returns:
- a List of FlightReport beans
- Throws:
DAOException- if a JDBC error occurs
-
checkDupes
Checks for duplicate ACARS flight submisions.- Parameters:
dbName- the database nameacarsID- the ACARS flight ID- Returns:
- a List of FlightReport beans
- Throws:
DAOException- if a JDBC error occurs
-