1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
25 * Auteur : Ivan DUTKA-MALEN - EDF R&D
26 * Date : Septembre 2003
40 //#include "MEDMEM_STRING.hxx"
41 #include "Batch_Job.hxx"
42 #include "Batch_JobId.hxx"
43 #include "Batch_JobInfo.hxx"
44 #include "Batch_InvalidArgumentException.hxx"
45 #include "Batch_FactBatchManager.hxx"
46 #include "Batch_BatchManager.hxx"
52 // BatchManager::BatchManager(string host) throw(InvalidArgumentException) : _hostname(host), jobid_map()
54 // // On verifie que le hostname est correct
55 // if (!gethostbyname(_hostname.c_str())) { // hostname unknown from network
56 // string msg = "hostname \"";
58 // msg += "\" unknown from the network";
59 // throw InvalidArgumentException(msg.c_str());
62 BatchManager::BatchManager(const FactBatchManager * parent, const char * host) throw(InvalidArgumentException) : _hostname(host), jobid_map(), _parent(parent)
64 // On verifie que le hostname est correct
65 if (!gethostbyname(_hostname.c_str())) { // hostname unknown from network
66 string msg = "hostname \"";
68 msg += "\" unknown from the network";
69 throw InvalidArgumentException(msg.c_str());
74 BatchManager::~BatchManager()
79 string BatchManager::__repr__() const
82 oss << "<BatchManager of type '" << (_parent ? _parent->getType() : "unknown (no factory)") << "' connected to server '" << _hostname << "'>";
86 // Recupere le l'identifiant d'un job deja soumis au BatchManager
87 // const JobId BatchManager::getJobIdByReference(const string & ref)
89 // return JobId(this, ref);
91 const JobId BatchManager::getJobIdByReference(const char * ref)
93 return JobId(this, ref);
96 // // Methode pour le controle des jobs : soumet un job au gestionnaire
97 // const JobId BatchManager::submitJob(const Job & job)
99 // static int idx = 0;
100 // //MEDMEM::STRING sst;
101 // ostringstream sst;
102 // sst << "Jobid_" << idx++;
103 // JobId id(this, sst.str());
107 // // Methode pour le controle des jobs : retire un job du gestionnaire
108 // void BatchManager::deleteJob(const JobId & jobid)
113 // // Methode pour le controle des jobs : suspend un job en file d'attente
114 // void BatchManager::holdJob(const JobId & jobid)
119 // // Methode pour le controle des jobs : relache un job suspendu
120 // void BatchManager::releaseJob(const JobId & jobid)
125 // // Methode pour le controle des jobs : modifie un job en file d'attente
126 // void BatchManager::alterJob(const JobId & jobid, const Parametre & param, const Environnement & env)
131 // // Methode pour le controle des jobs : modifie un job en file d'attente
132 // void BatchManager::alterJob(const JobId & jobid, const Parametre & param)
137 // // Methode pour le controle des jobs : modifie un job en file d'attente
138 // void BatchManager::alterJob(const JobId & jobid, const Environnement & env)
143 // // Methode pour le controle des jobs : renvoie l'etat du job
144 // JobInfo BatchManager::queryJob(const JobId & jobid)