/*
 * Copyright 2002-2008 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
*/
package com.sds.emp.user.services;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.sds.emp.common.EmpException;
import com.sds.emp.common.Page;

public interface UserService {

	String ROLE = UserService.class.getName();

	/** Logger object. */
	Log LOGGER = LogFactory.getLog(UserService.class);

	/**
	 * Returns User List as <code>Page</code> Object.
	 * 
	 * @param searchVO
	 *            Search Object.
	 * @return <code>Page</code> containing user List.
	 * @throws EmpException
	 *             if query fails.
	 */
	Page getUserList(SearchVO searchVO) throws EmpException;

	/**
	 * Returns <code>UserVO</code> for the userid passed.
	 * 
	 * @param userId
	 *            user id for which search will happen.
	 * @return UserVO object
	 * @throws EmpException
	 *             if </code>UserVo</code> is not found or if any exception is
	 *             raised.
	 */
	UserVO getUser(String userId) throws EmpException;

	/**
	 * Adds User.
	 * 
	 * @param userVO
	 *            User Info
	 * @throws EmpException
	 *             if add query fails.
	 */
	void addUser(UserVO userVO) throws EmpException;

	/**
	 * Update User.
	 * 
	 * @param userVO
	 *            User Info
	 * @throws EmpException
	 *             if update query fails or if user id is not found.
	 */
	void updateUser(UserVO userVO) throws EmpException;

	/**
	 * check for duplicate user id.
	 * 
	 * @param userId
	 *            user id to be searched
	 * @return <code>true</code> if user exist else <code>false</code>
	 * @throws EmpException
	 *             if query fails
	 */
	boolean checkDuplication(String userId) throws EmpException;

	void updateUserList(UserVO newUser, UserVO updateUser) throws EmpException;
	
	void getUserWithException() throws EmpException;
}

