Class EPerson

All Implemented Interfaces:
Serializable, DSpaceObjectLegacySupport, ReloadableEntity<UUID>

@Entity public class EPerson extends CacheableDSpaceObject implements DSpaceObjectLegacySupport
Class representing an e-person.
Author:
David Stuve
See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • getLegacyId

      public Integer getLegacyId()
      Specified by:
      getLegacyId in interface DSpaceObjectLegacySupport
      Returns:
      the old integer based legacy identifier
    • equals

      public boolean equals(Object obj)
      Return true if this object equals obj, false otherwise.
      Overrides:
      equals in class Object
      Parameters:
      obj - another EPerson.
      Returns:
      true if EPerson objects are equal in ID, email, and full name
    • hashCode

      public int hashCode()
      Return a hash code for this object.
      Overrides:
      hashCode in class Object
      Returns:
      int hash of 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 Portuguese).
      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(Instant when)
      Stamp the EPerson's last-active date.
      Parameters:
      when - latest activity timestamp, or null to clear.
    • getLastActive

      public Instant getLastActive()
      Get the EPerson's last-active stamp.
      Returns:
      date when last logged on, or null.
    • getType

      public int getType()
      Description copied from class: DSpaceObject
      Get the type of this object, found in Constants
      Specified by:
      getType in class DSpaceObject
      Returns:
      type found in Constants, see Constants
    • getName

      public String getName()
      Specified by:
      getName in class DSpaceObject
    • getGroups

      public List<Group> getGroups()
    • getSessionSalt

      public String getSessionSalt()
    • setSessionSalt

      public void setSessionSalt(String sessionSalt)
    • getPreviousActive

      public Instant getPreviousActive()
    • hasPasswordSet

      public boolean hasPasswordSet()