public class EPerson extends DSpaceObject
| Modifier and Type | Field and Description |
|---|---|
static int |
EMAIL
The e-mail field (for sorting)
|
static int |
ID
The e-mail field (for sorting)
|
static int |
LANGUAGE
The e-mail field (for sorting)
|
static int |
LASTNAME
The last name (for sorting)
|
static int |
NETID
The netid field (for sorting)
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canLogIn()
Can the user log in?
|
boolean |
checkPassword(String attempt)
Check EPerson's password.
|
static EPerson |
create(Context context)
Create a new eperson
|
void |
delete()
Delete an eperson
|
boolean |
equals(Object obj)
Return true if this object equals obj, false otherwise.
|
static EPerson |
find(Context context,
int id)
Get an EPerson from the database.
|
static EPerson[] |
findAll(Context context,
int sortField)
Find all the epeople that match a particular query
ID
LASTNAME
EMAIL
NETID
|
static EPerson |
findByEmail(Context context,
String email)
Find the eperson by their email address.
|
static EPerson |
findByNetid(Context context,
String netid)
Find the eperson by their netid.
|
List<String> |
getDeleteConstraints()
Check for presence of EPerson in tables that have constraints on
EPersons.
|
String |
getEmail()
Get the e-person's email address
|
String |
getFirstName()
Get the eperson's first name.
|
String |
getFullName()
Get the e-person's full name, combining first and last name in a
displayable string.
|
String |
getHandle()
Get the e-person's handle
|
int |
getID()
Get the e-person's internal identifier
|
String |
getLanguage()
Get the e-person's language
|
String |
getLastName()
Get the eperson's last name.
|
String |
getMetadata(String field)
Get the value of a metadata field
|
String |
getName()
Get a proper name for the object.
|
String |
getNetid()
Get the e-person's netid
|
PasswordHash |
getPasswordHash()
Return the EPerson's password hash.
|
boolean |
getRequireCertificate()
Get require certificate or not
|
boolean |
getSelfRegistered()
Can the user log in?
|
int |
getType()
return type found in Constants
|
int |
hashCode()
Return a hash code for this object.
|
static EPerson[] |
search(Context context,
String query)
Find the epeople that match the search query across firstname, lastname or email.
|
static EPerson[] |
search(Context context,
String query,
int offset,
int limit)
Find the epeople that match the search query across firstname, lastname or email.
|
static int |
searchResultCount(Context context,
String query)
Returns the total number of epeople returned by a specific query, without the overhead
of creating the EPerson objects to store the results.
|
void |
setCanLogIn(boolean login)
Indicate whether the user can log in
|
void |
setEmail(String s)
Set the EPerson's email
|
void |
setFirstName(String firstname)
Set the eperson's first name
|
void |
setLanguage(String language)
Set the EPerson's language.
|
void |
setLastName(String lastname)
Set the eperson's last name
|
void |
setMetadata(String field,
String value)
Set a metadata value
|
void |
setNetid(String s)
Set the EPerson's netid
|
void |
setPassword(String s)
Set the EPerson's password.
|
void |
setPasswordHash(PasswordHash password)
Set the EPerson's password hash.
|
void |
setRequireCertificate(boolean isrequired)
Set require cert yes/no
|
void |
setSelfRegistered(boolean sr)
Indicate whether the user self-registered
|
void |
update()
Update the EPerson
|
void |
updateLastModified() |
addDetails, clearDetails, find, getAdminObject, getDetails, getParentObject, getTypeTextpublic static final int EMAIL
public static final int LASTNAME
public static final int ID
public static final int NETID
public static final int LANGUAGE
public boolean equals(Object obj)
public int hashCode()
public static EPerson find(Context context, int id) throws SQLException
context - DSpace context objectid - ID of the EPersonSQLExceptionpublic static EPerson findByEmail(Context context, String email) throws SQLException, AuthorizeException
null if none such exists.SQLExceptionAuthorizeExceptionpublic static EPerson findByNetid(Context context, String netid) throws SQLException
context - DSpace contextnetid - Network IDnullSQLExceptionpublic static EPerson[] search(Context context, String query) throws SQLException
context - DSpace contextquery - The search stringSQLExceptionpublic static EPerson[] search(Context context, String query, int offset, int limit) throws SQLException
context - DSpace contextquery - The search stringoffset - Inclusive offsetlimit - Maximum number of matches returnedSQLExceptionpublic static int searchResultCount(Context context, String query) throws SQLException
context - DSpace contextquery - The search stringSQLExceptionpublic static EPerson[] findAll(Context context, int sortField) throws SQLException
IDLASTNAMEEMAILNETIDSQLExceptionpublic static EPerson create(Context context) throws SQLException, AuthorizeException
context - DSpace context objectSQLExceptionAuthorizeExceptionpublic void delete()
throws SQLException,
AuthorizeException,
EPersonDeletionException
public int getID()
getID in class DSpaceObjectpublic String getLanguage()
public void setLanguage(String language)
language - language codepublic String getHandle()
getHandle in class DSpaceObjectpublic String getEmail()
public void setEmail(String s)
s - the new emailpublic String getNetid()
public void setNetid(String s)
s - the new netidpublic String getFullName()
public String getFirstName()
public void setFirstName(String firstname)
firstname - the person's first namepublic String getLastName()
public void setLastName(String lastname)
lastname - the person's last namepublic void setCanLogIn(boolean login)
login - boolean yes/nopublic boolean canLogIn()
public void setRequireCertificate(boolean isrequired)
isrequired - boolean yes/nopublic boolean getRequireCertificate()
public void setSelfRegistered(boolean sr)
sr - boolean yes/nopublic boolean getSelfRegistered()
public String getMetadata(String field)
field - the name of the metadata field to getIllegalArgumentException - if the requested metadata field doesn't existpublic void setMetadata(String field, String value)
field - the name of the metadata field to setvalue - value to set the field toIllegalArgumentException - if the requested metadata field doesn't existpublic void setPassword(String s)
s - the new password.public void setPasswordHash(PasswordHash password)
password - hashed password, or null to set row data to NULL.public PasswordHash getPasswordHash()
public boolean checkPassword(String attempt)
attempt - the password attemptpublic void update()
throws SQLException,
AuthorizeException
update in class DSpaceObjectSQLExceptionAuthorizeExceptionpublic int getType()
getType in class DSpaceObjectpublic List<String> getDeleteConstraints() throws SQLException
SQLExceptionpublic String getName()
DSpaceObjectnull.
Name should be suitable for display in a user interface.getName in class DSpaceObjectnull if it doesn't have
onepublic void updateLastModified()
updateLastModified in class DSpaceObjectCopyright © 2015 DuraSpace. All Rights Reserved.