Salome HOME
[EDF30062] : Forward of current directory mecanism
[modules/kernel.git] / idl / SALOME_Component.idl
index f5b18d4a3062ace5f814870669b10380f5b6c5fe..3e550f8ba34f2069fc376413ab8892ce3df74029 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2024  CEA, EDF, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -19,6 +19,7 @@
 //
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  File   : SALOME_Component.idl
 //  Author : Paul RASCLE, EDF
 
 //  File   : SALOME_Component.idl
 //  Author : Paul RASCLE, EDF
 
 #include "SALOMEDS.idl"
 #include "SALOME_Exception.idl"
 #include "SALOME_PyNode.idl"
 #include "SALOMEDS.idl"
 #include "SALOME_Exception.idl"
 #include "SALOME_PyNode.idl"
+#include "SALOME_Embedded_NamingService.idl"
+#include "SALOME_Comm.idl"
 
 /*! \file SALOME_Component.idl \brief interfaces for EngineComponent and Container
 */
 
 /*! \brief
 This is a package of interfaces used for connecting new components to %SALOME
 
 /*! \file SALOME_Component.idl \brief interfaces for EngineComponent and Container
 */
 
 /*! \brief
 This is a package of interfaces used for connecting new components to %SALOME
-application. It also contains a set of interfaces used for management of %MED
+application. It also contains a set of interfaces used for management of %FIELDS
 component in %SALOME application.
 */
 module Engines
 component in %SALOME application.
 */
 module Engines
@@ -60,6 +63,9 @@ module Engines
   };
 
   typedef sequence<KeyValuePair> FieldsDict;
   };
 
   typedef sequence<KeyValuePair> FieldsDict;
+  typedef sequence<double> vectorOfDouble;
+  typedef sequence<string> vectorOfString;
+  typedef sequence<vectorOfString> vectorOfVectorOfString;
 
   interface EngineComponent ;
   interface fileRef ;
 
   interface EngineComponent ;
   interface fileRef ;
