--- /dev/null
+package com.pentila.emawsconnector.manager;
+
+import java.util.List;
+import java.util.Set;
+
+import com.pentila.emawsconnector.dao.PlanDAO;
+import com.pentila.evalcomp.domain.definition.Referentiel;
+import com.pentila.evalcomp.domain.plan.Plan;
+
+
+
+public class PlanManager {
+
+
+ /**
+ * Obtenir un plan de formation existant.
+ * @param id identifiant du plan de formation
+ * @return retourne le plan
+ */
+ public Plan getPlan(Long id){
+ PlanDAO planDAO = new PlanDAO();
+ return planDAO.getPlan(id);
+ }
+
+
+ /**
+ * Obtenir la liste des plans de formation
+ * @return retourne la liste des plans de formation existants.
+ */
+ public List<Plan> getPlans(){
+ PlanDAO planDAO = new PlanDAO();
+ return planDAO.getPlans();
+ }
+
+
+ /**
+ * Créer un nouveau plan de formation
+ * @param nom nom du plan de formation
+ * @param organisation organisation (ou établissement)
+ * @param ville ville dans laquelle est présente l'organisation
+ * @return retourne le plan de formation crée (null en cas d'erreur)
+ */
+ public Plan addPlan(String nom, String organisation, String ville){
+ PlanDAO planDAO = new PlanDAO();
+ return planDAO.addPlan(nom, organisation, ville);
+ }
+
+ /**
+ * Ajoute un référentiel d'un plan.
+ * @param plan plan de formation
+ * @param referentiel le référentiel
+ * @return le plan mis à jour
+ */
+ public Plan addReferentiel(Plan plan, Referentiel referentiel){
+ PlanDAO planDAO = new PlanDAO();
+ return planDAO.addReferentiel(plan, referentiel);
+
+ }
+
+ /**
+ * enlève un référentiel d'un plan.
+ * @param plan le plan de formation
+ * @param referentiel le référentiel
+ * @return retourne le plan mis à jour
+ */
+ public Plan removeReferentiel(Plan plan, Referentiel referentiel){
+ PlanDAO planDAO = new PlanDAO();
+ return planDAO.removeReferentiel(plan, referentiel);
+
+ }
+
+
+ /**
+ * Ajout ou supprime des entités d'un rôle dans un plan
+ * @param plan plan de formation concerné
+ * @param logins logins des entités
+ * @param action action à effectuer ("add" ou "remove")
+ * @param role rôle concerné : "ROLE_MANAGER" ou "ROLE_PEDA" ou "ROLE_SCO"
+ * @return retourne un code d'erreur en fonction du résultat
+ */
+ public Plan updateEntities(Plan plan, Set<String> logins, String action, String role){
+ PlanDAO planDAO = new PlanDAO();
+ return planDAO.updateEntities(plan.getId(),logins,action,role);
+ }
+}