/******************************************************************************
 * CrudLogic.java - created by Sakai App Builder -AZ
 * 
 * Copyright (c) 2007 Sakai Project/Sakai Foundation
 * Licensed under the Educational Community License version 1.0
 * 
 * A copy of the Educational Community License has been included in this 
 * distribution and is available at: http://www.opensource.org/licenses/ecl1.php
 * 
 *****************************************************************************/

package org.sakaiproject.wontovlab.logic;

import java.io.IOException;
import java.io.InputStream;
import java.util.List;

import org.sakaiproject.wontovlab.model.Experiment;



/**
 * This is the interface for the app Logic, 
 * @author Sakai App Builder -AZ
 */
public interface ExperimentLogic 
{

    public List listExperiments(String locationId, String userId);
    
    public List listExperimentByExperimentName(String experimentName);
    
	public List findExperimentByExperimentId(Long experimentId);
    
	public void saveExperiment(Experiment experiment);

	public void removeExperiment(Experiment experiment);
	
	public void saveExperimentImage(Experiment experiment, String fileName, InputStream data) throws IOException;
	
	public String getExperimentImageName(Experiment experiment);
	
	public boolean deleteExperimentImage(long experimentId);
	
	public boolean canEditExperiment(Experiment experiment, String locationId, String userId);
	
	public boolean canReadExperiment(Experiment experiment, String locationId, String userId);
	
	public boolean canDeleteExperiment(Experiment experiment, String locationId, String userId);
	
	public boolean canCreateExperiments(String locationId, String userId);
	

}
