General KERNEL Documentation     End User KERNEL Services  


src/Batch/Batch_BatchManager.hxx

Go to the documentation of this file.
00001 // Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00002 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00003 // 
00004 // This library is free software; you can redistribute it and/or
00005 // modify it under the terms of the GNU Lesser General Public
00006 // License as published by the Free Software Foundation; either 
00007 // version 2.1 of the License.
00008 // 
00009 // This library is distributed in the hope that it will be useful 
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of 
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
00012 // Lesser General Public License for more details.
00013 //
00014 // You should have received a copy of the GNU Lesser General Public  
00015 // License along with this library; if not, write to the Free Software 
00016 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00017 //
00018 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00019 //
00020 /*
00021  * BatchManager.hxx : 
00022  *
00023  * Auteur : Ivan DUTKA-MALEN - EDF R&D
00024  * Date   : Septembre 2003
00025  * Projet : SALOME 2
00026  *
00027  */
00028 
00029 #ifndef _BATCHMANAGER_H_
00030 #define _BATCHMANAGER_H_
00031 
00032 #include <string>
00033 #include <map>
00034 #include "Batch_Job.hxx"
00035 #include "Batch_JobId.hxx"
00036 #include "Batch_JobInfo.hxx"
00037 #include "Batch_InvalidArgumentException.hxx"
00038 
00039 namespace Batch {
00040 
00041   class Job;
00042   class JobId;
00043   class JobInfo;
00044   class FactBatchManager;
00045 
00046   class BatchManager
00047   {
00048   public:
00049     // Constructeur et destructeur
00050     //BatchManager(std::string host="localhost") throw(InvalidArgumentException); // connexion a la machine host
00051     BatchManager(const Batch::FactBatchManager * parent, const char * host="localhost") throw(InvalidArgumentException); // connexion a la machine host
00052     virtual ~BatchManager();
00053     virtual std::string __repr__() const;
00054 
00055     // Recupere le l'identifiant d'un job deja soumis au BatchManager
00056     //virtual const JobId getJobIdByReference(const std::string & ref);
00057     virtual const Batch::JobId getJobIdByReference(const char * ref);
00058 
00059     // Methodes pour le controle des jobs : virtuelles pures
00060     virtual const Batch::JobId submitJob(const Batch::Job & job) = 0; // soumet un job au gestionnaire
00061     virtual void deleteJob(const Batch::JobId & jobid) = 0; // retire un job du gestionnaire
00062     virtual void holdJob(const Batch::JobId & jobid) = 0; // suspend un job en file d'attente
00063     virtual void releaseJob(const Batch::JobId & jobid) = 0; // relache un job suspendu
00064     virtual void alterJob(const Batch::JobId & jobid, const Batch::Parametre & param, const Batch::Environnement & env) = 0; // modifie un job en file d'attente
00065     virtual void alterJob(const Batch::JobId & jobid, const Batch::Parametre & param) = 0; // modifie un job en file d'attente
00066     virtual void alterJob(const Batch::JobId & jobid, const Batch::Environnement & env) = 0; // modifie un job en file d'attente
00067     virtual Batch::JobInfo queryJob(const Batch::JobId & jobid) = 0; // renvoie l'etat du job
00068 
00069   protected:
00070     std::string _hostname; // serveur ou tourne le BatchManager
00071     // std::map< const std::string, const Batch::JobId * > jobid_map; // table des jobs deja soumis
00072     std::map< std::string, const Batch::JobId * > jobid_map; // table des jobs deja soumis
00073     const Batch::FactBatchManager * _parent;
00074 
00075   private:
00076 
00077   };
00078 
00079 }
00080 
00081 #endif