Package org.dspace.eperson
Class EPerson
- java.lang.Object
-
- org.dspace.content.DSpaceObject
-
- org.dspace.eperson.EPerson
-
- All Implemented Interfaces:
Serializable,DSpaceObjectLegacySupport,ReloadableEntity<UUID>
@Entity public class EPerson extends DSpaceObject implements DSpaceObjectLegacySupport
Class representing an e-person.- Author:
- David Stuve
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static intEMAILThe e-mail field (for sorting)protected EPersonServiceePersonServicestatic intIDThe e-mail field (for sorting)static intLANGUAGEThe e-mail field (for sorting)static intLASTNAMEThe last name (for sorting)static intNETIDThe netid field (for sorting)-
Fields inherited from class org.dspace.content.DSpaceObject
id, predefinedUUID
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedEPerson()Protected constructor, create object using:EPersonService.create(Context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanLogIn()Can the user log in?booleanequals(Object obj)Return true if this object equals obj, false otherwise.StringgetEmail()Get the e-person's email addressStringgetFirstName()Get the eperson's first name.StringgetFullName()Get the e-person's full name, combining first and last name in a displayable string.List<Group>getGroups()StringgetLanguage()Get the e-person's languageDategetLastActive()Get the EPerson's last-active stamp.StringgetLastName()Get the eperson's last name.IntegergetLegacyId()StringgetName()StringgetNetid()Get the e-person's netidDategetPreviousActive()booleangetRequireCertificate()Get require certificate or notbooleangetSelfRegistered()Is the user self-registered?StringgetSessionSalt()intgetType()Get the type of this object, found in ConstantsinthashCode()Return a hash code for this object.booleanhasPasswordSet()voidsetCanLogIn(boolean login)Indicate whether the user can log invoidsetEmail(String s)Set the EPerson's emailvoidsetFirstName(Context context, String firstname)Set the eperson's first namevoidsetLanguage(Context context, String language)Set the EPerson's language.voidsetLastActive(Date when)Stamp the EPerson's last-active date.voidsetLastName(Context context, String lastname)Set the eperson's last namevoidsetNetid(String netid)Set the EPerson's netidvoidsetRequireCertificate(boolean isrequired)Set require cert yes/novoidsetSelfRegistered(boolean sr)Indicate whether the user self-registeredvoidsetSessionSalt(String sessionSalt)-
Methods inherited from class org.dspace.content.DSpaceObject
addDetails, addHandle, addMetadata, clearDetails, clearModified, getDetails, getHandle, getHandles, getID, getMetadata, getPredefinedUUID, getResourcePolicies, isMetadataModified, isModified, removeMetadata, removeMetadata, setMetadata, setMetadataModified, setModified
-
-
-
-
Field Detail
-
EMAIL
public static final int EMAIL
The e-mail field (for sorting)- See Also:
- Constant Field Values
-
LASTNAME
public static final int LASTNAME
The last name (for sorting)- See Also:
- Constant Field Values
-
ID
public static final int ID
The e-mail field (for sorting)- See Also:
- Constant Field Values
-
NETID
public static final int NETID
The netid field (for sorting)- See Also:
- Constant Field Values
-
LANGUAGE
public static final int LANGUAGE
The e-mail field (for sorting)- See Also:
- Constant Field Values
-
ePersonService
protected transient EPersonService ePersonService
-
-
Constructor Detail
-
EPerson
protected EPerson()
Protected constructor, create object using:EPersonService.create(Context)
-
-
Method Detail
-
getLegacyId
public Integer getLegacyId()
- Specified by:
getLegacyIdin interfaceDSpaceObjectLegacySupport- Returns:
- the old integer based legacy identifier
-
equals
public boolean equals(Object obj)
Return true if this object equals obj, false otherwise.
-
hashCode
public int hashCode()
Return a hash code for this object.
-
getLanguage
public String getLanguage()
Get the e-person's language- Returns:
- language code (or null if the column is an SQL NULL)
-
setLanguage
public void setLanguage(Context context, String language) throws SQLException
Set the EPerson's language. Value is expected to be a Unix/POSIX Locale specification of the form {language} or {language}_{territory}, e.g. "en", "en_US", "pt_BR" (the latter is Brazilian Portugese).- Parameters:
context- The relevant DSpace Context.language- language code- Throws:
SQLException- An exception that provides information on a database access error or other errors.
-
getEmail
public String getEmail()
Get the e-person's email address- Returns:
- their email address (or null if the column is an SQL NULL)
-
setEmail
public void setEmail(String s)
Set the EPerson's email- Parameters:
s- the new email
-
getNetid
public String getNetid()
Get the e-person's netid- Returns:
- their netid (DB constraints ensure it's never NULL)
-
setNetid
public void setNetid(String netid)
Set the EPerson's netid- Parameters:
netid- the new netid
-
getFullName
public String getFullName()
Get the e-person's full name, combining first and last name in a displayable string.- Returns:
- their full name (first + last name; if both are NULL, returns email)
-
getFirstName
public String getFirstName()
Get the eperson's first name.- Returns:
- their first name (or null if the column is an SQL NULL)
-
setFirstName
public void setFirstName(Context context, String firstname) throws SQLException
Set the eperson's first name- Parameters:
context- The relevant DSpace Context.firstname- the person's first name- Throws:
SQLException- An exception that provides information on a database access error or other errors.
-
getLastName
public String getLastName()
Get the eperson's last name.- Returns:
- their last name (or null if the column is an SQL NULL)
-
setLastName
public void setLastName(Context context, String lastname) throws SQLException
Set the eperson's last name- Parameters:
context- The relevant DSpace Context.lastname- the person's last name- Throws:
SQLException- An exception that provides information on a database access error or other errors.
-
setCanLogIn
public void setCanLogIn(boolean login)
Indicate whether the user can log in- Parameters:
login- boolean yes/no
-
canLogIn
public boolean canLogIn()
Can the user log in?- Returns:
- boolean, yes/no
-
setRequireCertificate
public void setRequireCertificate(boolean isrequired)
Set require cert yes/no- Parameters:
isrequired- boolean yes/no
-
getRequireCertificate
public boolean getRequireCertificate()
Get require certificate or not- Returns:
- boolean, yes/no (or false if the column is an SQL NULL)
-
setSelfRegistered
public void setSelfRegistered(boolean sr)
Indicate whether the user self-registered- Parameters:
sr- boolean yes/no
-
getSelfRegistered
public boolean getSelfRegistered()
Is the user self-registered?- Returns:
- boolean, yes/no (or false if the column is an SQL NULL)
-
setLastActive
public void setLastActive(Date when)
Stamp the EPerson's last-active date.- Parameters:
when- latest activity timestamp, or null to clear.
-
getLastActive
public Date getLastActive()
Get the EPerson's last-active stamp.- Returns:
- date when last logged on, or null.
-
getType
public int getType()
Description copied from class:DSpaceObjectGet the type of this object, found in Constants- Specified by:
getTypein classDSpaceObject- Returns:
- type found in Constants, see
Constants
-
getName
public String getName()
- Specified by:
getNamein classDSpaceObject
-
getSessionSalt
public String getSessionSalt()
-
setSessionSalt
public void setSessionSalt(String sessionSalt)
-
getPreviousActive
public Date getPreviousActive()
-
hasPasswordSet
public boolean hasPasswordSet()
-
-