de.alpharogroup.user.rest.api.ResetPasswordsResource Maven / Gradle / Ivy
package de.alpharogroup.user.rest.api;
import javax.ws.rs.Consumes;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import de.alpharogroup.collections.pairs.KeyValuePair;
import de.alpharogroup.service.rs.RestfulResource;
import de.alpharogroup.user.domain.ResetPassword;
import de.alpharogroup.user.domain.User;
/**
* The interface {@link ResetPasswordsResource} provides methods for reset passwords from user
* objects.
*/
@Path("/reset/passwords/")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public interface ResetPasswordsResource extends RestfulResource
{
/**
* Find the entry from the given {@link User} and the given generated password(hashed).
*
* @param userAndGenPw The key is the user and the value the generated password(hashed) is the confirmationCode from the url query string.
* @return the entry of the found {@link ResetPassword} or null if not found
*/
@POST
@Path("/find/by/gpw")
ResetPassword findResetPassword(final KeyValuePair userAndGenPw);
/**
* Finds the {@link ResetPassword} object from the given {@link User} object.
*
* @param user the user
* @return the entry of the found {@link ResetPassword} or null if not found
*/
@POST
@Path("/find")
ResetPassword findResetPassword(User user);
}