4 * Auteur : Ivan DUTKA-MALEN - EDF R&D
5 * Date : Septembre 2003
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"
26 // BatchManager::BatchManager(string host) throw(InvalidArgumentException) : _hostname(host), jobid_map()
28 // // On verifie que le hostname est correct
29 // if (!gethostbyname(_hostname.c_str())) { // hostname unknown from network
30 // string msg = "hostname \"";
32 // msg += "\" unknown from the network";
33 // throw InvalidArgumentException(msg.c_str());
36 BatchManager::BatchManager(const FactBatchManager * parent, const char * host) throw(InvalidArgumentException) : _hostname(host), jobid_map(), _parent(parent)
38 // On verifie que le hostname est correct
39 if (!gethostbyname(_hostname.c_str())) { // hostname unknown from network
40 string msg = "hostname \"";
42 msg += "\" unknown from the network";
43 throw InvalidArgumentException(msg.c_str());
48 BatchManager::~BatchManager()
53 string BatchManager::__repr__() const
56 oss << "<BatchManager of type '" << (_parent ? _parent->getType() : "unknown (no factory)") << "' connected to server '" << _hostname << "'>";
60 // Recupere le l'identifiant d'un job deja soumis au BatchManager
61 // const JobId BatchManager::getJobIdByReference(const string & ref)
63 // return JobId(this, ref);
65 const JobId BatchManager::getJobIdByReference(const char * ref)
67 return JobId(this, ref);
70 // // Methode pour le controle des jobs : soumet un job au gestionnaire
71 // const JobId BatchManager::submitJob(const Job & job)
73 // static int idx = 0;
74 // //MEDMEM::STRING sst;
76 // sst << "Jobid_" << idx++;
77 // JobId id(this, sst.str());
81 // // Methode pour le controle des jobs : retire un job du gestionnaire
82 // void BatchManager::deleteJob(const JobId & jobid)
87 // // Methode pour le controle des jobs : suspend un job en file d'attente
88 // void BatchManager::holdJob(const JobId & jobid)
93 // // Methode pour le controle des jobs : relache un job suspendu
94 // void BatchManager::releaseJob(const JobId & jobid)
99 // // Methode pour le controle des jobs : modifie un job en file d'attente
100 // void BatchManager::alterJob(const JobId & jobid, const Parametre & param, const Environnement & env)
105 // // Methode pour le controle des jobs : modifie un job en file d'attente
106 // void BatchManager::alterJob(const JobId & jobid, const Parametre & param)
111 // // Methode pour le controle des jobs : modifie un job en file d'attente
112 // void BatchManager::alterJob(const JobId & jobid, const Environnement & env)
117 // // Methode pour le controle des jobs : renvoie l'etat du job
118 // JobInfo BatchManager::queryJob(const JobId & jobid)