Package org.dspace.eperson.service
Interface EPersonService
-
- All Superinterfaces:
DSpaceObjectLegacySupportService<EPerson>,DSpaceObjectService<EPerson>
- All Known Implementing Classes:
EPersonServiceImpl
public interface EPersonService extends DSpaceObjectService<EPerson>, DSpaceObjectLegacySupportService<EPerson>
Service interface class for the EPerson object. The implementation of this class is responsible for all business logic calls for the EPerson object and is autowired by spring Methods for handling registration by email and forgotten passwords. When someone registers as a user, or forgets their password, the sendRegistrationInfo or sendForgotPasswordInfo methods can be used to send an email to the user. The email contains a special token, a long string which is randomly generated and thus hard to guess. When the user presents the token back to the system, the AccountManager can use the token to determine the identity of the eperson. *NEW* now ignores expiration dates so that tokens never expire- Version:
- $Revision$
- Author:
- Peter Breton, kevinvandevelde at atmire.com
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description booleancheckPassword(Context context, EPerson ePerson, String attempt)Check EPerson's password.intcountTotal(Context context)Count all accounts.EPersoncreate(Context context)Create a new epersonList<EPerson>findAll(Context context, int sortField)Deprecated.use the paginated method.List<EPerson>findAll(Context context, int sortField, int pageSize, int offset)Find all the epeople in a specific orderIDLASTNAMEEMAILNETIDEPersonfindByEmail(Context context, String email)Find the eperson by their email address.List<EPerson>findByGroups(Context c, Set<Group> groups)Retrieve all accounts which belong to at least one of the specified groups.EPersonfindByNetid(Context context, String netId)Find the eperson by their netid.List<EPerson>findEPeopleWithSubscription(Context context)Retrieve all accounts which are subscribed to receive information about new items.List<EPerson>findNotActiveSince(Context context, Date date)Retrieve all accounts which have not logged in since the specified dateList<EPerson>findUnsalted(Context context)Retrieve all accounts which have a password but do not have a digest algorithmList<String>getDeleteConstraints(Context context, EPerson ePerson)Check for presence of EPerson in tables that have constraints on EPersons.PasswordHashgetPasswordHash(EPerson ePerson)Return the EPerson's password hash.List<EPerson>search(Context context, String query)Find the epeople that match the search query across firstname, lastname or email.List<EPerson>search(Context context, String query, int offset, int limit)Find the epeople that match the search query across firstname, lastname or email.intsearchResultCount(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.voidsetMetadata(Context context, EPerson ePerson, String field, String value)Deprecated.voidsetPassword(EPerson ePerson, String password)Set the EPerson's password.voidsetPasswordHash(EPerson ePerson, PasswordHash password)Set the EPerson's password hash.-
Methods inherited from interface org.dspace.content.service.DSpaceObjectLegacySupportService
findByIdOrLegacyId, findByLegacyId, getSupportsTypeConstant
-
Methods inherited from interface org.dspace.content.service.DSpaceObjectService
addAndShiftRightMetadata, addMetadata, addMetadata, addMetadata, addMetadata, addMetadata, addMetadata, addMetadata, addMetadata, clearMetadata, delete, find, getAdminObject, getIdentifiers, getMetadata, getMetadata, getMetadata, getMetadata, getMetadataByMetadataString, getMetadataFirstValue, getName, getParentObject, getSupportsTypeConstant, getTypeText, moveMetadata, removeMetadataValues, replaceMetadata, setMetadataModified, setMetadataSingleValue, update, updateLastModified
-
-
-
-
Method Detail
-
findByEmail
EPerson findByEmail(Context context, String email) throws SQLException
Find the eperson by their email address.- Parameters:
context- The relevant DSpace Context.email- EPerson's email to search by- Returns:
- EPerson, or
nullif none such exists. - Throws:
SQLException- An exception that provides information on a database access error or other errors.
-
findByNetid
EPerson findByNetid(Context context, String netId) throws SQLException
Find the eperson by their netid.- Parameters:
context- The relevant DSpace Context.netId- Network ID- Returns:
- corresponding EPerson, or
null - Throws:
SQLException- An exception that provides information on a database access error or other errors.
-
search
List<EPerson> search(Context context, String query) throws SQLException
Find the epeople that match the search query across firstname, lastname or email.- Parameters:
context- The relevant DSpace Context.query- The search string- Returns:
- array of EPerson objects
- Throws:
SQLException- An exception that provides information on a database access error or other errors.
-
search
List<EPerson> search(Context context, String query, int offset, int limit) throws SQLException
Find the epeople that match the search query across firstname, lastname or email. This method also allows offsets and limits for pagination purposes.- Parameters:
context- The relevant DSpace Context.query- The search stringoffset- Inclusive offsetlimit- Maximum number of matches returned- Returns:
- array of EPerson objects
- Throws:
SQLException- An exception that provides information on a database access error or other errors.
-
searchResultCount
int searchResultCount(Context context, String query) throws SQLException
Returns the total number of epeople returned by a specific query, without the overhead of creating the EPerson objects to store the results.- Parameters:
context- The relevant DSpace Context.query- The search string- Returns:
- the number of epeople matching the query
- Throws:
SQLException- An exception that provides information on a database access error or other errors.
-
findAll
@Deprecated List<EPerson> findAll(Context context, int sortField) throws SQLException
Deprecated.use the paginated method. Find all the epeople in a specific orderIDLASTNAMEEMAILNETID
- Parameters:
context- The relevant DSpace Context.sortField- which field to sort EPersons by- Returns:
- list of EPerson objects
- Throws:
SQLException- An exception that provides information on a database access error or other errors.
-
findAll
List<EPerson> findAll(Context context, int sortField, int pageSize, int offset) throws SQLException
Find all the epeople in a specific orderIDLASTNAMEEMAILNETID
- Parameters:
context- The relevant DSpace Context.sortField- which field to sort EPersons bypageSize- how many results returnoffset- the position of the first result to return- Returns:
- list of EPerson objects
- Throws:
SQLException- An exception that provides information on a database access error or other errors.
-
create
EPerson create(Context context) throws SQLException, AuthorizeException
Create a new eperson- Parameters:
context- The relevant DSpace Context.- Returns:
- the created EPerson
- Throws:
SQLException- An exception that provides information on a database access error or other errors.AuthorizeException- Exception indicating the current user of the context does not have permission to perform a particular action.
-
setPassword
void setPassword(EPerson ePerson, String password)
Set the EPerson's password.- Parameters:
ePerson- EPerson whose password we want to set.password- the new password.
-
setPasswordHash
void setPasswordHash(EPerson ePerson, PasswordHash password)
Set the EPerson's password hash.- Parameters:
ePerson- EPerson whose password hash we want to set.password- hashed password, or null to set row data to NULL.
-
getPasswordHash
PasswordHash getPasswordHash(EPerson ePerson)
Return the EPerson's password hash.- Parameters:
ePerson- EPerson whose password hash we want to get.- Returns:
- hash of the password, or null on failure (such as no password).
-
checkPassword
boolean checkPassword(Context context, EPerson ePerson, String attempt)
Check EPerson's password. Side effect: original unsalted MD5 hashes are converted using the current algorithm.- Parameters:
context- The relevant DSpace Context.ePerson- EPerson whose password we want to checkattempt- the password attempt- Returns:
- boolean successful/unsuccessful
-
setMetadata
@Deprecated void setMetadata(Context context, EPerson ePerson, String field, String value) throws SQLException
Deprecated.Set a metadata value (in the metadatavalue table) of the metadata field specified by 'field'.- Parameters:
context- The relevant DSpace Context.ePerson- EPerson whose metadata we want to set.field- Metadata field we want to set (e.g. "phone").value- Metadata value we want to set- Throws:
SQLException- if the requested metadata field doesn't exist
-
findUnsalted
List<EPerson> findUnsalted(Context context) throws SQLException
Retrieve all accounts which have a password but do not have a digest algorithm- Parameters:
context- The relevant DSpace Context.- Returns:
- a list of epeople
- Throws:
SQLException- An exception that provides information on a database access error or other errors.
-
findNotActiveSince
List<EPerson> findNotActiveSince(Context context, Date date) throws SQLException
Retrieve all accounts which have not logged in since the specified date- Parameters:
context- The relevant DSpace Context.date- from which date- Returns:
- a list of epeople
- Throws:
SQLException- An exception that provides information on a database access error or other errors.
-
getDeleteConstraints
List<String> getDeleteConstraints(Context context, EPerson ePerson) throws SQLException
Check for presence of EPerson in tables that have constraints on EPersons. Called by delete() to determine whether the eperson can actually be deleted. An EPerson cannot be deleted if it exists in the item, workflowitem, or tasklistitem tables.- Parameters:
context- The relevant DSpace Context.ePerson- EPerson to find- Returns:
- List of tables that contain a reference to the eperson.
- Throws:
SQLException- An exception that provides information on a database access error or other errors.
-
findByGroups
List<EPerson> findByGroups(Context c, Set<Group> groups) throws SQLException
Retrieve all accounts which belong to at least one of the specified groups.- Parameters:
c- The relevant DSpace Context.groups- set of eperson groups- Returns:
- a list of epeople
- Throws:
SQLException- An exception that provides information on a database access error or other errors.
-
findEPeopleWithSubscription
List<EPerson> findEPeopleWithSubscription(Context context) throws SQLException
Retrieve all accounts which are subscribed to receive information about new items.- Parameters:
context- The relevant DSpace Context.- Returns:
- a list of epeople
- Throws:
SQLException- An exception that provides information on a database access error or other errors.
-
countTotal
int countTotal(Context context) throws SQLException
Count all accounts.- Parameters:
context- The relevant DSpace Context.- Returns:
- the total number of epeople
- Throws:
SQLException- An exception that provides information on a database access error or other errors.
-
-