1 // Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License.
9 // This library is distributed in the hope that it will be useful
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 * Auteur : Ivan DUTKA-MALEN - EDF R&D
24 * Date : Septembre 2003
33 //#include "MEDMEM_STRING.hxx"
34 #include "Batch_Job.hxx"
35 #include "Batch_JobId.hxx"
36 #include "Batch_JobInfo.hxx"
37 #include "Batch_InvalidArgumentException.hxx"
38 #include "Batch_FactBatchManager.hxx"
39 #include "Batch_BatchManager.hxx"
45 // BatchManager::BatchManager(string host) throw(InvalidArgumentException) : _hostname(host), jobid_map()
47 // // On verifie que le hostname est correct
48 // if (!gethostbyname(_hostname.c_str())) { // hostname unknown from network
49 // string msg = "hostname \"";
51 // msg += "\" unknown from the network";
52 // throw InvalidArgumentException(msg.c_str());
55 BatchManager::BatchManager(const FactBatchManager * parent, const char * host) throw(InvalidArgumentException) : _hostname(host), jobid_map(), _parent(parent)
57 // On verifie que le hostname est correct
58 if (!gethostbyname(_hostname.c_str())) { // hostname unknown from network
59 string msg = "hostname \"";
61 msg += "\" unknown from the network";
62 throw InvalidArgumentException(msg.c_str());
67 BatchManager::~BatchManager()
72 string BatchManager::__repr__() const
75 oss << "<BatchManager of type '" << (_parent ? _parent->getType() : "unknown (no factory)") << "' connected to server '" << _hostname << "'>";
79 // Recupere le l'identifiant d'un job deja soumis au BatchManager
80 // const JobId BatchManager::getJobIdByReference(const string & ref)
82 // return JobId(this, ref);
84 const JobId BatchManager::getJobIdByReference(const char * ref)
86 return JobId(this, ref);
89 // // Methode pour le controle des jobs : soumet un job au gestionnaire
90 // const JobId BatchManager::submitJob(const Job & job)
92 // static int idx = 0;
93 // //MEDMEM::STRING sst;
95 // sst << "Jobid_" << idx++;
96 // JobId id(this, sst.str());
100 // // Methode pour le controle des jobs : retire un job du gestionnaire
101 // void BatchManager::deleteJob(const JobId & jobid)
106 // // Methode pour le controle des jobs : suspend un job en file d'attente
107 // void BatchManager::holdJob(const JobId & jobid)
112 // // Methode pour le controle des jobs : relache un job suspendu
113 // void BatchManager::releaseJob(const JobId & jobid)
118 // // Methode pour le controle des jobs : modifie un job en file d'attente
119 // void BatchManager::alterJob(const JobId & jobid, const Parametre & param, const Environnement & env)
124 // // Methode pour le controle des jobs : modifie un job en file d'attente
125 // void BatchManager::alterJob(const JobId & jobid, const Parametre & param)
130 // // Methode pour le controle des jobs : modifie un job en file d'attente
131 // void BatchManager::alterJob(const JobId & jobid, const Environnement & env)
136 // // Methode pour le controle des jobs : renvoie l'etat du job
137 // JobInfo BatchManager::queryJob(const JobId & jobid)