(file) Return to Server.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / ControlProviders / InteropProvider

Diff for /pegasus/src/Pegasus/ControlProviders/InteropProvider/Server.cpp between version 1.1 and 1.8

version 1.1, 2006/11/01 21:51:19 version 1.8, 2008/05/12 09:14:52
Line 27 
Line 27 
 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 // //
 //==============================================================================  //=============================================================================
  
  
 /////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
Line 49 
Line 49 
  
  
 #include <Pegasus/Common/Config.h> #include <Pegasus/Common/Config.h>
   #include <Pegasus/Common/HostAddress.h>
 #include <Pegasus/Common/PegasusVersion.h> #include <Pegasus/Common/PegasusVersion.h>
  
 #include <cctype> #include <cctype>
Line 62 
Line 63 
 #include <Pegasus/Common/StatisticalData.h> #include <Pegasus/Common/StatisticalData.h>
  
 PEGASUS_USING_STD; PEGASUS_USING_STD;
 PEGASUS_NAMESPACE_BEGIN;  PEGASUS_NAMESPACE_BEGIN
  
 const String CIMXMLProtocolVersion = "1.0"; const String CIMXMLProtocolVersion = "1.0";
  
Line 102 
Line 103 
 const CIMName CIMXMLCOMMMECH_PROPERTY_MULTIPLEOPERATIONSSUPPORTED( const CIMName CIMXMLCOMMMECH_PROPERTY_MULTIPLEOPERATIONSSUPPORTED(
         "MultipleOperationsSupported");         "MultipleOperationsSupported");
 const CIMName CIMXMLCOMMMECH_PROPERTY_VERSION("Version"); const CIMName CIMXMLCOMMMECH_PROPERTY_VERSION("Version");
   const CIMName
      CIMXMLCOMMMECH_PROPERTY_CIMXMLPROTOVERSION("CIMXMLProtocolVersion");
 const CIMName CIMXMLCOMMMECH_PROPERTY_NAMESPACETYPE("namespaceType"); const CIMName CIMXMLCOMMMECH_PROPERTY_NAMESPACETYPE("namespaceType");
 const CIMName CIMXMLCOMMMECH_PROPERTY_NAMESPACEACCESSPROTOCOL( const CIMName CIMXMLCOMMMECH_PROPERTY_NAMESPACEACCESSPROTOCOL(
     "namespaceAccessProtocol");     "namespaceAccessProtocol");
Line 227 
Line 230 
     setPropertyValue(instance, CIMXMLCOMMMECH_PROPERTY_VERSION,     setPropertyValue(instance, CIMXMLCOMMMECH_PROPERTY_VERSION,
         CIMXMLProtocolVersion);         CIMXMLProtocolVersion);
  
       //Populate "required" property that's not populated.
       // CIMXMLProtocolVersion Property
       setPropertyValue(instance, CIMXMLCOMMMECH_PROPERTY_CIMXMLPROTOVERSION,
           Uint16(1));
   
     // NamespaceType Property     // NamespaceType Property
     setPropertyValue(instance, CIMXMLCOMMMECH_PROPERTY_NAMESPACETYPE,     setPropertyValue(instance, CIMXMLCOMMMECH_PROPERTY_NAMESPACETYPE,
         namespaceType);         namespaceType);
