All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.dspace.eperson.service.AccountService Maven / Gradle / Ivy

There is a newer version: 8.0
Show newest version
/**
 * The contents of this file are subject to the license and copyright
 * detailed in the LICENSE and NOTICE files at the root of the source
 * tree and available online at
 *
 * http://www.dspace.org/license/
 */
package org.dspace.eperson.service;

import java.io.IOException;
import java.sql.SQLException;
import javax.mail.MessagingException;

import org.dspace.authorize.AuthorizeException;
import org.dspace.core.Context;
import org.dspace.eperson.EPerson;

/**
 * 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
 *
 * @author Peter Breton
 * @version $Revision$
 */
public interface AccountService {

    public void sendRegistrationInfo(Context context, String email)
        throws SQLException, IOException, MessagingException, AuthorizeException;

    public void sendForgotPasswordInfo(Context context, String email)
        throws SQLException, IOException, MessagingException, AuthorizeException;

    public EPerson getEPerson(Context context, String token)
        throws SQLException, AuthorizeException;


    public String getEmail(Context context, String token)
        throws SQLException;

    public void deleteToken(Context context, String token)
        throws SQLException;

    /**
     * This method verifies that a certain String adheres to the password rules for DSpace
     * @param password  The String to be checked
     * @return          A boolean indicating whether or not the given String adheres to the password rules
     */
    public boolean verifyPasswordStructure(String password);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy