Class AcademyHistoryHelper

java.lang.Object
org.deltava.beans.academy.AcademyHistoryHelper

public final class AcademyHistoryHelper extends Object
A utility class to extract information from a user's Flight Academy history.
Since:
1.0
Version:
11.4
Author:
Luke
  • Constructor Details

    • AcademyHistoryHelper

      public AcademyHistoryHelper(Pilot p, Collection<Course> courses, Collection<Certification> allCerts)
      Initializes the helper.
      Parameters:
      p - the Pilot
      courses - a Collection of course objects, representing this Pilot's Flight Academy history
      allCerts - all available Certifications
  • Method Details

    • setDebug

      public void setDebug(boolean isDebug)
      Toggles the debugging log.
      Parameters:
      isDebug - TRUE if the log is active, otherwise FALSE
    • setAllowInactive

      public void setAllowInactive(boolean doInactive)
      Toggles whether the user can enroll in Inactive Courses.
      Parameters:
      doInactive - TRUE if the usre can enroll in Inactive Courses, otherwise FALSE
    • getExams

      public Collection<Test> getExams()
      Returns the Pilot's examinations. This method is useful when we use this class and do not wish to call the GetExam DAO a second time.
      Returns:
      a Collection of Test beans
    • getCertification

      public Certification getCertification(String code)
      Retrieves a Certification. This method is useful when we use this class and do not wish to call the GetAcademyCertifications DAO a second time.
      Parameters:
      code - the certification name or code
      Returns:
      a Certification, or null if not found
    • getCertifications

      public Collection<Certification> getCertifications()
      Returns all Certifications. This method is useful when we use this class and do not wish to call the GetAcademyCertifications DAO a second time.
      Returns:
      a Collection of Certification beans
    • getCourses

      public Collection<Course> getCourses()
      Returns the Pilot's courses. This method is useful when we use this class and do not wish to call the GetAcademyCourses DAO a second time.
      Returns:
      a Collection of Course beans
    • addExams

      public void addExams(Collection<Test> tests)
      Adds the Pilot's Flight Academy examinations and checkrides. Any others will not be added.
      Parameters:
      tests - a Collection of checkride/examination objects, representing this Pilot's exam history
    • addFlights

      public void addFlights(Collection<FlightReport> flights)
      Adds the Pilot's approved flight reports. Only flights logged using a Flight Data Recorder (ACARS/XACARS/simFDR) will be added.
      Parameters:
      flights - a Collection of FlightReport beans
    • addPrimaryRatings

      public void addPrimaryRatings(EquipmentType eq)
      Adds primary equipment types for a particular equipment program.
      Parameters:
      eq - the EquipmentType
    • hasPassed

      public boolean hasPassed(String certName)
      Returns whether a Pilot has completed a particular certification.
      Parameters:
      certName - the Certification name
      Returns:
      TRUE if the Certification was passed, otherwise FALSE
    • isPending

      public boolean isPending(String certName)
      Returns whether a Pilot has started a particular course.
      Parameters:
      certName - the Certification name
      Returns:
      TRUE if a course entry exists and was not pased, otherwise FALSE
    • hasSubmitted

      public boolean hasSubmitted(String examName)
      Returns if a user has submitted a particular Examination.
      Parameters:
      examName - the Examination name
      Returns:
      TRUE if the user has submitted this Examination, otherwise FALSE
    • getCurrentCourse

      public Course getCurrentCourse()
      Returns the Course that the Pilot is currently enrolled in
      Returns:
      a Course bean, or null
    • getCourse

      public Course getCourse(int id)
      Retrieves a specific Course from the history.
      Parameters:
      id - the Course database ID
      Returns:
      a Course, or null if not found
    • hasAny

      public boolean hasAny(int stage)
      Returns whether a Pilot has completed a certification in a particular stage.
      Parameters:
      stage - the stage number
      Returns:
      TRUE if any Certification was passed, otherwise FALSE
    • passedExam

      public boolean passedExam(String examName)
      Returns whether a Pilot has passed a particular Examination.
      Parameters:
      examName - the Examination name
      Returns:
      TRUE if the examination has been passed, otherwise FALSE
    • hasCompleted

      public boolean hasCompleted(String certName)
      Returns whether a Pilot has completed the requirements for a Flight Academy certifcation.
      Parameters:
      certName - the Certification name
      Returns:
      TRUE if the certification has been granted or can be, otherwise FALSE
    • hasAll

      public boolean hasAll(int stage)
      Returns whether a Pilot has completed all certifications in a particular stage.
      Parameters:
      stage - the stage number
      Returns:
      TRUE if all Certification were passed, otherwise FALSE
    • canTake

      public boolean canTake(Certification c)
      Returns if the user is eligible to take a particular Flight Academy Course.
      Parameters:
      c - the Certification to take
      Returns:
      TRUE if the user can take the Course, otherwise FALSE
    • canWrite

      public boolean canWrite(ExamProfile ep)
      Rerturns if the user is eligible to write a particular examination.
      Parameters:
      ep - the ExamProfile bean
      Returns:
      TRUE if the exam can be taken, othewise FALSE
    • isLockedOut

      public boolean isLockedOut(int lockoutHours)
      Returns if the user is locked out of the Testing Center due to a failed examination.
      Parameters:
      lockoutHours - the number of hours to remain locked out, or zero if no lockout
      Returns:
      TRUE if the user is locked out, otherwise FALSE
    • getFlightTotals

      public int getFlightTotals(String eqProgram, boolean isHours)
      Returns the number of flight legs or hours flown using the primary equipment type of a particular equipment program.
      Parameters:
      eqProgram - the equipment type eprogram
      isHours - TRUE if returning hours, otherwise flight legs
      Returns:
      the number of flight legs or hours