Salome HOME
Update copyrights
[tools/libbatch.git] / src / SSH / Batch_BatchManager_eSSH.hxx
1 //  Copyright (C) 2007-2012  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_eSSH.hxx : emulation of SSH client
24  *
25  * Auteur : André RIBES - EDF R&D
26  * Date   : Octobre 2009
27  */
28
29 #ifndef _BATCHMANAGER_ESSH_H_
30 #define _BATCHMANAGER_ESSH_H_
31
32 #include "Batch_Defines.hxx"
33 #include "Batch_JobId.hxx"
34 #include "Batch_JobInfo.hxx"
35 #include "Batch_FactBatchManager.hxx"
36 #include "Batch_BatchManager_eClient.hxx"
37 #include "Batch_BatchManager_Local.hxx"
38
39 namespace Batch {
40
41   class BATCH_EXPORT BatchManager_eSSH : 
42     virtual public BatchManager_eClient,
43     virtual public BatchManager_Local
44   {
45   public:
46     // Constructeur et destructeur
47     BatchManager_eSSH(const FactBatchManager * parent, const char * host="localhost",
48                       const char * username="",
49                       CommunicationProtocolType protocolType = SSH, const char * mpiImpl="nompi"); // connexion a la machine host
50     virtual ~BatchManager_eSSH();
51
52     // Recupere le nom du serveur par defaut
53     // static string BatchManager_LSF::getDefaultServer();
54
55     // Methodes pour le controle des jobs
56     virtual const JobId submitJob(const Job & job); // soumet un job au gestionnaire
57     virtual void deleteJob(const JobId & jobid);    // retire un job du gestionnaire
58     virtual JobInfo queryJob(const JobId & jobid);  // renvoie l'etat du job
59
60     // Non implanté...
61     virtual void holdJob(const JobId & jobid); // suspend un job en file d'attente
62     virtual void releaseJob(const JobId & jobid); // relache un job suspendu
63     virtual void alterJob(const JobId & jobid, const Parametre & param, const Environnement & env); // modifie un job en file d'attente
64     virtual void alterJob(const JobId & jobid, const Parametre & param); // modifie un job en file d'attente
65     virtual void alterJob(const JobId & jobid, const Environnement & env); // modifie un job en file d'attente
66
67
68   protected:
69     void buildBatchScript(const Job & job);
70
71   private:
72
73 #ifdef SWIG
74   public:
75     // Recupere le l'identifiant d'un job deja soumis au BatchManager
76     //virtual const JobId getJobIdByReference(const string & ref) { return BatchManager::getJobIdByReference(ref); }
77     virtual const JobId getJobIdByReference(const char * ref) { return BatchManager::getJobIdByReference(ref); }
78 #endif
79   };
80 }
81
82 #endif