package org.yacos.core.conferences;

import java.util.Date;
import java.util.List;

import javax.ejb.Remote;

import org.yacos.core.evaluation.Criterion;
import org.yacos.core.exceptions.ConferenceDoesntExistException;
import org.yacos.core.system.InvitationToken;
import org.yacos.core.system.InvitationTokenPK;
import org.yacos.core.users.Role;
import org.yacos.core.users.User;
import org.yacos.core.users.Role.RoleType;

@Remote
public interface IConferenceManager {
    
	// CRUD methods
	public Conference addConference(String titre, String descirption, String infoComplementray, Date dataAbstract, Date dateArticle, Date dateEvaluation, Date dateStart, Date dateEnd);
	public Conference getConference(Integer id);
	public void addCriterionToConference(Integer conferenceId,String name,Integer minRating, Integer maxRating);
	public void removeCriterionToConference(Integer conferenceId);
	public void removeOneCriterionToConference(Criterion criterion);
	public void addPCMemberToConference(Integer conferenceId, String userLogin);
	public void removePCMemberForConf(Integer confId);
	
	public void remove(Integer conferenceId);
	public void update(Conference conf);
	
	//article methodes
	//FIXME 
	//methode a gicler ?
	//public void addArticle(User user);
	//public Collection<Article> getArticles(Integer id);
	
	// Listing methods
	public List<Conference> getConferences();
	public List<Conference> getConferences(User user);
	
		
	// Role and User management methods
	public Role addRole(Role.RoleType roleType, String login, Integer confId);
	public void removeRole(Role role);
	public List<Role> getRoles(Conference conf);
	public List<Role> getRoles(String userLogin, Integer confId);
	public void updateRole(Role role);
	public boolean exists(Integer conferenceId);
	
	// Invitation management methods
	public InvitationToken getInvitationToken(InvitationTokenPK tokenId);
	public List<InvitationToken> getInvitationTokensForConference(Integer conferenceId);
	public InvitationToken addInvitationToken(String email, RoleType role, Integer conferenceId) throws ConferenceDoesntExistException;
	public void removeInvitationToken(InvitationToken tokenId);
}
