Class SetFlightReport

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

public class SetFlightReport extends DAO
A Data Access object to write Flight Reports to the database.
Since:
1.0
Version:
11.6
Author:
Luke
  • Constructor Details

    • SetFlightReport

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

    • delete

      public void delete(int id) throws DAOException
      Deletes a Flight Report from the database.
      Parameters:
      id - the Flight Report database ID
      Throws:
      DAOException - if a JDBC error occurs
    • deleteACARS

      public boolean deleteACARS(int id) throws DAOException
      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

      public boolean deleteElite(FlightReport fr) throws DAOException
      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 name
      usr - the Person updating the Flight Report
      pirep - the Flight Report
      status - the new FlightStatus
      Throws:
      DAOException - if a JDBC error occurs
      NullPointerException - if pirep is null
    • withdraw

      public void withdraw(FlightReport fr, String db) throws DAOException
      Marks a Flight Report as widhrdawn.
      Parameters:
      fr - the FlightReport
      db - the database name
      Throws:
      DAOException - if a JDBC error occurs
    • clearPromoEQ

      public void clearPromoEQ(int id) throws DAOException
      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

      public void setPromoEQ(int id, Collection<String> eqTypes) throws DAOException
      Sets whether a Flight Report counts towards promotion to Captain.
      Parameters:
      id - the Flight Report database ID
      eqTypes -
      Throws:
      DAOException - if a JDBC error occurs
    • writeComments

      public void writeComments(FlightReport fr) throws DAOException
      Updates Flight Report comments.
      Parameters:
      fr - the FlightReport bean
      Throws:
      DAOException - if a JDBC error occurs
    • updateLandingScore

      public void updateLandingScore(int pirepID, double score) throws DAOException
      Updates a Flight Report's landing score.
      Parameters:
      pirepID - the Flight Report database ID
      score - the landing score
      Throws:
      DAOException - if a JDBC error occurs
    • updatePaxCount

      public boolean updatePaxCount(int pirepID) throws DAOException
      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

      public boolean updatePaxCount(int pirepID, UserData ud) throws DAOException
      Updates passenger count based on load factor.
      Parameters:
      pirepID - the Flight Report database ID
      ud - the Pilot's UserData object
      Returns:
      TRUE if the passenger count was updated, otherwise FALSE
      Throws:
      DAOException - if a JDBC error occurs
    • writeSimBrief

      public void writeSimBrief(BriefingPackage sb) throws DAOException
      Writes SimBrief dispatch data to the database.
      Parameters:
      sb - the SimBrief package
      Throws:
      DAOException - if a JDBC error occurs
    • writeElite

      public void writeElite(FlightEliteScore sc, String dbName) throws DAOException
      Writes Elite program scores to the database.
      Parameters:
      sc - the FlightEliteScore
      dbName - the database name
      Throws:
      DAOException - if a JDBC error occurs
    • write

      public void write(FlightReport fr) throws DAOException
      Write a Flight Report to the default database.
      Parameters:
      fr - the Flight Report
      Throws:
      DAOException - if a JDBC error occurs
    • write

      public void write(FlightReport fr, String db) throws DAOException
      Writes a Flight Report to the database.
      Parameters:
      fr - the Flight Report
      db - the Database to write to
      Throws:
      DAOException - if a JDBC error occurs
    • writeACARS

      public void writeACARS(FDRFlightReport fr, String dbName) throws DAOException
      Writes an ACARS-enabled Flight Report into the database. This can handle INSERT and UPDATE operations.
      Parameters:
      fr - the Flight Report
      dbName - the database name
      Throws:
      DAOException - if a JDBC error occurs
    • writeHistory

      public void writeHistory(Collection<FlightHistoryEntry> upds, String dbName) throws DAOException
      Writes a Flight Report's status updates to the database.
      Parameters:
      upds - a Collection of FlightHistoryEntry beans
      dbName - the database name
      Throws:
      DAOException - if a JDBC error occurs