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
38 //#include "MEDMEM_STRING.hxx"
39 #include "Batch_Job.hxx"
40 #include "Batch_JobId.hxx"
41 #include "Batch_JobInfo.hxx"
42 #include "Batch_InvalidArgumentException.hxx"
43 #include "Batch_FactBatchManager.hxx"
44 #include "Batch_BatchManager.hxx"
50 // BatchManager::BatchManager(string host) throw(InvalidArgumentException) : _hostname(host), jobid_map()
52 // // On verifie que le hostname est correct
53 // if (!gethostbyname(_hostname.c_str())) { // hostname unknown from network
54 // string msg = "hostname \"";
56 // msg += "\" unknown from the network";
57 // throw InvalidArgumentException(msg.c_str());
60 BatchManager::BatchManager(const FactBatchManager * parent, const char * host) throw(InvalidArgumentException) : _hostname(host), jobid_map(), _parent(parent)
62 // On verifie que le hostname est correct
63 if (!gethostbyname(_hostname.c_str())) { // hostname unknown from network
64 string msg = "hostname \"";
66 msg += "\" unknown from the network";
67 throw InvalidArgumentException(msg.c_str());
72 BatchManager::~BatchManager()
77 string BatchManager::__repr__() const
80 oss << "<BatchManager of type '" << (_parent ? _parent->getType() : "unknown (no factory)") << "' connected to server '" << _hostname << "'>";
84 // Recupere le l'identifiant d'un job deja soumis au BatchManager
85 // const JobId BatchManager::getJobIdByReference(const string & ref)
87 // return JobId(this, ref);
89 const JobId BatchManager::getJobIdByReference(const char * ref)
91 return JobId(this, ref);
94 // // Methode pour le controle des jobs : soumet un job au gestionnaire
95 // const JobId BatchManager::submitJob(const Job & job)
97 // static int idx = 0;
98 // //MEDMEM::STRING sst;
100 // sst << "Jobid_" << idx++;
101 // JobId id(this, sst.str());
105 // // Methode pour le controle des jobs : retire un job du gestionnaire
106 // void BatchManager::deleteJob(const JobId & jobid)
111 // // Methode pour le controle des jobs : suspend un job en file d'attente
112 // void BatchManager::holdJob(const JobId & jobid)
117 // // Methode pour le controle des jobs : relache un job suspendu
118 // void BatchManager::releaseJob(const JobId & jobid)
123 // // Methode pour le controle des jobs : modifie un job en file d'attente
124 // void BatchManager::alterJob(const JobId & jobid, const Parametre & param, const Environnement & env)
129 // // Methode pour le controle des jobs : modifie un job en file d'attente
130 // void BatchManager::alterJob(const JobId & jobid, const Parametre & param)
135 // // Methode pour le controle des jobs : modifie un job en file d'attente
136 // void BatchManager::alterJob(const JobId & jobid, const Environnement & env)
141 // // Methode pour le controle des jobs : renvoie l'etat du job
142 // JobInfo BatchManager::queryJob(const JobId & jobid)