/**********************************************************************************
 * $URL: https://source.sakaiproject.org/svn/profile/tags/sakai_2-3-1/profile-api/src/java/org/sakaiproject/api/app/profile/ProfileManager.java $
 * $Id: ProfileManager.java 8424 2006-04-27 20:23:44Z ggolden@umich.edu $
 ***********************************************************************************
 *
 * Copyright (c) 2003, 2004, 2005, 2006 The Sakai Foundation.
 * 
 * Licensed under the Educational Community License, Version 1.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.opensource.org/licenses/ecl1.php
 * 
 * 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 org.sakaiproject.api.app.profile;

import java.util.List;

/**
 * @author rshastri
 */
public interface ProfileManager
{
	public void init();

	public void destroy();

	/**
	 * Save or Update an existing profile
	 * 
	 * @param profile
	 */
	public void save(Profile profile);

	/**
	 * Returns user mutable profile of currently logged in user
	 * 
	 * @return
	 */
	public Profile getProfile();

	/**
	 * Searches the list of user profiles matching given search criteria
	 * 
	 * @param searchString
	 * @return
	 */
	public List findProfiles(String searchString);

	/**
	 * Searches the university photo for given username
	 * 
	 * @param uid
	 * @return
	 */
	public byte[] getInstitutionalPhotoByUserId(String uid);

	/**
	 * Allow user with update access to site view id photo of member users
	 * 
	 * @param uid
	 * @param siteMaintainer
	 * @return
	 */
	public byte[] getInstitutionalPhotoByUserId(String uid, boolean siteMaintainer);

	// Helper methods
	/**
	 * @param profile
	 * @return
	 */
	public boolean displayCompleteProfile(Profile profile);

	/**
	 * @param profile
	 * @return
	 */
	public boolean isCurrentUserProfile(Profile profile);

	/**
	 * @param profile
	 * @return
	 */
	public boolean isDisplayPictureURL(Profile profile);

	/**
	 * @param profile
	 * @return
	 */
	public boolean isDisplayUniversityPhoto(Profile profile);

	/**
	 * @param profile
	 * @return
	 */
	public boolean isDisplayUniversityPhotoUnavailable(Profile profile);

	/**
	 * @param profile
	 * @return
	 */
	public boolean isDisplayNoPhoto(Profile profile);

	/**
	 * @param profile
	 * @return
	 */
	public boolean isShowTool();

	/**
	 * @param id
	 * @return
	 */
	public Profile getUserProfileById(String id);

	/**
	 * @param userId
	 * @return
	 */
	public String getAgentUuidByEnterpriseId(String userId);

	/**
	 * @param agentUuid
	 * @return
	 */
	public String getEnterpriseIdByAgentUuid(String agentUuid);
}
