Class UserData
java.lang.Object
org.deltava.beans.DatabaseBean
org.deltava.beans.UserData
- All Implemented Interfaces:
Serializable
,Comparable<Object>
,IDBean
,Cacheable
A class to store cross-Airline User data. This is used to track locations of users in parts of the application (Water
Cooler, Online Events) that allow users from other airlines to write database entries.
- Since:
- 1.0
- Version:
- 9.0
- Author:
- Luke
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addID
(int id) Adds the database ID for the user's profile in another airline.cacheKey()
Returns the cache key for this object.Returns the User's airline code.getDB()
Returns the name of the database containing the User.Returns the fully qualified table name.Returns the domain name of the web site containing the User's profile.getIDs()
Returns the database IDs of this user's profiles in other Airlines.getTable()
Returns the name of the table containing the User.int
hashCode()
boolean
hasID
(int id) Returns whether this User has a particular database ID in an application.boolean
Returns if the User is an Applicant or a Pilot.static boolean
isPilotTable
(String tableName) Utility method to query whether a table is a Pilot or Applicant table.void
setAirlineCode
(String aCode) Updates the User's airline code.void
Updates the database name.void
Sets the domain name of the database used to view the User's profile.void
setID
(int id) Update the database row ID of this bean.void
Updates the table name.Methods inherited from class org.deltava.beans.DatabaseBean
compareTo, equals, getHexID, getID, validateID, validateID
-
Constructor Details
-
UserData
-
UserData
public UserData(int id) Creates a new User Data bean for the specified User.- Parameters:
id
- the User's database ID
-
UserData
Creates a new User Data bean for the specified Person.- Parameters:
p
- the Person bean
-
-
Method Details
-
getDB
Returns the name of the database containing the User.- Returns:
- the database name
- See Also:
-
getDBTable
Returns the fully qualified table name.- Returns:
- the the database and table names as db.TABLENAME
-
getAirlineCode
-
getTable
Returns the name of the table containing the User.- Returns:
- the database table name
- See Also:
-
getDomain
Returns the domain name of the web site containing the User's profile.- Returns:
- the domain name
- See Also:
-
getIDs
Returns the database IDs of this user's profiles in other Airlines.- Returns:
- a Collection of Database IDs
- See Also:
-
hasID
public boolean hasID(int id) Returns whether this User has a particular database ID in an application.- Parameters:
id
- the database ID- Returns:
- TRUE if this User has this ID in an application, otherwise FALSE
-
isApplicant
public boolean isApplicant()Returns if the User is an Applicant or a Pilot.- Returns:
- TRUE if the user is an Applicant, otherwise FALSE
-
setDB
Updates the database name. This will be converted to lowercase.- Parameters:
dbName
- the name of the database containing this User- Throws:
NullPointerException
- if dbName is null- See Also:
-
setAirlineCode
Updates the User's airline code. This will be converted to uppercase.- Parameters:
aCode
- the Airline code- Throws:
NullPointerException
- if aCode is null- See Also:
-
setTable
Updates the table name. This will be converted to uppercase.- Parameters:
tableName
- the name of the table containing this User- Throws:
NullPointerException
- if tableName is null- See Also:
-
setDomain
Sets the domain name of the database used to view the User's profile. This will be converted to lowercase.- Parameters:
domainName
- the domain of the web site containing this user's Profile- Throws:
NullPointerException
- if domainName is null- See Also:
-
setID
public void setID(int id) Description copied from class:DatabaseBean
Update the database row ID of this bean. This typically will only be called by a DAO- Overrides:
setID
in classDatabaseBean
- Parameters:
id
- The primary key of the entry in the database that corresponds to this object.- See Also:
-
addID
public void addID(int id) Adds the database ID for the user's profile in another airline.- Parameters:
id
- the new ID- Throws:
IllegalArgumentException
- if id is zero or negative
-
isPilotTable
Utility method to query whether a table is a Pilot or Applicant table.- Parameters:
tableName
- the table name, in either TABLE or DB.TABLE format- Returns:
- TRUE if the table should be queried by a Pilot DAO, otherwise FALSE
-
hashCode
public int hashCode()- Overrides:
hashCode
in classDatabaseBean
-
cacheKey
-