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

br.com.jhonsapp.finaluser.service.UserService Maven / Gradle / Ivy

The newest version!
package br.com.jhonsapp.finaluser.service;

import java.util.List;

import javax.ejb.Remote;

import br.com.jhonsapp.bootstrap.object.service.generic.Service;
import br.com.jhonsapp.finaluser.domain.User;

/**
 * This interface describes the methods that all user service classes, from the
 * same project, should have.
 * 
 * @param 
 *            Type of the object to be manipulated by the class.
 * 
 * @see Service
 * 
 * @author Jhonathan Camacho
 * 
 */
@Remote
public interface UserService extends Service {

	/**
	 * Find all persisted user.
	 * 
	 * @return a list with all user persisted in the database.
	 */
	public List findAll();

	/**
	 * Find all persisted users based on a id range.
	 * 
	 * @param first
	 *            the initial user id of the query range.
	 * @param pageSize
	 *            the last user id of the query range.
	 * @return a list with the users that satisfy the range or a empty list
	 *         otherwise.
	 */
	public List findAllWithPagination(int first, int pageSize);

	/**
	 * Search the total amount of users.
	 * 
	 * @return the total amount of users.
	 */
	public Long usersSize();

	/**
	 * Updates the user access token.
	 * 
	 * @param user
	 *            the user to be update access token
	 * 
	 * @return true if the access token was updated and false otherwise.
	 */
	public boolean updateAccessToken(T user);

	/**
	 * Search the user through the access token.
	 * 
	 * @param accessToken
	 *            access token to be searched
	 * 
	 * @return the user who owns the access token or null otherwise.
	 */
	public T findUserByAccessToken(String accessToken);

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy