Class Person
java.lang.Object
org.deltava.beans.DatabaseBean
org.deltava.beans.DatabaseBlobBean
org.deltava.beans.Person
- All Implemented Interfaces:
Serializable
,Comparable<Object>
,Principal
,EMailAddress
,FormattedEMailRecipient
,IDBean
,ViewEntry
,Cacheable
public abstract class Person
extends DatabaseBlobBean
implements Principal, FormattedEMailRecipient, ViewEntry
An abstract class storing information about a Person.
- Since:
- 1.0
- Version:
- 10.3
- Author:
- Luke
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Map
<OnlineNetwork, String> protected final Collection
<Notification> static final int
Hide e-mail address from unauthenticated users.static final int
Hide e-mail address from all non-staff users.static final int
Show e-mail address to all users.Fields inherited from class org.deltava.beans.DatabaseBlobBean
_buffer
Fields inherited from interface org.deltava.beans.EMailAddress
VALID_ADDR_REGEXP
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract void
Add a security role to the Person's list of roles.Returns the Person's preferred airport code type (IATA/ICAO).Return the date/time this Person registered.Returns the Person's preferred date format pattern.Returns the Person's preferred distance unit.getDN()
Return this Person's LDAP/JNDI Directory Name.getEmail()
Return the Person's e-mail address.int
Returns the access to a Person's e-mail address.Returns this person's e-mail domain.Return the Person's equipment type program.getExternalID
(ExternalID service) Returns the Person's external IDs.Returns a Map containing this Person's external IDs.Return this Person's First Name.Return the Person's home airport code.Return the Person's latest login date/time.Return the Person's last logoff date/time.Return this Person's Last Name.double
Return this Person's legacy flight hours.Return the Person's location.int
Return the number of times this Person has logged into the system.Return the hostname or IP address that this Person last logged in from.getName()
Returns this Person's Full name.Returns this Person's online network IDReturns the Online Networks this used has provided an ID for.int
Returns the aggregated notification code.Returns all selected notification options.Returns the Person's preferred number format pattern.Return the Person's password.getRank()
Return the Person's rank.abstract Collection
<String> getRoles()
Returns a list of security roles this Person belongs to.Returns the Person's preferred time format pattern.getTZ()
Return this Person's Time Zone.Returns the Person's preferred web site UI scheme.int
Returns the Person's preferred view window size.Returns the Person's preferred weight unit.boolean
hasID
(ExternalID svc) Returns whether a Person has a specific Instant Messenger handle.boolean
Retuns if this Person is a memebr of an online network.boolean
hasNotifyOption
(Notification notifyType) Return a particular e-mail notification option for this Person.abstract boolean
Queries if a Person is a member of a particular role.boolean
Returns whether this recipient has an invalid e-mail address.void
Updates the Person's preferred airport code type (IATA/ICAO).void
setCreatedOn
(Instant cd) Update this Person's createdOn date/timevoid
setDateFormat
(String pattern) Updates the Person's preferred date format.void
Updates the Person's preferred distance units.void
Update the Person's directory name.void
Update the Person's e-mail address.void
setEmailAccess
(int accessLevel) Update the Person's e-mail address acess level.void
setEmailInvalid
(boolean isInvalid) Marks the email address as invalid.void
setEquipmentType
(String eqType) Update the Person's Equipment Type.void
setExternalID
(ExternalID svc, String handle) Update this Person's Instant Messaging handle.void
setFirstName
(String name) Updates the Person's first (given) name.void
setHomeAirport
(String aCode) Update this Person's home airportvoid
setLastLogin
(Instant lld) Update this Person's last Login date/time.void
setLastLogoff
(Instant lld) Update the Person's last Logoff date/time.void
setLastName
(String name) Updates the Person's last (family) name.void
setLegacyHours
(double legacyHours) Update this Person's legacy flight hours.void
setLocation
(String location) Update this Person's location.void
setLoginCount
(int count) Update this person's login countvoid
setLoginHost
(String hostName) Updates the hostname or IP address that this Person last logged in fromvoid
setNetworkID
(OnlineNetwork network, CharSequence id) Update the Person's network ID for a given online network.void
setNotificationCode
(int code) Sets the notification options for a user from a single bitmap value.void
setNotifyOption
(Notification option, boolean notify) Update this Person's notification option for a given notificaiton type.void
setNumberFormat
(String pattern) Updates the Person's preferred number format.void
setPassword
(String pwd) Update the Person's password.void
Update the person's Rank.void
setTimeFormat
(String pattern) Updates the Person's preferred time format.void
Sets the Time Zone for this Person.void
setUIScheme
(String schemeName) Updates this Person's preferred web site UI scheme.void
setViewCount
(int size) Sets the size of the Person's preferred view window.void
Updates the Person's preferred weight units.toString()
Returns the person's full name.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, validateID
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.deltava.beans.ViewEntry
getRowClassName
-
Field Details
-
HIDE_EMAIL
public static final int HIDE_EMAILHide e-mail address from all non-staff users.- See Also:
-
AUTH_EMAIL
public static final int AUTH_EMAILHide e-mail address from unauthenticated users.- See Also:
-
SHOW_EMAIL
public static final int SHOW_EMAILShow e-mail address to all users.- See Also:
-
_networkIDs
-
_notifyOptions
-
-
Constructor Details
-
Person
Creates a Person object with a given first and last name, converted to "proper case".- Parameters:
firstName
- the Person's first name.lastName
- the Person's last name.- Throws:
NullPointerException
- if either name is null
-
-
Method Details
-
addRole
Add a security role to the Person's list of roles.- Parameters:
roleName
- the name of the role
-
getRoles
Returns a list of security roles this Person belongs to.- Returns:
- a Collection of role names
-
isInRole
Queries if a Person is a member of a particular role.- Parameters:
roleName
- the role name- Returns:
- TRUE if the Person is a member of this role, otherwise FALSE
-
getName
Returns this Person's Full name.- Specified by:
getName
in interfaceEMailAddress
- Specified by:
getName
in interfacePrincipal
- Returns:
- the Person's first and last names.
-
getFirstName
Return this Person's First Name.- Returns:
- Person's first (given) name.
- See Also:
-
getLastName
Return this Person's Last Name.- Returns:
- Person's last (family) name.
- See Also:
-
getDN
Return this Person's LDAP/JNDI Directory Name.- Returns:
- Person's unique DN in the repository. If this is null then the Person does not have a JNDI entry.
- See Also:
-
getPassword
Return the Person's password.- Returns:
- the unencrypted password. This will only be non-null when changing a password or registering a new Person.
- See Also:
-
getEquipmentType
Return the Person's equipment type program. In the case of an Applicant not yet hired, this will be null.- Returns:
- the equipment type, or null
- See Also:
-
getEmail
Return the Person's e-mail address.- Specified by:
getEmail
in interfaceEMailAddress
- Returns:
- the e-mail address
- See Also:
-
isInvalid
public boolean isInvalid()Description copied from interface:EMailAddress
Returns whether this recipient has an invalid e-mail address.- Specified by:
isInvalid
in interfaceEMailAddress
- Returns:
- TRUE if invalid, otherwise FALSE
-
getEmailAccess
public int getEmailAccess()Returns the access to a Person's e-mail address.- Returns:
- the access level
- See Also:
-
getEmailDomain
Returns this person's e-mail domain.- Returns:
- the domain part of the e-mail address, or null if no address.
-
getRank
Return the Person's rank. In the case of an Applicant not yet hired this will be null.- Returns:
- the rank, or null
- See Also:
-
getTZ
Return this Person's Time Zone.- Specified by:
getTZ
in interfaceFormattedEMailRecipient
- Returns:
- the time zone where this Person is located
- See Also:
-
getLegacyHours
public double getLegacyHours()Return this Person's legacy flight hours.- Returns:
- Person's Legacy flight hours
- See Also:
-
getLocation
Return the Person's location.- Returns:
- the part of the world this Person lives in
- See Also:
-
getExternalID
Returns the Person's external IDs.- Parameters:
service
- the ID service name- Returns:
- the ID, or null if not found
- Throws:
NullPointerException
- if service is null
-
getExternalIDs
Returns a Map containing this Person's external IDs.- Returns:
- the External IDs
- See Also:
-
hasID
Returns whether a Person has a specific Instant Messenger handle.- Parameters:
svc
- an IMAddress object- Returns:
- TRUE if the Person has an address for this service, otherwise FALSE
-
getHomeAirport
Return the Person's home airport code.- Returns:
- the closest Airport code this this Person''s location. This is self-selected.
- See Also:
-
getNetworks
Returns the Online Networks this used has provided an ID for.- Returns:
- the networks
-
hasNetworkID
Retuns if this Person is a memebr of an online network.- Parameters:
net
- the OnlineNetwork- Returns:
- TRUE if the user has a network ID, otherwise false
-
getNetworkID
Returns this Person's online network ID- Parameters:
net
- the OnlineNetwork- Returns:
- the network ID
- See Also:
-
hasNotifyOption
Return a particular e-mail notification option for this Person.- Parameters:
notifyType
- the NotificationType, use constants if possible- Returns:
- TRUE if this Person should be notified
- See Also:
-
getNotifyOptions
Returns all selected notification options.- Returns:
- a List of notification types
- See Also:
-
getNotifyCode
public int getNotifyCode()Returns the aggregated notification code.- Returns:
- the notification code.
-
getLoginCount
public int getLoginCount()Return the number of times this Person has logged into the system.- Returns:
- the number of times this person has logged in
- See Also:
-
getLoginHost
Return the hostname or IP address that this Person last logged in from.- Returns:
- the host name or IP address
- See Also:
-
getCreatedOn
Return the date/time this Person registered.- Returns:
- the date/time the person was registered
- See Also:
-
getLastLogin
Return the Person's latest login date/time.- Returns:
- the date/time this person last logged into the system
- See Also:
-
getLastLogoff
Return the Person's last logoff date/time.- Returns:
- the date/time this person last logged off the system
-
getDateFormat
Returns the Person's preferred date format pattern.- Specified by:
getDateFormat
in interfaceFormattedEMailRecipient
- Returns:
- the date format pattern
- See Also:
-
getTimeFormat
Returns the Person's preferred time format pattern.- Specified by:
getTimeFormat
in interfaceFormattedEMailRecipient
- Returns:
- the time format pattern
- See Also:
-
getNumberFormat
Returns the Person's preferred number format pattern.- Specified by:
getNumberFormat
in interfaceFormattedEMailRecipient
- Returns:
- the number format pattern
- See Also:
-
getUIScheme
Returns the Person's preferred web site UI scheme.- Returns:
- the web site UI scheme name
- See Also:
-
getViewCount
public int getViewCount()Returns the Person's preferred view window size.- Returns:
- the view size in rows
- See Also:
-
getDistanceType
Returns the Person's preferred distance unit.- Specified by:
getDistanceType
in interfaceFormattedEMailRecipient
- Returns:
- the unit type
- See Also:
-
getWeightType
Returns the Person's preferred weight unit.- Returns:
- the unit type
- See Also:
-
getAirportCodeType
Returns the Person's preferred airport code type (IATA/ICAO).- Specified by:
getAirportCodeType
in interfaceFormattedEMailRecipient
- Returns:
- the Airport Code type
- See Also:
-
setDN
Update the Person's directory name. Setting a non-null value implies the Person is in the directory.- Parameters:
dn
- the full directory name- See Also:
-
setFirstName
Updates the Person's first (given) name.- Parameters:
name
- the given name- Throws:
NullPointerException
- if name is null
-
setLastName
Updates the Person's last (family) name.- Parameters:
name
- the family name- Throws:
NullPointerException
- if name is null
-
setNetworkID
Update the Person's network ID for a given online network.- Parameters:
network
- the networkid
- the network ID- See Also:
-
setNotifyOption
Update this Person's notification option for a given notificaiton type.- Parameters:
option
- the notification typenotify
- TRUE if this person should be notified- See Also:
-
setNotificationCode
public void setNotificationCode(int code) Sets the notification options for a user from a single bitmap value.- Parameters:
code
- the bitmap value- See Also:
-
setPassword
Update the Person's password.- Parameters:
pwd
- the new password- See Also:
-
setEquipmentType
Update the Person's Equipment Type.- Parameters:
eqType
- the equipment type name, or null if not hired- See Also:
-
setEmail
Update the Person's e-mail address.- Parameters:
email
- the e-mail address- See Also:
-
setEmailInvalid
public void setEmailInvalid(boolean isInvalid) Marks the email address as invalid.- Parameters:
isInvalid
- TRUE if invalid, otherwise FALSE- See Also:
-
setEmailAccess
public void setEmailAccess(int accessLevel) Update the Person's e-mail address acess level.- Parameters:
accessLevel
- the access level- Throws:
IllegalArgumentException
- if the access level is negative or invalid- See Also:
-
setRank
Update the person's Rank.- Parameters:
rank
- the new Rank, or null if not hired- See Also:
-
setTZ
Sets the Time Zone for this Person.- Parameters:
tz
- the time zone where this Person is located- See Also:
-
setLegacyHours
public void setLegacyHours(double legacyHours) Update this Person's legacy flight hours.- Parameters:
legacyHours
- the Legacy Flight hours.- Throws:
IllegalArgumentException
- if the new hours are negative.- See Also:
-
setHomeAirport
Update this Person's home airport- Parameters:
aCode
- this person's IATA home airport code.- See Also:
-
setLocation
Update this Person's location.- Parameters:
location
- the location where this Person lives. It is up to the implementation as to what are valid choices.- See Also:
-
setExternalID
Update this Person's Instant Messaging handle. If the handle is empty, it will be cleared.- Parameters:
svc
- the messaging servicehandle
- the new handle- See Also:
-
setLoginCount
public void setLoginCount(int count) Update this person's login count- Parameters:
count
- the new login count.- See Also:
-
setCreatedOn
Update this Person's createdOn date/time- Parameters:
cd
- the Date/Time when the Person was created- See Also:
-
setLastLogin
Update this Person's last Login date/time.- Parameters:
lld
- the Date/Time when the Person last logged in- Throws:
IllegalStateException
- if the timestamp is less than getCreatedOn()- See Also:
-
setLastLogoff
Update the Person's last Logoff date/time.- Parameters:
lld
- the Date/Time when the Person last logged out or had the session invalidated- Throws:
IllegalStateException
- if the timestamp is less than getCreatedOn()- See Also:
-
setLoginHost
Updates the hostname or IP address that this Person last logged in from- Parameters:
hostName
- the hostname or IP address- See Also:
-
setDateFormat
Updates the Person's preferred date format.- Parameters:
pattern
- the date format pattern- See Also:
-
setTimeFormat
Updates the Person's preferred time format.- Parameters:
pattern
- the time format pattern- See Also:
-
setNumberFormat
Updates the Person's preferred number format.- Parameters:
pattern
- the number format pattern- See Also:
-
setUIScheme
Updates this Person's preferred web site UI scheme.- Parameters:
schemeName
- the scheme name- See Also:
-
setViewCount
public void setViewCount(int size) Sets the size of the Person's preferred view window.- Parameters:
size
- the size in rows- See Also:
-
setDistanceType
Updates the Person's preferred distance units.- Parameters:
un
- the DistanceUnit- See Also:
-
setWeightType
Updates the Person's preferred weight units.- Parameters:
un
- the WeightUnit- See Also:
-
setAirportCodeType
Updates the Person's preferred airport code type (IATA/ICAO).- Parameters:
code
- the Airport code type- See Also:
-
toString
-