Salome HOME
Porting to Mandrake 10.1 and new products:
[modules/kernel.git] / src / Batch / Batch_BatchManager.hxx
1 /*
2  * BatchManager.hxx : 
3  *
4  * Auteur : Ivan DUTKA-MALEN - EDF R&D
5  * Date   : Septembre 2003
6  * Projet : SALOME 2
7  *
8  */
9
10 #ifndef _BATCHMANAGER_H_
11 #define _BATCHMANAGER_H_
12
13 #include <string>
14 #include <map>
15 #include "Batch_Job.hxx"
16 #include "Batch_JobId.hxx"
17 #include "Batch_JobInfo.hxx"
18 #include "Batch_InvalidArgumentException.hxx"
19
20 namespace Batch {
21
22   class Job;
23   class JobId;
24   class JobInfo;
25   class FactBatchManager;
26
27   class BatchManager
28   {
29   public:
30     // Constructeur et destructeur
31     //BatchManager(std::string host="localhost") throw(InvalidArgumentException); // connexion a la machine host
32     BatchManager(const Batch::FactBatchManager * parent, const char * host="localhost") throw(InvalidArgumentException); // connexion a la machine host
33     virtual ~BatchManager();
34     virtual std::string __repr__() const;
35
36     // Recupere le l'identifiant d'un job deja soumis au BatchManager
37     //virtual const JobId getJobIdByReference(const std::string & ref);
38     virtual const Batch::JobId getJobIdByReference(const char * ref);
39
40     // Methodes pour le controle des jobs : virtuelles pures
41     virtual const Batch::JobId submitJob(const Batch::Job & job) = 0; // soumet un job au gestionnaire
42     virtual void deleteJob(const Batch::JobId & jobid) = 0; // retire un job du gestionnaire
43     virtual void holdJob(const Batch::JobId & jobid) = 0; // suspend un job en file d'attente
44     virtual void releaseJob(const Batch::JobId & jobid) = 0; // relache un job suspendu
45     virtual void alterJob(const Batch::JobId & jobid, const Batch::Parametre & param, const Batch::Environnement & env) = 0; // modifie un job en file d'attente
46     virtual void alterJob(const Batch::JobId & jobid, const Batch::Parametre & param) = 0; // modifie un job en file d'attente
47     virtual void alterJob(const Batch::JobId & jobid, const Batch::Environnement & env) = 0; // modifie un job en file d'attente
48     virtual Batch::JobInfo queryJob(const Batch::JobId & jobid) = 0; // renvoie l'etat du job
49
50   protected:
51     std::string _hostname; // serveur ou tourne le BatchManager
52     // std::map< const std::string, const Batch::JobId * > jobid_map; // table des jobs deja soumis
53     std::map< std::string, const Batch::JobId * > jobid_map; // table des jobs deja soumis
54     const Batch::FactBatchManager * _parent;
55
56   private:
57
58   };
59
60 }
61
62 #endif