org.deltava.beans
Class Applicant

java.lang.Object
  extended by org.deltava.beans.DatabaseBean
      extended by org.deltava.beans.DatabaseBlobBean
          extended by org.deltava.beans.Person
              extended by org.deltava.beans.Applicant
All Implemented Interfaces:
Serializable, Comparable<Object>, Principal, EMailAddress, ViewEntry, Cacheable

public class Applicant
extends Person

A class for storing Applicant entries.

Since:
1.0
Version:
2.6
Author:
Luke
See Also:
Serialized Form

Field Summary
static int APPROVED
           
static String[] FSVERSION
          Valid Flight Simulator version strings.
static int[] FSVERSION_CODE
          Valid Flight Simulator version values.
static int PENDING
           
static int REJECTED
           
static String ROLE
          The only security role an Applicant can belong to
static String[] STATUS
          Valid applicant statuses
 
Fields inherited from class org.deltava.beans.Person
_networkIDs, _notifyOptions, AUTH_EMAIL, DISTANCE_KM, DISTANCE_MI, DISTANCE_NAMES, DISTANCE_NM, EVENT, FLEET, HIDE_EMAIL, NEWS, NOTIFY_CODES, NOTIFY_NAMES, PIREP, SHOW_EMAIL
 
Fields inherited from class org.deltava.beans.DatabaseBlobBean
_buffer
 
Fields inherited from interface org.deltava.beans.EMailAddress
INVALID_ADDR, VALID_ADDR_REGEXP
 
Constructor Summary
Applicant(String firstName, String lastName)
          Create an Applicant object with a given first and last name, converted to "proper case".
 
Method Summary
 void addRole(String roleName)
          Add a security role to an Applicant
 String getComments()
          Returns any additional Applicant comments.
 String getHRComments()
          Returns any HR comments.
 String getLegacyURL()
          Returns the URL for legacy hours verification.
 boolean getLegacyVerified()
          Returns legacy hours verification status.
 int getPilotID()
          Returns the Database ID of this Applicant's Pilot record.
 String getRegisterAddress()
          Returns the address this Applicant registered from.
 String getRegisterHostName()
          Returns the host name this Applicant registered from.
 Collection<String> getRoles()
          Returns the security roles this Applicant belongs to.
 String getRowClassName()
          Selects a table row class based upon the Applicant's status.
 int getSimVersion()
          The Flight Simulator version preferred by this Applicant.
 String getSimVersionCode()
          The Flight Simulator version code preferred by this Applicant.
 String getStatusName()
          Returns the status name.
 Map<Long,String> getTypeChoices()
          Returns the stage equipment type choices.
 boolean isInRole(String roleName)
          Queries this applicant's role.
 void setComments(String comments)
          Updates the Applicant comments.
 void setHRComments(String comments)
          Updates the HR comments.
 void setLegacyURL(String url)
          Sets the URL for legacy hours verification
 void setLegacyVerified(boolean verified)
          Sets the legacy hours verification flag.
 void setPilotID(int pilotID)
          Updates the Database ID of this Applicant's Pilot record.
 void setRegisterAddress(String addr)
          Sets the remote address this Applicant registered from.
 void setRegisterHostName(String hostName)
          Sets the host name this Applicant registered from.
 void setSimVersion(int version)
          Set the Flight Simulator version used by this Applicant.
 void setSimVersion(String version)
          Set the Flight Simulator version used by this Applicant.
 void setStatus(int status)
          Sets the Applicant's status.
 void setTypeChoice(int stage, String eqName)
          Sets the preferred equipment program for a stage.
 
Methods inherited from class org.deltava.beans.Person
getAirportCodeType, getAirportCodeTypeName, getCreatedOn, getDateFormat, getDistanceType, getDistanceTypeName, getDN, getEmail, getEmailAccess, getEmailDomain, getEquipmentType, getFirstName, getHomeAirport, getIMHandle, getIMHandle, getIMServices, getLastLogin, getLastLogoff, getLastName, getLegacyHours, getLocation, getLoginCount, getLoginHost, getName, getNetworkID, getNetworks, getNotifyOption, getNotifyOptions, getNumberFormat, getPassword, getRank, getStatus, getTimeFormat, getTZ, getUIScheme, getViewCount, hasNetworkID, setAirportCodeType, setAirportCodeType, setCreatedOn, setDateFormat, setDistanceType, setDistanceType, setDN, setEmail, setEmailAccess, setEquipmentType, setFirstName, setHomeAirport, setIMHandle, setLastLogin, setLastLogoff, setLastName, setLegacyHours, setLocation, setLoginCount, setLoginHost, setNetworkID, setNotifyOption, setNumberFormat, setPassword, setRank, setTimeFormat, setTZ, setUIScheme, setViewCount, toString
 
Methods inherited from class org.deltava.beans.DatabaseBlobBean
clear, getInputStream, getSize, isLoaded, load, load
 
Methods inherited from class org.deltava.beans.DatabaseBean
cacheKey, compareTo, equals, getHexID, getID, hashCode, setID, validateID
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.security.Principal
equals, hashCode
 

Field Detail

PENDING

public static final int PENDING
See Also:
Constant Field Values

APPROVED

public static final int APPROVED
See Also:
Constant Field Values

REJECTED

public static final int REJECTED
See Also:
Constant Field Values

STATUS

public static final String[] STATUS
Valid applicant statuses


ROLE

public static final String ROLE
The only security role an Applicant can belong to

See Also:
Constant Field Values

FSVERSION

public static final String[] FSVERSION
Valid Flight Simulator version strings.


FSVERSION_CODE

public static final int[] FSVERSION_CODE
Valid Flight Simulator version values.

