Class GetExam

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

public class GetExam extends DAO
A Data Access Object for loading Examination/Check Ride data.
Since:
1.0
Version:
11.2
Author:
Luke
  • Constructor Details

    • GetExam

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

    • getExam

      public Examination getExam(int id) throws DAOException
      Loads a Pilot Examination.
      Parameters:
      id - the Database ID
      Returns:
      the Examination, or null if not found
      Throws:
      DAOException - if a JDBC error occurs
    • getCheckRide

      public CheckRide getCheckRide(int id) throws DAOException
      Loads a Pilot Check Ride.
      Parameters:
      id - the Database ID
      Returns:
      the CheckRide, or null if not found
      Throws:
      DAOException - if a JDBC error occurs
    • getACARSCheckRide

      public CheckRide getACARSCheckRide(int acarsID) throws DAOException
      Loads a Pilot Check Ride associated with a particular ACARS Flight ID.
      Parameters:
      acarsID - the ACARS flight ID
      Returns:
      a CheckRide, or null if not found
      Throws:
      DAOException - if a JDBC error occurs
    • getAcademyCheckRides

      public List<CheckRide> getAcademyCheckRides(int courseID) throws DAOException
      Loads all Check Rides for a particular Flight Academy Course.
      Parameters:
      courseID - the Course database ID
      Returns:
      a List of CheckRide beans
      Throws:
      DAOException - if a JDBC error occurs
    • getAcademyCheckRides

      public List<CheckRide> getAcademyCheckRides(int courseID, TestStatus status) throws DAOException
      Loads all Check Rides for a particular Flight Academy Course.
      Parameters:
      courseID - the Course database ID
      status - the CheckRide status, or null for all
      Returns:
      a List of CheckRide beans
      Throws:
      DAOException - if a JDBC error occurs
    • getCheckRide

      public CheckRide getCheckRide(int pilotID, String eqType, TestStatus status) throws DAOException
      Loads a pending Pilot Check Ride for a particular equipment type.
      Parameters:
      pilotID - the Pilot Database ID
      eqType - the equipment type used
      status - the CheckRide status
      Returns:
      a CheckRide, or null if not found
      Throws:
      DAOException - if a JDBC error occurs
    • getCheckRides

      public List<CheckRide> getCheckRides(int pilotID) throws DAOException
      Loads all Check Rides for a particular Pilot.
      Parameters:
      pilotID - the pilot Database ID
      Returns:
      a List of CheckRide beans
      Throws:
      DAOException - if a JDBC error occurs
    • getSubmittedRides

      public List<CheckRide> getSubmittedRides() throws DAOException
      Returns all unsubmitted Check Rides for the current airline.
      Returns:
      a List of CheckRide beans
      Throws:
      DAOException - if a JDBC error occurs
    • getPendingRides

      public List<CheckRide> getPendingRides(int days, RideType rt) throws DAOException
      Returns all unsubmitted Check Rides older than a certain date.
      Parameters:
      days - the number of days
      rt - a RideType
      Returns:
      a List of CheckRide beans
      Throws:
      DAOException - if a JDBC error occurs
    • getCheckRideQueue

      public Collection<CheckRide> getCheckRideQueue(boolean isAcademy) throws DAOException
      Returns all submitted Check Rides for the current airline or the Flight Academy.
      Parameters:
      isAcademy - TRUE if listing Flight Academy Check Rides, otherwise FALSE
      Returns:
      a Collection of CheckRide beans
      Throws:
      DAOException - if a JDBC error occurs
    • getExams

      public List<Test> getExams(int id) throws DAOException
      Loads all examinations and check rides for a particular Pilot.
      Parameters:
      id - the Pilot's Database ID
      Returns:
      a List of Tests
      Throws:
      DAOException - if a JDBC error occurs
    • getAutoScored

      public Collection<Examination> getAutoScored(String examName) throws DAOException
      Returns automatically scored Examiantions.
      Parameters:
      examName - the Examination name, or null if all requested
      Returns:
      a Collection of Examination beans
      Throws:
      DAOException - if a JDBC error occurs
    • getAutoScoredExamNames

      public Collection<String> getAutoScoredExamNames() throws DAOException
      Returns the names of all automatically scored examinations.
      Returns:
      a Collection of Examination names
      Throws:
      DAOException - if a JDBC error occurs
    • getQuestionnaires

      public Map<Integer, Examination> getQuestionnaires(Collection<Integer> ids) throws DAOException
      Returns all Initial Questionnaires for hired Pilots.
      Parameters:
      ids - a Collection of Pilot database IDs
      Returns:
      a Map of Examination beans keyed by Pilot ID
      Throws:
      DAOException - if a JDBC error occurs
    • getSubmitted

      public List<Examination> getSubmitted() throws DAOException
      Loads all submitted Examinations.
      Returns:
      a List of Examinations
      Throws:
      DAOException - if a JDBC error occurs
    • getActiveExam

      public int getActiveExam(int id) throws DAOException
      Checks if a Pilot has an Examination open or awaiting scoring.
      Parameters:
      id - the Pilot's database ID
      Returns:
      TRUE if an Examination is in NEW or SUBMITTED status
      Throws:
      DAOException - if a JDBC error occurs
    • getExamTimes

      public Tuple<Integer,Integer> getExamTimes(boolean isAcademy) throws DAOException
      Returns the minimum and maximum time available to take Examinations.
      Parameters:
      isAcademy - TRUE for Flight Academy examinations, FALSE for non-Academy
      Returns:
      a Tuple with the minimum and maximum times, in minutes
      Throws:
      DAOException - if a JDBC error occurs