Class SetFlightReport
java.lang.Object
org.deltava.dao.DAO
org.deltava.dao.SetFlightReport
A Data Access object to write Flight Reports to the database.
- Since:
- 1.0
- Version:
- 11.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 TypeMethodDescriptionvoid
clearPromoEQ
(int id) Clears whether a Flight Report counts towards promotion to Captain.void
delete
(int id) Deletes a Flight Report from the database.boolean
deleteACARS
(int id) Deletes ACARS flight data from the database.boolean
Deletes Elite program Flight Report data from the database.void
dispose
(String db, Person usr, FlightReport pirep, FlightStatus status) Disposes of a Flight Report, by setting its status to Approved, Rejected or Held.void
setPromoEQ
(int id, Collection<String> eqTypes) Sets whether a Flight Report counts towards promotion to Captain.void
updateLandingScore
(int pirepID, double score) Updates a Flight Report's landing score.boolean
updatePaxCount
(int pirepID) Updates passenger count for a flight report in the current airline.boolean
updatePaxCount
(int pirepID, UserData ud) Updates passenger count based on load factor.void
withdraw
(FlightReport fr, String db) Marks a Flight Report as widhrdawn.void
write
(FlightReport fr) Write a Flight Report to the default database.void
write
(FlightReport fr, String db) Writes a Flight Report to the database.void
writeACARS
(FDRFlightReport fr, String dbName) Writes an ACARS-enabled Flight Report into the database.void
Updates Flight Report comments.void
writeElite
(FlightEliteScore sc, String dbName) Writes Elite program scores to the database.void
writeHistory
(Collection<FlightHistoryEntry> upds, String dbName) Writes a Flight Report's status updates to the database.void
Writes SimBrief dispatch data to the database.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
-
SetFlightReport
Initialize the Data Access Object.- Parameters:
c
- the JDBC connection to use
-
-
Method Details
-
delete
Deletes a Flight Report from the database.- Parameters:
id
- the Flight Report database ID- Throws:
DAOException
- if a JDBC error occurs
-
deleteACARS
Deletes ACARS flight data from the database.- Parameters:
id
- the Flight Report database ID- Returns:
- TRUE if a record was deleted, otherwise FALSE
- Throws:
DAOException
- if a JDBC error occurs
-
deleteElite
Deletes Elite program Flight Report data from the database.- Parameters:
fr
- the FlightReport- Returns:
- TRUE if a record was deleted, otherwise FALSE
- Throws:
DAOException
- if a JDBC error occurs
-
dispose
public void dispose(String db, Person usr, FlightReport pirep, FlightStatus status) throws DAOException Disposes of a Flight Report, by setting its status to Approved, Rejected or Held.- Parameters:
db
- the database nameusr
- the Person updating the Flight Reportpirep
- the Flight Reportstatus
- the new FlightStatus- Throws:
DAOException
- if a JDBC error occursNullPointerException
- if pirep is null
-
withdraw
Marks a Flight Report as widhrdawn.- Parameters:
fr
- the FlightReportdb
- the database name- Throws:
DAOException
- if a JDBC error occurs
-
clearPromoEQ
Clears whether a Flight Report counts towards promotion to Captain.- Parameters:
id
- the Flight Report database ID- Throws:
DAOException
- if a JDBC error occurs
-
setPromoEQ
Sets whether a Flight Report counts towards promotion to Captain.- Parameters:
id
- the Flight Report database IDeqTypes
-- Throws:
DAOException
- if a JDBC error occurs
-
writeComments
Updates Flight Report comments.- Parameters:
fr
- the FlightReport bean- Throws:
DAOException
- if a JDBC error occurs
-
updateLandingScore
Updates a Flight Report's landing score.- Parameters:
pirepID
- the Flight Report database IDscore
- the landing score- Throws:
DAOException
- if a JDBC error occurs
-
updatePaxCount
Updates passenger count for a flight report in the current airline.- Parameters:
pirepID
- the Flight Report database ID- Returns:
- TRUE if the passenger count was updated, otherwise FALSE
- Throws:
DAOException
- if a JDBC error occurs
-
updatePaxCount
Updates passenger count based on load factor.- Parameters:
pirepID
- the Flight Report database IDud
- the Pilot's UserData object- Returns:
- TRUE if the passenger count was updated, otherwise FALSE
- Throws:
DAOException
- if a JDBC error occurs
-
writeSimBrief
Writes SimBrief dispatch data to the database.- Parameters:
sb
- the SimBrief package- Throws:
DAOException
- if a JDBC error occurs
-
writeElite
Writes Elite program scores to the database.- Parameters:
sc
- the FlightEliteScoredbName
- the database name- Throws:
DAOException
- if a JDBC error occurs
-
write
Write a Flight Report to the default database.- Parameters:
fr
- the Flight Report- Throws:
DAOException
- if a JDBC error occurs
-
write
Writes a Flight Report to the database.- Parameters:
fr
- the Flight Reportdb
- the Database to write to- Throws:
DAOException
- if a JDBC error occurs
-
writeACARS
Writes an ACARS-enabled Flight Report into the database. This can handle INSERT and UPDATE operations.- Parameters:
fr
- the Flight ReportdbName
- the database name- Throws:
DAOException
- if a JDBC error occurs
-
writeHistory
Writes a Flight Report's status updates to the database.- Parameters:
upds
- a Collection of FlightHistoryEntry beansdbName
- the database name- Throws:
DAOException
- if a JDBC error occurs
-