@@ -74,6 +80,32 @@ module Engines
   interface Container
   {
 
   interface Container
   {
 
+    void override_environment( in FieldsDict env );
+
+    void override_environment_python( in FieldsDict env );
+
+    FieldsDict get_os_environment();
+
+    void set_big_obj_on_disk_threshold(in long thresholdInByte);
+
+    void set_big_obj_on_disk_directory(in string directory);
+
+    void set_directory_for_replay_files(in string directory);
+    
+    void set_number_of_retry(in long nbRetry);
+
+    void set_current_directory(in string cwd);
+
+    void set_startup_code(in string codeAtStartUp);
+
+    string get_startup_code();
+
+    void addLogFileNameGroup(in vectorOfString groupOfLogFileNames);
+    
+    vectorOfVectorOfString getAllLogFileNameGroups();
+
+    void execute_python_code( in string code ) raises(SALOME::SALOME_Exception);
+
     /*! \brief Loads a new component class (dynamic library).
 
       \param componentName like COMPONENT, (Python or C++ implementation)
     /*! \brief Loads a new component class (dynamic library).
 
       \param componentName like COMPONENT, (Python or C++ implementation)
@@ -90,12 +122,9 @@ module Engines
       \param componentName Name of the component which will be registered
                            in Registry and Name Service,
                          (instance number suffix added to the registered name)
       \param componentName Name of the component which will be registered
                            in Registry and Name Service,
                          (instance number suffix added to the registered name)
-      \param studyId        0 if instance is not associated to a study,
-                            >0 otherwise (== study id)
       \return a loaded component
     */
       \return a loaded component
     */
-    Engines::EngineComponent create_component_instance(in string componentName,
-                                                       in long studyId);
+    Engines::EngineComponent create_component_instance(in string componentName);
 
     //! Create a new Python servant instance of a generic service.
         /*!
 
     //! Create a new Python servant instance of a generic service.
         /*!
@@ -104,8 +133,6 @@ module Engines
           Warning: no internal registration is done, so it is up to the caller to
           manage the various instantiation.
           \param serviceName Name of the service
           Warning: no internal registration is done, so it is up to the caller to
           manage the various instantiation.
           \param serviceName Name of the service
-
-                                >0 otherwise (== study id)
           \param reason  in case of error (return void string) a string explaining the error
           \return the IOR of the loaded service.
         */
           \param reason  in case of error (return void string) a string explaining the error
           \return the IOR of the loaded service.
         */
@@ -118,25 +145,20 @@ module Engines
       \param componentName Name of the component which will be registered
                            in Registry and Name Service,
                          (instance number suffix added to the registered name)
       \param componentName Name of the component which will be registered
                            in Registry and Name Service,
                          (instance number suffix added to the registered name)
-      \param studyId        0 if instance is not associated to a study,
-                            >0 otherwise (== study id)
       \param env         a dict of env variables
       \param reason      in case of error (return nil) a string explaining the error
       \return a loaded component
     */
     Engines::EngineComponent create_component_instance_env(in string componentName,
       \param env         a dict of env variables
       \param reason      in case of error (return nil) a string explaining the error
       \return a loaded component
     */
     Engines::EngineComponent create_component_instance_env(in string componentName,
-                                                           in long studyId, in FieldsDict env,
+                                                           in FieldsDict env,
                                                            out string reason);
     //! Find a servant instance of a component
     /*!
       \param registeredName  Name of the component in Registry or Name Service,
                              without instance suffix number
                                                            out string reason);
     //! Find a servant instance of a component
     /*!
       \param registeredName  Name of the component in Registry or Name Service,
                              without instance suffix number
-      \param studyId        0 if instance is not associated to a study,
-                            >0 otherwise (== study id)
-      \return the first instance found with same studyId
+      \return the first instance found
     */
     */
-    EngineComponent find_component_instance(in string registeredName,
-                                            in long studyId);
+    EngineComponent find_component_instance(in string registeredName);
 
     //! Find a servant instance of a component, or create a new one.
     /*!
 
     //! Find a servant instance of a component, or create a new one.
     /*!
@@ -156,6 +178,11 @@ module Engines
       \param component_i     Component to be removed
     */
     void remove_impl(in EngineComponent component_i);
       \param component_i     Component to be removed
     */
     void remove_impl(in EngineComponent component_i);
+    
+    //! In case of SSL mode Returns entry to Embedded NS
+    EmbeddedNamingService get_embedded_NS_if_ssl();
+    
+    boolean is_SSL_mode();
 
     //!  Unload component libraries from the container.
     void finalize_removal() ;
 
     //!  Unload component libraries from the container.
     void finalize_removal() ;
@@ -171,10 +198,23 @@ module Engines
 
     //!  name of the %container log file (this has been set by the launcher)
     attribute string logfilename ;
 
     //!  name of the %container log file (this has been set by the launcher)
     attribute string logfilename ;
+    
+    //!  name of the %container log file
+    attribute string locallogfilename ;
+
+    //! interval of time between two measures of CPU/time process container
+    attribute long monitoringtimeresms;
+    
+    void verbosity(out boolean activated, out string level);
 
 
-    //!  Shutdown the Container process.
+    void setVerbosity(in boolean activated, in string level);
+
+    //!  Shutdown the Container process. Shutdown is not immediate. It waits for all remaining invokation completion.
     void Shutdown();
 
     void Shutdown();
 
+    //!  Shutdown the Container process. Shutdown is immediate for this method.
+    void ShutdownNow();
+
     //!  Returns the hostname of the container
     string getHostName();
 
     //!  Returns the hostname of the container
     string getHostName();
 
@@ -242,8 +282,40 @@ module Engines
      */
     PyScriptNode createPyScriptNode(in string nodeName, in string code)  raises(SALOME::SALOME_Exception);
 
      */
     PyScriptNode createPyScriptNode(in string nodeName, in string code)  raises(SALOME::SALOME_Exception);
 
+    void removePyScriptNode(in string nodeName) raises(SALOME::SALOME_Exception);
+
     //! Retrieves the last created PyScriptNode instance with createPyScriptNode.
     PyScriptNode getDefaultPyScriptNode(in string nodeName);
     //! Retrieves the last created PyScriptNode instance with createPyScriptNode.
     PyScriptNode getDefaultPyScriptNode(in string nodeName);
+
+    //! This method remove all refs of PyScriptNode servant objects stored in server.
+    /*!
+     * Previous scripts created on container may have been stored in a map. This method removes them. It then clean all the contexts dict attached to them.
+     */
+    void cleanAllPyScripts();
+
+    //! Return number of CPU cores in the calculation node.
+    long getNumberOfCPUCores();
+
+    //! Return a load of each CPU core.
+    vectorOfDouble loadOfCPUCores() raises(SALOME::SALOME_Exception);
+
+    //! Set custom script to calculate a load of each CPU core.
+    /*!
+      \param script Python script to execute
+     */
+    void setPyScriptForCPULoad(in string script);
+
+    //! Nullify custom script to calculate each CPU core's load.
+    void resetScriptForCPULoad();
+
+    //! Get total physical memory of calculation node, in megabytes.
+    long getTotalPhysicalMemory();
+
+    //! Get used physical memory of calculation node, in megabytes.
+    long getTotalPhysicalMemoryInUse();
+
+    //! Obtain physical memory, used by the current process, in megabytes.
+    long getTotalPhysicalMemoryInUseByMe();
   };
 
   /*! \brief Interface of the %component.
   };
 
   /*! \brief Interface of the %component.
@@ -261,15 +333,7 @@ module Engines
     //!  Determines whether the server has already been loaded or not.
     void ping();
 
     //!  Determines whether the server has already been loaded or not.
     void ping();
 
-    //!  Get study associated to component instance
-    /*!
-      get study associated to component instance
-      \return -1: not initialised (Internal Error)
-               0: multistudy component instance
-              >0: study id associated to this instance
-    */
-    long getStudyId();
-
+    boolean isSSLMode() raises(SALOME::SALOME_Exception);
     //! Remove component instance from container
     /*!
       Deactivates the %Component.
     //! Remove component instance from container
     /*!
       Deactivates the %Component.
@@ -355,8 +419,7 @@ module Engines
       Returns a python script, which is being played back reproduces
       the data model of component
     */
       Returns a python script, which is being played back reproduces
       the data model of component
     */
-    TMPFile DumpPython(in Object theStudy,
-                       in boolean isPublished,
+    TMPFile DumpPython(in boolean isPublished,
                        in boolean isMultiFile,
                        out boolean isValidScript);
 
                        in boolean isMultiFile,
                        out boolean isValidScript);
 
@@ -469,11 +532,10 @@ module Engines
       It is worth using this method only if hasObjectInfo() method returns true.
 
       \param entry object's entry.
       It is worth using this method only if hasObjectInfo() method returns true.
 
       \param entry object's entry.
-      \param studyId study id
 
       \return an information about the given object.
     */
 
       \return an information about the given object.
     */
-    string getObjectInfo(in long studyId, in string entry);
+    string getObjectInfo(in string entry);
 
     //! Get version of the component
     /*!
 
     //! Get version of the component
     /*!