Class GetApplicant
java.lang.Object
org.deltava.dao.DAO
org.deltava.dao.GetApplicant
- All Implemented Interfaces:
PersonUniquenessDAO
A Data Access Object to read Applicant data.
- Since:
- 1.0
- Version:
- 11.1
- Author:
- Luke
-
Field Summary
Fields inherited from class org.deltava.dao.DAO
_queryMax, _queryStart, _queryTimeout, WGS84_SRID
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncheckAddress
(IPBlock addrBlock, String dbName) Searches for Applicants registering from the same TCP/IP network.checkSoundex
(Person usr, String dbName) Performs a soundex search on a Person's last name to detect possible matches.checkUnique
(Person p, String dbName) Checks if an Applicant is unique, by checking the first/last names and the e-mail address.checkUnique
(Person p, String dbName, int days) Checks if an Applicant is unique, by checking the first/last names and the e-mail address.get
(int id) Loads an Applicant from the database.Returns an Applicant object which may be in another Airline's database.get
(UserDataMap udm) Returns Applicant objects which may be in another Airline's database.getAutoRejected
(int hours) Retrieves Applicants automatically rejected more than a particular number of hours ago.getByEquipmentType
(String eqType) Returns all Applicants hired into a particular equipment program.getByID
(Collection<?> ids, String tableName) Returns a Map of applicant based on a group of database IDs.getByLetter
(String letter) Returns Applicants whose last name begins with a particular letter.Searches for pending Applicants by first/last name.getByPilotID
(int pilotID) Loads an Applicant record for an existing Pilot from the database.getByStatus
(ApplicantStatus status, String orderBy) Returns all Applicants with a particular status.getFromDirectory
(String directoryName) Loads an applicant based on a directory name.boolean
isIPRegistered
(String addr, int days) Checks if this IP address had been used to register in the past few days.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
-
GetApplicant
Initialize the Data Access Object.- Parameters:
c
- the JDBC connection to use
-
-
Method Details
-
get
Loads an Applicant from the database.- Parameters:
id
- the Applicant's database ID- Returns:
- an Applicant, or null if not found
- Throws:
DAOException
- if a JDBC error occurs
-
getByName
Searches for pending Applicants by first/last name.- Parameters:
fName
- the first namelName
- the last name- Returns:
- a Collection of Applicants
- Throws:
DAOException
- if a JDBC error occurs
-
getByPilotID
Loads an Applicant record for an existing Pilot from the database.- Parameters:
pilotID
- the database ID of the Applicant's Pilot record- Returns:
- an Applicant, or null if not found
- Throws:
DAOException
- if a JDBC error occurs
-
getByID
Returns a Map of applicant based on a group of database IDs. This is typically called by a Water Cooler thread/channel list command.- Parameters:
ids
- a Collection of database IDs. These can either be Integers, orUserData
beanstableName
- the table to read from, in DATABASE.TABLE format for a remote database, or TABLE for a table in the current airline's database.- Returns:
- a Map of Applicants, indexed by the pilot code
- Throws:
DAOException
- if a JDBC error occurs
-
get
Returns an Applicant object which may be in another Airline's database.- Parameters:
ud
- the UserData bean containg the Applicant location- Returns:
- the Applicant bean, or null if not found
- Throws:
DAOException
- if a JDBC error occurs
-
get
Returns Applicant objects which may be in another Airline's database.- Specified by:
get
in interfacePersonUniquenessDAO
- Parameters:
udm
- the UserDataMap bean containg the Pilot locations- Returns:
- a Map of Pilots indexed by database ID
- Throws:
DAOException
- if a JDBC error occurs
-
getFromDirectory
Loads an applicant based on a directory name.- Parameters:
directoryName
- the directory name.- Returns:
- an Applicant, or null if not found
- Throws:
DAOException
- if a JDBC error occurs
-
getByLetter
Returns Applicants whose last name begins with a particular letter.- Parameters:
letter
- the first Letter of the last name- Returns:
- a List of Applicants
- Throws:
DAOException
- if a JDBC error occursIllegalArgumentException
- if letter isn't a letter according toCharacter.isLetter(char)
NullPointerException
- if letter is null
-
getByStatus
Returns all Applicants with a particular status.- Parameters:
status
- the ApplicantStatusorderBy
- the sort column- Returns:
- a List of Applicants
- Throws:
DAOException
- if a JDBC error occurs
-
getByEquipmentType
Returns all Applicants hired into a particular equipment program.- Parameters:
eqType
- the equipment program code- Returns:
- a List of Applicants
- Throws:
DAOException
- if a JDBC error occurs
-
isIPRegistered
Checks if this IP address had been used to register in the past few days.- Parameters:
addr
- the IP addressdays
- the number of days to check- Returns:
- TRUE if the IP address was used, otherwise FALSE
- Throws:
DAOException
- if a JDBC error occurs
-
checkUnique
Checks if an Applicant is unique, by checking the first/last names and the e-mail address. This will not return a match against rejected Applicants.- Specified by:
checkUnique
in interfacePersonUniquenessDAO
- Parameters:
p
- the PersondbName
- the database to search- Returns:
- a Collection of database IDs
- Throws:
DAOException
- if a JDBC error occurs
-
checkUnique
Checks if an Applicant is unique, by checking the first/last names and the e-mail address. This will not return a match against rejected Applicants.- Specified by:
checkUnique
in interfacePersonUniquenessDAO
- Parameters:
p
- the PersondbName
- the database to searchdays
- restrict uniqueness search to users created in the last number of days, or -1 for all- Returns:
- a Collection of database IDs
- Throws:
DAOException
- if a JDBC error occurs
-
checkAddress
Searches for Applicants registering from the same TCP/IP network. If the Applicant has been hired, this will return the Pilot database ID, instead of the Applicant database ID.- Parameters:
addrBlock
- the network blockdbName
- the database name- Returns:
- a Collection of Database IDs as Integers
- Throws:
DAOException
- if a JDBC error occurs
-
checkSoundex
Performs a soundex search on a Person's last name to detect possible matches. The soundex implementation is dependent on the capabilities of the underlying database engine, and is not guaranteed to be consistent (or even supported) across different database servers.- Specified by:
checkSoundex
in interfacePersonUniquenessDAO
- Parameters:
usr
- the Person to check fordbName
- the database name- Returns:
- a Collection of Database IDs as Integers
- Throws:
DAOException
- if a JDBC error occurs
-
getAutoRejected
Retrieves Applicants automatically rejected more than a particular number of hours ago.- Parameters:
hours
- the number of hours ago- Returns:
- a Collection of Applicants
- Throws:
DAOException
- if a JDBC error occurs
-