Package org.dspace.eperson.service
Interface AccountService
- All Known Implementing Classes:
AccountServiceImpl
public interface AccountService
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
-
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteToken(Context context, String token) booleanexistsAccountFor(Context context, String token) Checks if exists an account related to the token providedbooleanexistsAccountWithEmail(Context context, String email) Checks if exists an account related to the email providedgetEPerson(Context context, String token) booleanisTokenValidForCreation(RegistrationData registrationData) Checks if theRegistrationData.tokenis valid.Merge registration data with an existing EPerson or create a new one.renewRegistrationForEmail(Context context, RegistrationDataPatch registrationDataPatch) This method creates a fresh newRegistrationDatabased on theRegistrationDataPatchrequested by a given user.voidsendForgotPasswordInfo(Context context, String email) voidsendRegistrationInfo(Context context, String email)
-
Method Details
-
sendRegistrationInfo
void sendRegistrationInfo(Context context, String email) throws SQLException, IOException, jakarta.mail.MessagingException, AuthorizeException - Throws:
SQLExceptionIOExceptionjakarta.mail.MessagingExceptionAuthorizeException
-
sendForgotPasswordInfo
void sendForgotPasswordInfo(Context context, String email) throws SQLException, IOException, jakarta.mail.MessagingException, AuthorizeException - Throws:
SQLExceptionIOExceptionjakarta.mail.MessagingExceptionAuthorizeException
-
existsAccountFor
Checks if exists an account related to the token provided- Parameters:
context- DSpace contexttoken- Account token- Returns:
- true if exists, false otherwise
- Throws:
SQLExceptionAuthorizeException
-
existsAccountWithEmail
Checks if exists an account related to the email provided- Parameters:
context- DSpace contextemail- String email to search for- Returns:
- true if exists, false otherwise
- Throws:
SQLException
-
getEPerson
- Throws:
SQLExceptionAuthorizeException
-
getEmail
- Throws:
SQLException
-
deleteToken
- Throws:
SQLException
-
mergeRegistration
EPerson mergeRegistration(Context context, UUID userId, String token, List<String> overrides) throws AuthorizeException, SQLException Merge registration data with an existing EPerson or create a new one.- Parameters:
context- DSpace contextuserId- The ID of the EPerson to merge with or createtoken- The token to use for registration dataoverrides- List of fields to override in the EPerson- Returns:
- The merged or created EPerson
- Throws:
AuthorizeException- If the user is not authorized to perform the actionSQLException- If a database error occurs
-
renewRegistrationForEmail
RegistrationData renewRegistrationForEmail(Context context, RegistrationDataPatch registrationDataPatch) throws AuthorizeException This method creates a fresh newRegistrationDatabased on theRegistrationDataPatchrequested by a given user.- Parameters:
context- - The DSapce ContextregistrationDataPatch- - Details of the patch request coming from the Controller- Returns:
- a newly created
RegistrationData - Throws:
AuthorizeException
-
isTokenValidForCreation
Checks if theRegistrationData.tokenis valid.- Parameters:
registrationData- that will be checked- Returns:
- true if valid, false otherwise
-