Salome HOME
PR: new python function getShortHostName() in Utils_Identity.py, based on socket...
[modules/yacs.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 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 JobId getJobIdByReference(const char * ref);
39
40     // Methodes pour le controle des jobs : virtuelles pures
41     virtual const JobId submitJob(const Job & job) = 0; // soumet un job au gestionnaire
42     virtual void deleteJob(const JobId & jobid) = 0; // retire un job du gestionnaire
43     virtual void holdJob(const JobId & jobid) = 0; // suspend un job en file d'attente
44     virtual void releaseJob(const JobId & jobid) = 0; // relache un job suspendu
45     virtual void alterJob(const JobId & jobid, const Parametre & param, const Environnement & env) = 0; // modifie un job en file d'attente
46     virtual void alterJob(const JobId & jobid, const Parametre & param) = 0; // modifie un job en file d'attente
47     virtual void alterJob(const JobId & jobid, const Environnement & env) = 0; // modifie un job en file d'attente
48     virtual JobInfo queryJob(const 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 JobId * > jobid_map; // table des jobs deja soumis
53     const FactBatchManager * _parent;
54
55   private:
56
57   };
58
59 }
60
61 #endif