Constructor Detail

Applicant

public Applicant(String firstName,
                 String lastName)
Create an Applicant object with a given first and last name, converted to "proper case".

Parameters:
firstName - the Applicant's first (given) name
lastName - the Applicant's last (family) name
Throws:
NullPointerException - if either name is null
See Also:
StringUtils.properCase(String)
Method Detail

getStatusName

public String getStatusName()
Returns the status name.

Specified by:
getStatusName in class Person
Returns:
"Applicant"
See Also:
Person.getStatus(), Person.setStatus(int)

getLegacyURL

public String getLegacyURL()
Returns the URL for legacy hours verification.

Returns:
the URL for legacy hours verification, null if not available
See Also:
setLegacyURL(String)

getLegacyVerified

public boolean getLegacyVerified()
Returns legacy hours verification status.

Returns:
TRUE if legacy hours have been verified
See Also:
setLegacyVerified(boolean)

getPilotID

public int getPilotID()
Returns the Database ID of this Applicant's Pilot record.

Returns:
the Database ID if hired as a Pilot
See Also:
setPilotID(int)

getComments

public String getComments()
Returns any additional Applicant comments.

Returns:
the comments
See Also:
setComments(String), getHRComments()

getHRComments

public String getHRComments()
Returns any HR comments.

Returns:
the comments
See Also:
setHRComments(String), getComments()

getRegisterHostName

public String getRegisterHostName()
Returns the host name this Applicant registered from.

Returns:
the host name
See Also:
setRegisterHostName(String), getRegisterAddress()

getRegisterAddress

public String getRegisterAddress()
Returns the address this Applicant registered from.

Returns:
the IP address
See Also:
setRegisterAddress(String), getRegisterHostName()

getSimVersion

public int getSimVersion()
The Flight Simulator version preferred by this Applicant.

Returns:
the version number
See Also:
getSimVersionCode(), setSimVersion(int), setSimVersion(String)

getSimVersionCode

public String getSimVersionCode()
The Flight Simulator version code preferred by this Applicant.

Returns:
the version code
See Also:
getSimVersion(), setSimVersion(String), setSimVersion(int)

setLegacyURL

public void setLegacyURL(String url)
Sets the URL for legacy hours verification

Parameters:
url - the URL for legacy hours verification
See Also:
getLegacyURL()

setLegacyVerified

public void setLegacyVerified(boolean verified)
Sets the legacy hours verification flag.

Parameters:
verified - TRUE if hours have been verified, FALSE otherwise
See Also:
getLegacyVerified()

setTypeChoice

public void setTypeChoice(int stage,
                          String eqName)
Sets the preferred equipment program for a stage.

Parameters:
stage - the stage number
eqName - the equipment program

setSimVersion

public void setSimVersion(int version)
Set the Flight Simulator version used by this Applicant.

Parameters:
version - the Flight Simulator version as found in FSVERSION
Throws:
IllegalArgumentException - if the version cannot be found
See Also:
setSimVersion(String), getSimVersion()

setSimVersion

public void setSimVersion(String version)
Set the Flight Simulator version used by this Applicant.

Parameters:
version - the Flight Simulator version as found in FSVERSION
Throws:
IllegalArgumentException - if the version cannot be found
See Also:
setSimVersion(int), getSimVersion()

setRegisterHostName

public void setRegisterHostName(String hostName)
Sets the host name this Applicant registered from.

Parameters:
hostName - the host name
See Also:
getRegisterHostName(), setRegisterAddress(String)

setRegisterAddress

public void setRegisterAddress(String addr)
Sets the remote address this Applicant registered from.

Parameters:
addr - the IP address
See Also:
getRegisterAddress(), setRegisterHostName(String)

setComments

public void setComments(String comments)
Updates the Applicant comments.

Parameters:
comments - the comments
See Also:
getComments(), setHRComments(String)

setHRComments

public void setHRComments(String comments)
Updates the HR comments.

Parameters:
comments - the comments
See Also:
getHRComments(), setComments(String)

setPilotID

public void setPilotID(int pilotID)
Updates the Database ID of this Applicant's Pilot record.

Parameters:
pilotID - the database ID, if hired as a Pilot
Throws:
IllegalArgumentException - if pilotID is negative
IllegalStateException - if the Applicant has not been Approved
See Also:
getPilotID()

setStatus

public final void setStatus(int status)
Sets the Applicant's status.

Overrides:
setStatus in class Person
Parameters:
status - the status code
Throws:
IllegalArgumentException - if the status code is negative or invalid
See Also:
Person.setStatus(int), Person.getStatus()

addRole

public void addRole(String roleName)
Add a security role to an Applicant

Specified by:
addRole in class Person
Parameters:
roleName - the name of the role
Throws:
UnsupportedOperationException - always thrown since applicants cannot have roles
See Also:
getRoles(), isInRole(String)

isInRole

public boolean isInRole(String roleName)
Queries this applicant's role. Applicants can only be members of a single role - "Applicants"

Specified by:
isInRole in class Person
Parameters:
roleName - the role name
Returns:
TRUE if the queried role is "Applicant", otherwise FALSE
See Also:
getRoles()

getRoles

public Collection<String> getRoles()
Returns the security roles this Applicant belongs to.

Specified by:
getRoles in class Person
Returns:
a Collection with a single string - Applicant.ROLE.
See Also:
isInRole(String)

getTypeChoices

public Map<Long,String> getTypeChoices()
Returns the stage equipment type choices.

Returns:
a Map of choices, keyed by stage

getRowClassName

public String getRowClassName()
Selects a table row class based upon the Applicant's status.

Returns:
the row CSS class name


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