--- /dev/null
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : ContainersManager.idl
+// Author : Jean Rahuel
+// $Header:
+
+#ifndef _CONTAINERSMANAGER_IDL_
+#define _CONTAINERSMANAGER_IDL_
+
+#include "SALOME_Component.idl"
+
+module Containers {
+
+ enum System { Unknown , Linux } ;
+
+ const string DefaultContainerCpp = "FactoryServer" ;
+ const string DefaultContainerPython = "FactoryServerPy" ;
+
+ struct MachineParameters {
+ long with_xterm ;
+ System Os ;
+ long Memory ;
+ long CpuClock ;
+ long NbProc ;
+ long NbNode ;
+ string HostName ;
+ string ContainerName ;
+ Engines::ContainerType ContainerType ;
+ string NsHostName ;
+ long NsPort ;
+ } ;
+
+ interface Manager {
+
+ MachineParameters Parameters() ;
+
+ boolean ping() ;
+
+ Engines::Container FindContainer( in MachineParameters MyParams ) ;
+
+ Engines::ListOfContainers FindContainers( in MachineParameters MyParams ) ;
+
+ Engines::Container FindOrStartContainer( in MachineParameters MyParams ) ;
+
+ Engines::Component FindComponent( in MachineParameters MyParams ,
+ in string ComponentName ) ;
+
+ Engines::ListOfComponents FindComponents( in MachineParameters MyParams ,
+ in string ComponentName ) ;
+
+ Engines::Component FindOrLoad_ComponentPath( in MachineParameters MyParams ,
+ in string ComponentName ,
+ in string ImplementationPath ) ;
+
+ Engines::Component FindOrLoad_Component( in MachineParameters MyParams ,
+ in string ComponentName ) ;
+
+ } ;
+
+} ;
+
+#endif
--- /dev/null
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : ResourcesManager.idl
+// Author : Jean Rahuel
+// $Header:
+
+#include "ContainersManager.idl"
+
+module Resources {
+
+ struct ComputerParameters {
+ string FullName ;
+ string Alias ;
+ long SshAccess ;
+ long Interactive ;
+ long Batch ;
+ string UserName ;
+ Containers::System Os ;
+ long Memory ;
+ long Swap ;
+ long CpuClock ;
+ long NbProc ;
+ long NbNode ;
+ } ;
+
+ typedef sequence<string> ListOfStrings ;
+
+ struct ComputerEnvironment {
+ string Path ;
+ string Ld_Library_Path ;
+ string PythonPath ;
+ string CasRoot ;
+ ListOfStrings Module_Root_Dir_Names ;
+ ListOfStrings Module_Root_Dir_Values ;
+ } ;
+
+ interface Computer ;
+
+ typedef sequence<Computer> ListOfComputers ;
+
+ interface Computer {
+
+ long ping() ;
+
+ string FullName() ;
+
+ string Alias() ;
+
+ ComputerParameters Parameters() ;
+
+ ComputerEnvironment Environment() ;
+
+ } ;
+
+ interface Manager {
+
+ long ping() ;
+
+ long SshAccess( in string aHostName ) ;
+
+ string UserName( in string aHostName ) ;
+
+ ListOfComputers AllComputers() ;
+
+ ListOfComputers GetComputers( in Containers::MachineParameters aMachineParameters ) ;
+
+ Computer SelectComputer( in Containers::MachineParameters aMachineParameters ) ;
+
+ Computer GetComputer( in ListOfComputers aListOfComputers ) ;
+
+ Computer SearchComputer( in string aComputerName ) ;
+
+ } ;
+
+} ;
if ( content[0] != '\n' ) {
_ComputerParameters.UserName = CORBA::string_dup( content.c_str() ) ;
}
+ else {
+ _ComputerParameters.UserName = CORBA::string_dup( "" ) ;
+ }
}
else if ( qName.compare(QString( "os" ) ) == 0 ) {
#if TRACE
return 0 ;
}
+char * Manager_Impl::UserName( const char * aComputerName ) {
+ if ( !CORBA::is_nil( SearchComputer( aComputerName ) ) ) {
+ return CORBA::string_dup( SearchComputer( aComputerName )->Parameters()->UserName ) ;
+ }
+ return CORBA::string_dup( "" ) ;
+}
+
Resources::ListOfComputers * Manager_Impl::AllComputers() {
MESSAGE("Manager_Impl::AllComputers()") ;
Resources::ListOfComputers_var aListOfComputers = new Resources::ListOfComputers() ;
virtual long ping() ;
- virtual Resources::Computer_ptr TestComputer() ;
-
virtual long SshAccess( const char * aComputerName ) ;
+ virtual long UserName( const char * aComputerName ) ;
+
virtual Resources::ListOfComputers * AllComputers() ;
virtual Resources::ListOfComputers * GetComputers( const Containers::MachineParameters & aMachineParameters ) ;