public class AccountServiceImpl extends Object implements AccountService
| Modifier and Type | Field and Description |
|---|---|
protected EPersonService |
ePersonService |
protected RegistrationDataService |
registrationDataService |
| Modifier | Constructor and Description |
|---|---|
protected |
AccountServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
deleteToken(Context context,
String token)
Delete token.
|
String |
getEmail(Context context,
String token)
Return the e-mail address referred to by a token, or null if email
address can't be found ignores expiration of token
|
EPerson |
getEPerson(Context context,
String token)
Return the EPerson corresponding to token, where token was emailed to the
person by either the sendRegistrationInfo or sendForgotPasswordInfo
methods.
|
protected void |
sendEmail(Context context,
String email,
boolean isRegister,
RegistrationData rd)
Send a DSpace message to the given email address.
|
void |
sendForgotPasswordInfo(Context context,
String email)
Email forgot password info to the given email address.
|
protected RegistrationData |
sendInfo(Context context,
String email,
boolean isRegister,
boolean send) |
void |
sendRegistrationInfo(Context context,
String email)
Email registration info to the given email address.
|
@Autowired(required=true) protected EPersonService ePersonService
@Autowired(required=true) protected RegistrationDataService registrationDataService
public void sendRegistrationInfo(Context context, String email) throws SQLException, IOException, javax.mail.MessagingException, AuthorizeException
sendRegistrationInfo in interface AccountServicecontext - DSpace contextemail - Email address to send the registration email toSQLExceptionIOExceptionjavax.mail.MessagingExceptionAuthorizeExceptionpublic void sendForgotPasswordInfo(Context context, String email) throws SQLException, IOException, javax.mail.MessagingException, AuthorizeException
sendForgotPasswordInfo in interface AccountServicecontext - DSpace contextemail - Email address to send the forgot-password email toSQLExceptionIOExceptionjavax.mail.MessagingExceptionAuthorizeExceptionpublic EPerson getEPerson(Context context, String token) throws SQLException, AuthorizeException
Return the EPerson corresponding to token, where token was emailed to the person by either the sendRegistrationInfo or sendForgotPasswordInfo methods.
If the token is not found return null.
getEPerson in interface AccountServicecontext - DSpace contexttoken - Account tokenSQLException - If the token or eperson cannot be retrieved from the
database.AuthorizeExceptionpublic String getEmail(Context context, String token) throws SQLException
getEmail in interface AccountServicecontext - DSpace contexttoken - Account tokenSQLExceptionpublic void deleteToken(Context context, String token) throws SQLException
deleteToken in interface AccountServicecontext - DSpace contexttoken - The token to deleteSQLException - If a database error occursprotected RegistrationData sendInfo(Context context, String email, boolean isRegister, boolean send) throws SQLException, IOException, javax.mail.MessagingException, AuthorizeException
SQLExceptionIOExceptionjavax.mail.MessagingExceptionAuthorizeExceptionprotected void sendEmail(Context context, String email, boolean isRegister, RegistrationData rd) throws javax.mail.MessagingException, IOException, SQLException
true, this is registration email;
otherwise, it is a forgot-password email.email - The email address to mail toisRegister - If true, this is registration email; otherwise it is
forgot-password email.rd - The RDBMS row representing the registration data.javax.mail.MessagingException - If an error occurs while sending emailIOException - If an error occurs while reading the email template.SQLExceptionCopyright © 2016 DuraSpace. All rights reserved.