public class EPersonServiceImpl extends DSpaceObjectServiceImpl<EPerson> implements EPersonService
| Modifier and Type | Field and Description |
|---|---|
protected AuthorizeService |
authorizeService |
protected EPersonDAO |
ePersonDAO |
protected ItemService |
itemService |
protected SubscribeService |
subscribeService |
choiceAuthorityService, handleService, metadataAuthorityService, metadataFieldService, metadataValueService, relationshipService| Modifier | Constructor and Description |
|---|---|
protected |
EPersonServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkPassword(Context context,
EPerson ePerson,
String attempt)
Check EPerson's password.
|
int |
countTotal(Context context)
Count all accounts.
|
EPerson |
create(Context context)
Create a new eperson
|
void |
delete(Context context,
EPerson ePerson) |
EPerson |
find(Context context,
UUID id)
Generic find for when the precise type of an Entity is not known
|
List<EPerson> |
findAll(Context context,
int sortField) |
List<EPerson> |
findAll(Context context,
int sortField,
int pageSize,
int offset)
Find all the epeople in a specific order
ID
LASTNAME
EMAIL
NETID
|
EPerson |
findByEmail(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.
|
EPerson |
findByIdOrLegacyId(Context context,
String id) |
EPerson |
findByLegacyId(Context context,
int legacyId)
Generic find for when the precise type of a DSO is not known, just the
a pair of type number and database ID.
|
EPerson |
findByNetid(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 date
|
List<EPerson> |
findUnsalted(Context context)
Retrieve all accounts which have a password but do not have a digest algorithm
|
List<String> |
getDeleteConstraints(Context context,
EPerson ePerson)
Check for presence of EPerson in tables that have constraints on
EPersons.
|
String |
getMetadata(EPerson dso,
String field)
Get the value of a metadata field
|
PasswordHash |
getPasswordHash(EPerson ePerson)
Return the EPerson's password hash.
|
int |
getSupportsTypeConstant()
Returns the Constants which this service supports
|
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.
|
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 |
setMetadata(Context context,
EPerson ePerson,
String field,
String value)
Set a metadata value (in the metadatavalue table) of the metadata field
specified by 'field'.
|
void |
setPassword(EPerson ePerson,
String password)
Set the EPerson's password.
|
void |
setPasswordHash(EPerson ePerson,
PasswordHash password)
Set the EPerson's password hash.
|
void |
update(Context context,
EPerson ePerson) |
void |
updateLastModified(Context context,
EPerson dso) |
addAndShiftRightMetadata, addMetadata, addMetadata, addMetadata, addMetadata, addMetadata, addMetadata, addMetadata, addMetadata, clearMetadata, getAdminObject, getAuthoritiesAndConfidences, getElements, getElementsFilled, getIdentifiers, getMDValueByField, getMDValueByLegacyField, getMetadata, getMetadata, getMetadata, getMetadataByMetadataString, getMetadataFirstValue, getMetadataValuePlace, getName, getParentObject, getTypeText, match, moveMetadata, removeMetadataValues, replaceMetadata, setMetadataSingleValueclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddAndShiftRightMetadata, addMetadata, addMetadata, addMetadata, addMetadata, addMetadata, addMetadata, addMetadata, addMetadata, clearMetadata, getAdminObject, getIdentifiers, getMetadata, getMetadata, getMetadata, getMetadataByMetadataString, getMetadataFirstValue, getName, getParentObject, getTypeText, moveMetadata, removeMetadataValues, replaceMetadata, setMetadataSingleValue@Autowired(required=true) protected EPersonDAO ePersonDAO
@Autowired(required=true) protected AuthorizeService authorizeService
@Autowired(required=true) protected ItemService itemService
@Autowired(required=true) protected SubscribeService subscribeService
public EPerson find(Context context, UUID id) throws SQLException
DSpaceObjectServicefind in interface DSpaceObjectService<EPerson>context - - the contextid - - uuid within table of type'd dspace objectsSQLException - only upon failure accessing the database.public EPerson findByIdOrLegacyId(Context context, String id) throws SQLException
findByIdOrLegacyId in interface DSpaceObjectLegacySupportService<EPerson>SQLExceptionpublic EPerson findByLegacyId(Context context, int legacyId) throws SQLException
DSpaceObjectLegacySupportServicefindByLegacyId in interface DSpaceObjectLegacySupportService<EPerson>context - - the contextlegacyId - - the legacy id within table of type'd objectsSQLException - only upon failure accessing the database.public EPerson findByEmail(Context context, String email) throws SQLException
EPersonServicefindByEmail in interface EPersonServicecontext - The relevant DSpace Context.email - EPerson's email to search bynull if none such exists.SQLException - An exception that provides information on a database access error or other errors.public EPerson findByNetid(Context context, String netId) throws SQLException
EPersonServicefindByNetid in interface EPersonServicecontext - The relevant DSpace Context.netId - Network IDnullSQLException - An exception that provides information on a database access error or other errors.public List<EPerson> search(Context context, String query) throws SQLException
EPersonServicesearch in interface EPersonServicecontext - The relevant DSpace Context.query - The search stringSQLException - An exception that provides information on a database access error or other errors.public List<EPerson> search(Context context, String query, int offset, int limit) throws SQLException
EPersonServicesearch in interface EPersonServicecontext - The relevant DSpace Context.query - The search stringoffset - Inclusive offsetlimit - Maximum number of matches returnedSQLException - An exception that provides information on a database access error or other errors.public int searchResultCount(Context context, String query) throws SQLException
EPersonServicesearchResultCount in interface EPersonServicecontext - The relevant DSpace Context.query - The search stringSQLException - An exception that provides information on a database access error or other errors.public List<EPerson> findAll(Context context, int sortField) throws SQLException
findAll in interface EPersonServicecontext - The relevant DSpace Context.sortField - which field to sort EPersons bySQLException - An exception that provides information on a database access error or other errors.public List<EPerson> findAll(Context context, int sortField, int pageSize, int offset) throws SQLException
EPersonServiceIDLASTNAMEEMAILNETIDfindAll in interface EPersonServicecontext - The relevant DSpace Context.sortField - which field to sort EPersons bypageSize - how many results returnoffset - the position of the first result to returnSQLException - An exception that provides information on a database access error or other errors.public EPerson create(Context context) throws SQLException, AuthorizeException
EPersonServicecreate in interface EPersonServicecontext - The relevant DSpace Context.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.public void delete(Context context, EPerson ePerson) throws SQLException, AuthorizeException
delete in interface DSpaceObjectService<EPerson>SQLExceptionAuthorizeExceptionpublic int getSupportsTypeConstant()
DSpaceObjectServicegetSupportsTypeConstant in interface DSpaceObjectLegacySupportService<EPerson>getSupportsTypeConstant in interface DSpaceObjectService<EPerson>public void setPassword(EPerson ePerson, String password)
EPersonServicesetPassword in interface EPersonServiceePerson - EPerson whose password we want to set.password - the new password.public void setPasswordHash(EPerson ePerson, PasswordHash password)
EPersonServicesetPasswordHash in interface EPersonServiceePerson - EPerson whose password hash we want to set.password - hashed password, or null to set row data to NULL.public PasswordHash getPasswordHash(EPerson ePerson)
EPersonServicegetPasswordHash in interface EPersonServiceePerson - EPerson whose password hash we want to get.public boolean checkPassword(Context context, EPerson ePerson, String attempt)
EPersonServicecheckPassword in interface EPersonServicecontext - The relevant DSpace Context.ePerson - EPerson whose password we want to checkattempt - the password attemptpublic void update(Context context, EPerson ePerson) throws SQLException, AuthorizeException
update in interface DSpaceObjectService<EPerson>update in class DSpaceObjectServiceImpl<EPerson>SQLExceptionAuthorizeExceptionpublic List<String> getDeleteConstraints(Context context, EPerson ePerson) throws SQLException
EPersonServicegetDeleteConstraints in interface EPersonServicecontext - The relevant DSpace Context.ePerson - EPerson to findSQLException - An exception that provides information on a database access error or other errors.public List<EPerson> findByGroups(Context c, Set<Group> groups) throws SQLException
EPersonServicefindByGroups in interface EPersonServicec - The relevant DSpace Context.groups - set of eperson groupsSQLException - An exception that provides information on a database access error or other errors.public List<EPerson> findEPeopleWithSubscription(Context context) throws SQLException
EPersonServicefindEPeopleWithSubscription in interface EPersonServicecontext - The relevant DSpace Context.SQLException - An exception that provides information on a database access error or other errors.public void updateLastModified(Context context, EPerson dso) throws SQLException
updateLastModified in interface DSpaceObjectService<EPerson>SQLExceptionpublic String getMetadata(EPerson dso, String field)
DSpaceObjectServicegetMetadata in interface DSpaceObjectService<EPerson>getMetadata in class DSpaceObjectServiceImpl<EPerson>dso - DSpaceObjectfield - the name of the metadata field to getpublic void setMetadata(Context context, EPerson ePerson, String field, String value) throws SQLException
EPersonServicesetMetadata in interface EPersonServicecontext - 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 setSQLException - if the requested metadata field doesn't existpublic List<EPerson> findUnsalted(Context context) throws SQLException
EPersonServicefindUnsalted in interface EPersonServicecontext - The relevant DSpace Context.SQLException - An exception that provides information on a database access error or other errors.public List<EPerson> findNotActiveSince(Context context, Date date) throws SQLException
EPersonServicefindNotActiveSince in interface EPersonServicecontext - The relevant DSpace Context.date - from which dateSQLException - An exception that provides information on a database access error or other errors.public int countTotal(Context context) throws SQLException
EPersonServicecountTotal in interface EPersonServicecontext - The relevant DSpace Context.SQLException - An exception that provides information on a database access error or other errors.Copyright © 2019 DuraSpace. All rights reserved.