1 // Copyright (C) 2009-2015 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #ifndef _BL_SALOMESERVICES_HXX_
21 #define _BL_SALOMESERVICES_HXX_
23 #include "BL_Engine.hxx"
24 #include "BL_Traces.hxx"
27 #include "SALOME_NamingService.hxx"
28 #include "SALOME_LifeCycleCORBA.hxx"
29 #include "SALOME_ContainerManager.hh"
30 #include "BL_JobsManager.hxx"
36 #include "JOBMANAGER_IDL.hh"
43 struct BL_Engine_EXPORT ResourceDescr
49 std::string applipath;
50 std::list<std::string> componentList;
54 unsigned int cpu_clock;
56 unsigned int nb_proc_per_node;
59 std::string iprotocol;
61 bool can_launch_batch_jobs;
62 bool can_run_containers;
63 std::string working_directory;
66 class BL_Engine_EXPORT SALOMEServices :
67 public POA_JOBMANAGER::LauncherObserver
71 virtual ~SALOMEServices();
76 void set_manager(BL::JobsManager * manager) {_manager = manager;}
78 std::list<std::string> getResourceList(bool batch_only);
79 BL::ResourceDescr getResourceDescr(const std::string& name);
80 void addResource(BL::ResourceDescr & new_resource);
81 void removeResource(const std::string & name);
83 std::string save_jobs(const std::string & file_name);
84 std::string load_jobs(const std::string & file_name);
86 std::string create_job(BL::Job * job);
87 std::string start_job(BL::Job * job);
88 std::string refresh_job(BL::Job * job);
89 std::string delete_job(BL::Job * job);
90 std::string stop_job(BL::Job * job);
91 std::string get_results_job(BL::Job * job);
92 std::string get_assigned_hostnames(BL::Job * job); // Get names or ids of hosts assigned to the job
94 BL::Job * get_new_job(int job_number);
96 virtual void notify(const char* event_name, const char * event_data);
100 SALOME_NamingService * _salome_naming_service;
101 SALOME_LifeCycleCORBA * _lcc;
102 Engines::SalomeLauncher_var _salome_launcher;
103 Engines::ResourcesManager_var _resources_manager;
105 BL::JobsManager * _manager;