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(java.lang.String attempt)
Check EPerson's password.
|
static EPerson |
create(Context context)
Create a new eperson
|
void |
delete()
Delete an eperson
|
boolean |
equals(java.lang.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,
java.lang.String email)
Find the eperson by their email address.
|
static EPerson |
findByNetid(Context context,
java.lang.String netid)
Find the eperson by their netid.
|
java.util.List<java.lang.String> |
getDeleteConstraints()
Check for presence of EPerson in tables that have constraints on
EPersons.
|
java.lang.String |
getEmail()
Get the e-person's email address
|
java.lang.String |
getFirstName()
Get the eperson's first name.
|
java.lang.String |
getFullName()
Get the e-person's full name, combining first and last name in a
displayable string.
|
java.lang.String |
getHandle()
Get the e-person's handle
|
int |
getID()
Get the e-person's internal identifier
|
java.lang.String |
getLanguage()
Get the e-person's language
|
java.util.Date |
getLastActive()
Get the EPerson's last-active stamp.
|
java.lang.String |
getLastName()
Get the eperson's last name.
|
java.lang.String |
getMetadata(java.lang.String field)
Get the value of a metadata field
|
java.lang.String |
getName()
Get a proper name for the object.
|
java.lang.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()
Is the user self-registered?
|
int |
getType()
return type found in Constants
|
int |
hashCode()
Return a hash code for this object.
|
static void |
main(java.lang.String[] argv)
Tool for manipulating user accounts.
|
static EPerson[] |
search(Context context,
java.lang.String query)
Find the epeople that match the search query across firstname, lastname or email.
|
static EPerson[] |
search(Context context,
java.lang.String query,
int offset,
int limit)
Find the epeople that match the search query across firstname, lastname or email.
|
static int |
searchResultCount(Context context,
java.lang.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(java.lang.String s)
Set the EPerson's email
|
void |
setFirstName(java.lang.String firstname)
Set the eperson's first name
|
void |
setLanguage(java.lang.String language)
Set the EPerson's language.
|
void |
setLastActive(java.util.Date when)
Stamp the EPerson's last-active date.
|
void |
setLastName(java.lang.String lastname)
Set the eperson's last name
|
void |
setMetadata(java.lang.String field,
java.lang.String value)
Set a metadata value
|
void |
setNetid(java.lang.String s)
Set the EPerson's netid
|
void |
setPassword(java.lang.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(java.lang.Object obj)
equals in class java.lang.Objectobj - public int hashCode()
hashCode in class java.lang.Objectpublic static EPerson find(Context context, int id) throws java.sql.SQLException
context - DSpace context objectid - ID of the EPersonjava.sql.SQLExceptionpublic static EPerson findByEmail(Context context, java.lang.String email) throws java.sql.SQLException, AuthorizeException
null if none such exists.java.sql.SQLExceptionAuthorizeExceptionpublic static EPerson findByNetid(Context context, java.lang.String netid) throws java.sql.SQLException
context - DSpace contextnetid - Network IDnulljava.sql.SQLExceptionpublic static EPerson[] search(Context context, java.lang.String query) throws java.sql.SQLException
context - DSpace contextquery - The search stringjava.sql.SQLExceptionpublic static EPerson[] search(Context context, java.lang.String query, int offset, int limit) throws java.sql.SQLException
context - DSpace contextquery - The search stringoffset - Inclusive offsetlimit - Maximum number of matches returnedjava.sql.SQLExceptionpublic static int searchResultCount(Context context, java.lang.String query) throws java.sql.SQLException
context - DSpace contextquery - The search stringjava.sql.SQLExceptionpublic static EPerson[] findAll(Context context, int sortField) throws java.sql.SQLException
IDLASTNAMEEMAILNETIDjava.sql.SQLExceptionpublic static EPerson create(Context context) throws java.sql.SQLException, AuthorizeException
context - DSpace context objectjava.sql.SQLExceptionAuthorizeExceptionpublic void delete()
throws java.sql.SQLException,
AuthorizeException,
EPersonDeletionException
java.sql.SQLExceptionAuthorizeExceptionEPersonDeletionExceptionpublic int getID()
getID in class DSpaceObjectpublic java.lang.String getLanguage()
public void setLanguage(java.lang.String language)
language - language codepublic java.lang.String getHandle()
getHandle in class DSpaceObjectpublic java.lang.String getEmail()
public void setEmail(java.lang.String s)
s - the new emailpublic java.lang.String getNetid()
public void setNetid(java.lang.String s)
s - the new netidpublic java.lang.String getFullName()
public java.lang.String getFirstName()
public void setFirstName(java.lang.String firstname)
firstname - the person's first namepublic java.lang.String getLastName()
public void setLastName(java.lang.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 java.lang.String getMetadata(java.lang.String field)
field - the name of the metadata field to getjava.lang.IllegalArgumentException - if the requested metadata field doesn't existpublic void setMetadata(java.lang.String field,
java.lang.String value)
field - the name of the metadata field to setvalue - value to set the field tojava.lang.IllegalArgumentException - if the requested metadata field doesn't existpublic void setPassword(java.lang.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(java.lang.String attempt)
attempt - the password attemptpublic void setLastActive(java.util.Date when)
when - latest activity timestamp, or null to clear.public java.util.Date getLastActive()
public void update()
throws java.sql.SQLException,
AuthorizeException
update in class DSpaceObjectjava.sql.SQLExceptionAuthorizeExceptionpublic int getType()
getType in class DSpaceObjectpublic java.util.List<java.lang.String> getDeleteConstraints()
throws java.sql.SQLException
java.sql.SQLExceptionpublic java.lang.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 DSpaceObjectpublic static void main(java.lang.String[] argv)
throws org.apache.commons.cli.ParseException,
java.sql.SQLException
org.apache.commons.cli.ParseExceptionjava.sql.SQLExceptionCopyright © 2013 DuraSpace. All Rights Reserved.