]> SALOME platform Git repositories - modules/kernel.git/blob - src/Batch/Batch_BatchManager.cxx
Salome HOME
e84d3bdaf60fc82f5664c8f3e3e83b1fd70b9165
[modules/kernel.git] / src / Batch / Batch_BatchManager.cxx
1 /*
2  * BatchManager.cxx : 
3  *
4  * Auteur : Ivan DUTKA-MALEN - EDF R&D
5  * Date   : Septembre 2003
6  * Projet : SALOME 2
7  *
8  */
9
10 #include <iostream>
11 #include <sstream>
12 #include <string>
13 #include <netdb.h>
14 //#include "MEDMEM_STRING.hxx"
15 #include "Batch_Job.hxx"
16 #include "Batch_JobId.hxx"
17 #include "Batch_JobInfo.hxx"
18 #include "Batch_InvalidArgumentException.hxx"
19 #include "Batch_FactBatchManager.hxx"
20 #include "Batch_BatchManager.hxx"
21
22 namespace Batch {
23
24   // Constructeur
25 //   BatchManager::BatchManager(string host) throw(InvalidArgumentException) : _hostname(host), jobid_map()
26 //   {
27 //     // On verifie que le hostname est correct
28 //     if (!gethostbyname(_hostname.c_str())) { // hostname unknown from network
29 //       string msg = "hostname \"";
30 //       msg += _hostname;
31 //       msg += "\" unknown from the network";
32 //       throw InvalidArgumentException(msg.c_str());
33 //     }
34 //   }
35   BatchManager::BatchManager(const FactBatchManager * parent, const char * host) throw(InvalidArgumentException) : _hostname(host), jobid_map(), _parent(parent)
36   {
37     // On verifie que le hostname est correct
38     if (!gethostbyname(_hostname.c_str())) { // hostname unknown from network
39       string msg = "hostname \"";
40       msg += _hostname;
41       msg += "\" unknown from the network";
42       throw InvalidArgumentException(msg.c_str());
43     }
44   }
45
46   // Destructeur
47   BatchManager::~BatchManager()
48   {
49     // Nothing to do
50   }
51
52   string BatchManager::__repr__() const
53   {
54     ostringstream oss;
55     oss << "<BatchManager of type '" << (_parent ? _parent->getType() : "unknown (no factory)") << "' connected to server '" << _hostname << "'>";
56     return oss.str();
57   }
58
59   // Recupere le l'identifiant d'un job deja soumis au BatchManager
60 //   const JobId BatchManager::getJobIdByReference(const string & ref)
61 //   {
62 //     return JobId(this, ref);
63 //   }
64   const JobId BatchManager::getJobIdByReference(const char * ref)
65   {
66     return JobId(this, ref);
67   }
68
69 //   // Methode pour le controle des jobs : soumet un job au gestionnaire
70 //   const JobId BatchManager::submitJob(const Job & job)
71 //   {
72 //     static int idx = 0;
73 //     //MEDMEM::STRING sst;
74 //     ostringstream sst;
75 //     sst << "Jobid_" << idx++;
76 //     JobId id(this, sst.str());
77 //     return id;
78 //   }
79
80 //   // Methode pour le controle des jobs : retire un job du gestionnaire
81 //   void BatchManager::deleteJob(const JobId & jobid)
82 //   {
83 //     // Nothing to do
84 //   }
85    
86 //   // Methode pour le controle des jobs : suspend un job en file d'attente
87 //   void BatchManager::holdJob(const JobId & jobid)
88 //   {
89 //     // Nothing to do
90 //   }
91
92 //   // Methode pour le controle des jobs : relache un job suspendu
93 //   void BatchManager::releaseJob(const JobId & jobid)
94 //   {
95 //     // Nothing to do
96 //   }
97
98 //   // Methode pour le controle des jobs : modifie un job en file d'attente
99 //   void BatchManager::alterJob(const JobId & jobid, const Parametre & param, const Environnement & env)
100 //   {
101 //     // Nothing to do
102 //   }
103
104 //   // Methode pour le controle des jobs : modifie un job en file d'attente
105 //   void BatchManager::alterJob(const JobId & jobid, const Parametre & param)
106 //   {
107 //     // Nothing to do
108 //   }
109
110 //   // Methode pour le controle des jobs : modifie un job en file d'attente
111 //   void BatchManager::alterJob(const JobId & jobid, const Environnement & env)
112 //   {
113 //     // Nothing to do
114 //   }
115
116 //   // Methode pour le controle des jobs : renvoie l'etat du job
117 //   JobInfo BatchManager::queryJob(const JobId & jobid)
118 //   {
119 //     return JobInfo();
120 //   }
121
122 }