From: rahuel Date: Tue, 2 Mar 2004 16:06:46 +0000 (+0000) Subject: *** empty log message *** X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=80adc15a94b18b074b41830835497be5f710697d;p=modules%2Fkernel.git *** empty log message *** --- diff --git a/idl/ContainersManager.idl b/idl/ContainersManager.idl new file mode 100644 index 000000000..736646a38 --- /dev/null +++ b/idl/ContainersManager.idl @@ -0,0 +1,81 @@ +// 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 diff --git a/idl/ResourcesManager.idl b/idl/ResourcesManager.idl new file mode 100644 index 000000000..7c4dbeddf --- /dev/null +++ b/idl/ResourcesManager.idl @@ -0,0 +1,94 @@ +// 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 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 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 ) ; + + } ; + +} ; diff --git a/src/ResourcesManager/ResourcesManager_Handler.cxx b/src/ResourcesManager/ResourcesManager_Handler.cxx index c2e3d5a4d..bc3338d40 100755 --- a/src/ResourcesManager/ResourcesManager_Handler.cxx +++ b/src/ResourcesManager/ResourcesManager_Handler.cxx @@ -133,6 +133,9 @@ bool ResourcesManager_Handler::endElement( const QString& , const QString& , 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 diff --git a/src/ResourcesManager/ResourcesManager_Impl.cxx b/src/ResourcesManager/ResourcesManager_Impl.cxx index 827783db6..c266a0a90 100755 --- a/src/ResourcesManager/ResourcesManager_Impl.cxx +++ b/src/ResourcesManager/ResourcesManager_Impl.cxx @@ -130,6 +130,13 @@ long Manager_Impl::SshAccess( const char * aComputerName ) { 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() ; diff --git a/src/ResourcesManager/ResourcesManager_Impl.hxx b/src/ResourcesManager/ResourcesManager_Impl.hxx index bbbe564b0..c170eb100 100755 --- a/src/ResourcesManager/ResourcesManager_Impl.hxx +++ b/src/ResourcesManager/ResourcesManager_Impl.hxx @@ -78,10 +78,10 @@ class Manager_Impl : public POA_Resources::Manager , 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 ) ;