Line 305 
Line 313 
         // Build the CommunicationMechanism instance for the HTTP protocol         // Build the CommunicationMechanism instance for the HTTP protocol
         namespaceAccessProtocol = 2;         namespaceAccessProtocol = 2;
         namespaceType = "http";         namespaceType = "http";
         Uint32 portNumberHttp;  
         String httpPort = configManager->getCurrentValue("httpPort");         String httpPort = configManager->getCurrentValue("httpPort");
         if (httpPort == String::EMPTY)         if (httpPort == String::EMPTY)
         {         {
             portNumberHttp = System::lookupPort(WBEM_HTTP_SERVICE_NAME,              Uint32 portNumberHttp = System::lookupPort(
                 WBEM_DEFAULT_HTTP_PORT);                  WBEM_HTTP_SERVICE_NAME, WBEM_DEFAULT_HTTP_PORT);
               char buffer[32];
               sprintf(buffer, "%u", portNumberHttp);
               httpPort.assign(buffer);
           }
           CIMInstance instance;
           Array<String> ips;
   #ifdef PEGASUS_ENABLE_IPV6
           ips = System::getInterfaceAddrs();
           for (Uint32 i = 0; i < ips.size() ; ++i)
           {
               String addr = ips[i];
               if (HostAddress::isValidIPV6Address(ips[i]))
               {
                   addr = "[" + addr + "]";
         }         }
         CIMInstance instance =              addr.append(":");
               addr.append(httpPort);
   
               instance  =
             buildCIMXMLCommunicationMechanismInstance(             buildCIMXMLCommunicationMechanismInstance(
                 namespaceType,                 namespaceType,
                 namespaceAccessProtocol,                 namespaceAccessProtocol,
                 getHostAddress(hostName, namespaceAccessProtocol, httpPort,                      addr,
                     portNumberHttp), commMechClass);                      commMechClass);
               instances.append(instance);
           }
   #endif
           // If System::getInterfaceAddrs() fails add ip4 addr here.
           if (!ips.size())
           {
               instance  = buildCIMXMLCommunicationMechanismInstance(
                   namespaceType,
                   namespaceAccessProtocol,
                   getHostAddress(hostName, namespaceAccessProtocol, httpPort),
                   commMechClass);
         instances.append(instance);         instances.append(instance);
     }     }
       }
  
     if (enableHttpsConnection)     if (enableHttpsConnection)
     {     {
         // Build the CommunicationMechanism instance for the HTTPS protocol         // Build the CommunicationMechanism instance for the HTTPS protocol
         namespaceAccessProtocol = 3;         namespaceAccessProtocol = 3;
         namespaceType = "https";         namespaceType = "https";
         Uint32 portNumberHttps;  
         String httpsPort = configManager->getCurrentValue("httpsPort");         String httpsPort = configManager->getCurrentValue("httpsPort");
         if (httpsPort == String::EMPTY)         if (httpsPort == String::EMPTY)
         {         {
             portNumberHttps = System::lookupPort(WBEM_HTTPS_SERVICE_NAME,              Uint32 portNumberHttps = System::lookupPort(
                 WBEM_DEFAULT_HTTPS_PORT);                  WBEM_HTTPS_SERVICE_NAME, WBEM_DEFAULT_HTTPS_PORT);
               char buffer[32];
               sprintf(buffer, "%u", portNumberHttps);
               httpsPort.assign(buffer);
         }         }
         CIMInstance instance =          CIMInstance instance;
           Array<String> ips;
   #ifdef PEGASUS_ENABLE_IPV6
           ips = System::getInterfaceAddrs();
           for (Uint32 i = 0; i < ips.size() ; ++i)
           {
               String addr = ips[i];
               if (HostAddress::isValidIPV6Address(ips[i]))
               {
                   addr = "[" + addr + "]";
               }
               addr.append(":");
               addr.append(httpsPort);
               instance  =
             buildCIMXMLCommunicationMechanismInstance(             buildCIMXMLCommunicationMechanismInstance(
                 namespaceType,                 namespaceType,
                 namespaceAccessProtocol,                 namespaceAccessProtocol,
                 getHostAddress(hostName, namespaceAccessProtocol, httpsPort,                      addr,
                     portNumberHttps), commMechClass);                      commMechClass);
   
         instances.append(instance);         instances.append(instance);
     }     }
   #endif
           // If System::getInterfaceAddrs() fails add ip4 addr here.
           if (!ips.size())
           {
               instance  = buildCIMXMLCommunicationMechanismInstance(
                   namespaceType,
                   namespaceAccessProtocol,
                   getHostAddress(hostName, namespaceAccessProtocol, httpsPort),
                   commMechClass);
               instances.append(instance);
           }
       }
  
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
     return instances;     return instances;
Line 508 
Line 569 
         return;         return;
     }     }
     // Modify the instance on disk     // Modify the instance on disk
     try  
     {  
         repository->modifyInstance(instanceReference.getNameSpace(),         repository->modifyInstance(instanceReference.getNameSpace(),
             omInstance, false,  propertyList);             omInstance, false,  propertyList);
     }      PEG_TRACE((
     catch(const CIMException&)          TRC_CONTROLPROVIDER,
     {          Tracer::LEVEL3,
         PEG_METHOD_EXIT();          "Interop Provider Set Statistics gathering in CIM_ObjectManager: %s",
         throw;          (statisticsFlag? "true" : "false")));
     }  
     catch(const Exception&)  
     {  
         PEG_METHOD_EXIT();  
         throw;  
     }  
     Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE,  
         "Interop Provider Set Statistics gathering in CIM_ObjectManager: $0",  
         (statisticsFlag? "true" : "false"));  
     StatisticalData* sd = StatisticalData::current();     StatisticalData* sd = StatisticalData::current();
     sd->setCopyGSD(statisticsFlag);     sd->setCopyGSD(statisticsFlag);
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
Line 694 
Line 744 
     return assocInstances;     return assocInstances;
 } }
  
 PEGASUS_NAMESPACE_END;  PEGASUS_NAMESPACE_END
  
 // END OF FILE // END OF FILE


Legend:
Removed from v.1.1  
changed lines
  Added in v.1.8

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2