Salome HOME
581ed7cc994b02ae6c8e2afe3582e0fdafa11571
[tools/libbatch.git] / src / PBS / Batch_BatchManager_PBS.hxx
1 //  Copyright (C) 2007-2010  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 //  This library is free software; you can redistribute it and/or
7 //  modify it under the terms of the GNU Lesser General Public
8 //  License as published by the Free Software Foundation; either
9 //  version 2.1 of the License.
10 //
11 //  This library is distributed in the hope that it will be useful,
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 //  Lesser General Public License for more details.
15 //
16 //  You should have received a copy of the GNU Lesser General Public
17 //  License along with this library; if not, write to the Free Software
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 /*
23  * BatchManager_PBS.hxx : 
24  *
25  * Auteur : Ivan DUTKA-MALEN - EDF R&D
26  * Mail   : mailto:ivan.dutka-malen@der.edf.fr
27  * Date   : Thu Nov  6 10:17:22 2003
28  * Projet : Salome 2
29  *
30  */
31
32 #ifndef _BATCHMANAGER_PBS_H_
33 #define _BATCHMANAGER_PBS_H_
34
35 #include "Batch_Defines.hxx"
36
37 #include "Batch_Job.hxx"
38 #include "Batch_Job.hxx"
39 #include "Batch_JobId.hxx"
40 #include "Batch_JobInfo.hxx"
41 #include "Batch_JobInfo_PBS.hxx"
42 #include "Batch_Job_PBS.hxx"
43 #include "Batch_InvalidArgumentException.hxx"
44 #include "Batch_ConnexionFailureException.hxx"
45 #include "Batch_APIInternalFailureException.hxx"
46 #include "Batch_NotYetImplementedException.hxx"
47 #include "Batch_BatchManager.hxx"
48
49 namespace Batch {
50
51   class Job;
52   class JobId;
53   class JobInfo;
54   class FactBatchManager;
55
56   class BATCH_EXPORT BatchManager_PBS : public BatchManager
57   {
58   public:
59     // Constructeur et destructeur
60     //BatchManager_PBS() throw(InvalidArgumentException,ConnexionFailureException); // connexion au serveur par defaut
61     //BatchManager_PBS(std::string host) throw(InvalidArgumentException,ConnexionFailureException); // connexion a la machine host
62     BatchManager_PBS(const FactBatchManager * parent, const char * host="localhost") throw(InvalidArgumentException,ConnexionFailureException); // connexion a la machine host
63     virtual ~BatchManager_PBS();
64
65     // Recupere le nom du serveur par defaut
66     // static std::string BatchManager_PBS::getDefaultServer();
67
68     // Methodes pour le controle des jobs
69     virtual const JobId submitJob(const Job & job); // soumet un job au gestionnaire
70     virtual void deleteJob(const JobId & jobid); // retire un job du gestionnaire
71     virtual void holdJob(const JobId & jobid); // suspend un job en file d'attente
72     virtual void releaseJob(const JobId & jobid); // relache un job suspendu
73     virtual void alterJob(const JobId & jobid, const Parametre & param, const Environnement & env); // modifie un job en file d'attente
74     virtual void alterJob(const JobId & jobid, const Parametre & param); // modifie un job en file d'attente
75     virtual void alterJob(const JobId & jobid, const Environnement & env); // modifie un job en file d'attente
76     virtual JobInfo queryJob(const JobId & jobid); // renvoie l'etat du job
77
78     virtual void setParametre(const JobId & jobid, const Parametre & param) { return alterJob(jobid, param); } // modifie un job en file d'attente
79     virtual void setEnvironnement(const JobId & jobid, const Environnement & env) { return alterJob(jobid, env); } // modifie un job en file d'attente
80
81     virtual const Batch::JobId addJob(const Batch::Job & job, const std::string reference); // ajoute un nouveau job sans le soumettre
82
83
84   protected:
85     std::string getErrorMessage(const char * operation) const;
86
87     int _connect; // PBS connect id
88
89   private:
90
91 #ifdef SWIG
92   public:
93     // Recupere le l'identifiant d'un job deja soumis au BatchManager
94     //virtual const JobId getJobIdByReference(const std::string & ref) { return BatchManager::getJobIdByReference(ref); }
95     virtual const JobId getJobIdByReference(const char * ref) { return BatchManager::getJobIdByReference(ref); }
96 #endif
97
98   };
99
100 }
101
102 #endif