org.deltava.beans.academy
Class AcademyHistoryHelper

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

public class AcademyHistoryHelper
extends Object

A utility class to extract information from a user's Flight Academy history.

Since:
1.0
Version:
3.0
Author:
Luke

Constructor Summary
AcademyHistoryHelper(Collection<Course> courses, Collection<Certification> allCerts)
          Initializes the helper.
 
Method Summary
 void addExams(Collection<Test> tests)
          Adds the Pilot's Flight Academy examinations and checkrides.
 boolean canTake(Certification c)
          Returns if the user is eligible to take a particular Flight Academy Course.
 boolean canWrite(ExamProfile ep)
          Rerturns if the user is eligible to write a particular examination.
 Collection<Certification> getCertifications()
          Returns all Certifications.
 Collection<Course> getCourses()
          Returns the Pilot's courses.
 Course getCurrentCourse()
          Returns the Course that the Pilot is currently enrolled in
 Collection<Test> getExams()
          Returns the Pilot's examinations.
 boolean hasAll(int stage)
          Returns whether a Pilot has completed all certifications in a particular stage.
 boolean hasAny(int stage)
          Returns whether a Pilot has completed a certification in a particular stage.
 boolean hasCompleted(String certName)
          Returns whether a Pilot has completed the requirements for a Flight Academy certifcation.
 boolean hasPassed(String certName)
          Returns whether a Pilot has completed a particular certification.
 boolean hasSubmitted(String examName)
          Returns if a user has submitted a particular Examination.
 boolean isLockedOut(int lockoutHours)
          Returns if the user is locked out of the Testing Center due to a failed examination.
 boolean isPending(String certName)
          Returns whether a Pilot has started a particular course.
 boolean passedExam(String examName)
          Returns whether a Pilot has passed a particular Examination.
 void setAllowInactive(boolean doInactive)
          Toggles whether the user can enroll in Inactive Courses.
 void setDebug(boolean isDebug)
          Toggles the debugging log.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AcademyHistoryHelper

public AcademyHistoryHelper(Collection<Course> courses,
                            Collection<Certification> allCerts)
Initializes the helper.

Parameters:
courses - a Collection of course objects, representing this Pilot's Flight Academy history
allCerts - all available Certifications
Method Detail

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

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

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

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


Copyright © 2004-2009 Global Virtual Airlines Group. All Rights Reserved.