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"
25 // BatchManager::BatchManager(string host) throw(InvalidArgumentException) : _hostname(host), jobid_map()
27 // // On verifie que le hostname est correct
28 // if (!gethostbyname(_hostname.c_str())) { // hostname unknown from network
29 // string msg = "hostname \"";
31 // msg += "\" unknown from the network";
32 // throw InvalidArgumentException(msg.c_str());
35 BatchManager::BatchManager(const FactBatchManager * parent, const char * host) throw(InvalidArgumentException) : _hostname(host), jobid_map(), _parent(parent)
37 // On verifie que le hostname est correct
38 if (!gethostbyname(_hostname.c_str())) { // hostname unknown from network
39 string msg = "hostname \"";
41 msg += "\" unknown from the network";
42 throw InvalidArgumentException(msg.c_str());
47 BatchManager::~BatchManager()
52 string BatchManager::__repr__() const
55 oss << "<BatchManager of type '" << (_parent ? _parent->getType() : "unknown (no factory)") << "' connected to server '" << _hostname << "'>";
59 // Recupere le l'identifiant d'un job deja soumis au BatchManager
60 // const JobId BatchManager::getJobIdByReference(const string & ref)
62 // return JobId(this, ref);
64 const JobId BatchManager::getJobIdByReference(const char * ref)
66 return JobId(this, ref);
69 // // Methode pour le controle des jobs : soumet un job au gestionnaire
70 // const JobId BatchManager::submitJob(const Job & job)
72 // static int idx = 0;
73 // //MEDMEM::STRING sst;
75 // sst << "Jobid_" << idx++;
76 // JobId id(this, sst.str());
80 // // Methode pour le controle des jobs : retire un job du gestionnaire
81 // void BatchManager::deleteJob(const JobId & jobid)
86 // // Methode pour le controle des jobs : suspend un job en file d'attente
87 // void BatchManager::holdJob(const JobId & jobid)
92 // // Methode pour le controle des jobs : relache un job suspendu
93 // void BatchManager::releaseJob(const JobId & jobid)
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)
104 // // Methode pour le controle des jobs : modifie un job en file d'attente
105 // void BatchManager::alterJob(const JobId & jobid, const Parametre & param)
110 // // Methode pour le controle des jobs : modifie un job en file d'attente
111 // void BatchManager::alterJob(const JobId & jobid, const Environnement & env)
116 // // Methode pour le controle des jobs : renvoie l'etat du job
117 // JobInfo BatchManager::queryJob(const JobId & jobid)