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

Diff for /pegasus/src/Pegasus/ControlProviders/InteropProvider/InteropProvider.cpp between version 1.40 and 1.41

version 1.40, 2005/06/01 12:02:27 version 1.41, 2005/06/02 11:47:04
Line 422 
Line 422 
     used for localhost (127.0.0.1).     used for localhost (127.0.0.1).
  
     @param hostName String with the name of the host     @param hostName String with the name of the host
     @return String with the IP address to be used      @param namespaceType - Uint32 representing the
     NOTE: This code should not be in slpprovider. This      access protocol for this request.  This is exactly
     should be in the Interop classes but for the moment      the definition in the PG_CIMXMLCommunicationMechanism
     it is not.      mof for the property namespaceAccessProtocol.
       @return String with the IP address to be used. This must
       be the complete address sufficient to access the
       IP address. Therefore, it includes the port number.
 */ */
 String _getHostAddress(String hostName)  String _getHostAddress(String & hostName, Uint32  namespaceType)
 { {
   String ipAddress;   String ipAddress;
  
Line 439 
Line 442 
       // set default address if everything else failed       // set default address if everything else failed
       ipAddress = String("127.0.0.1");       ipAddress = String("127.0.0.1");
   }   }
     // Question: is there a case where we leave off the port number.
     // Code to get the property service_location_tcp ( which is equivalent to "IP address:5988")
     // Need to tie these two together.
     Uint32 portNumber;
   
     /********************** Drop this
     ConfigManager* configManager = ConfigManager::getInstance();
     Boolean enableHttpConnection = String::equal(
         configManager->getCurrentValue("enableHttpConnection"), "true");
     Boolean enableHttpsConnection = String::equal(
         configManager->getCurrentValue("enableHttpsConnection"), "true");
     ***********************/
   
     // ATTN: The following is incorrect and must be modified as part
     // of bug 1857 and possibly other bug reports. KS. This is 2.5 mustfix.
   
     // Match the protocol and port number from internal information.
     if (namespaceType == 3)
          portNumber = System::lookupPort(WBEM_HTTPS_SERVICE_NAME,
             WBEM_DEFAULT_HTTPS_PORT);
     else if (namespaceType == 2)
     {
         portNumber = System::lookupPort(WBEM_HTTP_SERVICE_NAME,
             WBEM_DEFAULT_HTTP_PORT);
     }
     else
         portNumber = 0;
     // convert portNumber to ascii
     char buffer[32];
     sprintf(buffer, ":%u", portNumber);
     if (portNumber != 0)
         ipAddress.append(buffer);
   
     // now fillout the serviceIDAttribute from the object manager instance name property.
     // This is a key field so must have a value.
     //String strUUID = _getPropertyValue( instance_ObjMgr, namePropertyName, "DefaultEmptyUUID");
   
   return ipAddress;   return ipAddress;
 } }
  
Line 810 
Line 850 
 CIMInstance InteropProvider::_buildInstancePGCIMXMLCommunicationMechanism( CIMInstance InteropProvider::_buildInstancePGCIMXMLCommunicationMechanism(
             const CIMObjectPath& objectPath,             const CIMObjectPath& objectPath,
             const String& namespaceType,             const String& namespaceType,
               const Uint16& accessProtocol,
             const String& IPAddress,             const String& IPAddress,
             const Boolean& includeQualifiers,             const Boolean& includeQualifiers,
             const Boolean& includeClassOrigin,             const Boolean& includeClassOrigin,
Line 865 
Line 906 
     // Obsolete function     // Obsolete function
     _setPropertyValue(instance, "namespaceType", namespaceType);     _setPropertyValue(instance, "namespaceType", namespaceType);
  
     _setPropertyValue(instance, "IPAddress", IPAddress);      _setPropertyValue(instance, "namespaceAccessProtocol", accessProtocol);
   
     CDEBUG("Set IP Address: " << " instance " << (( CIMObject ) instance).toString());  
  
     Tracer::trace(TRC_CONTROLPROVIDER, Tracer::LEVEL4,      _setPropertyValue(instance, "IPAddress", IPAddress);
         "%s CIMXMLInstanceBuild returns  IPAddress %s\n%s", thisProvider, IPAddress.getCString(),  
         ( ( CIMObject) instance).toString().getCString());  
   
     // add the path to this instance.  
     instance.setPath(instance.buildPath(targetClass));  
  
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
     return(instance);     return(instance);
Line 890 
Line 924 
             "InteropProvider::_buildInstancesPGCIMXMLCommunicationMechanism");             "InteropProvider::_buildInstancesPGCIMXMLCommunicationMechanism");
  
     // This is a temporary hack to get the multiple connections.     // This is a temporary hack to get the multiple connections.
       // This is based on the configmanager being the source of what
       // protocols are available, http and https.
   
     ConfigManager* configManager = ConfigManager::getInstance();     ConfigManager* configManager = ConfigManager::getInstance();
     Boolean enableHttpConnection = String::equal(     Boolean enableHttpConnection = String::equal(
         configManager->getCurrentValue("enableHttpConnection"), "true");         configManager->getCurrentValue("enableHttpConnection"), "true");
     Boolean enableHttpsConnection = String::equal(     Boolean enableHttpsConnection = String::equal(
         configManager->getCurrentValue("enableHttpsConnection"), "true");         configManager->getCurrentValue("enableHttpsConnection"), "true");
  
     String IPAddress = _getHostAddress(System::getHostName());  
     Array<CIMInstance> instances;     Array<CIMInstance> instances;
       Uint32 namespaceAccessProtocol;
       String namespaceType;
  
       // for each type, create the instance if that type is defined.
     if (enableHttpConnection)     if (enableHttpConnection)
     {     {
         CIMInstance instance = _buildInstancePGCIMXMLCommunicationMechanism(          namespaceAccessProtocol = 2;
           namespaceType = "http";
           CIMInstance instance =
               _buildInstancePGCIMXMLCommunicationMechanism(
                                         objectPath,                                         objectPath,
                                         "http", IPAddress,                  namespaceType,
                   namespaceAccessProtocol,
                   _getHostAddress(System::getHostName(), namespaceAccessProtocol),
                                         includeQualifiers,                                         includeQualifiers,
                                         includeClassOrigin,                                         includeClassOrigin,
                                         propertyList);                                         propertyList);
Line 912 
Line 956 
  
     if (enableHttpsConnection)     if (enableHttpsConnection)
     {     {
         CIMInstance instance = _buildInstancePGCIMXMLCommunicationMechanism(          namespaceAccessProtocol = 3;
           namespaceType = "https";
           CIMInstance instance =
               _buildInstancePGCIMXMLCommunicationMechanism(
                                         objectPath,                                         objectPath,
                                         "https", IPAddress,                  namespaceType,
                   namespaceAccessProtocol,
                   _getHostAddress(System::getHostName(), namespaceAccessProtocol),
                                         includeQualifiers,                                         includeQualifiers,
                                         includeClassOrigin,                                         includeClassOrigin,
                                         propertyList);                                         propertyList);
         instances.append(instance);         instances.append(instance);
     }     }
  
   
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
     return(instances);     return(instances);
 } }
Line 955 
Line 1005 
 { {
     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
             "InteropProvider::_getInstanceCIMObjectManager");             "InteropProvider::_getInstanceCIMObjectManager");
   
     // Try to get persistent instance from repository     // Try to get persistent instance from repository
     Array<CIMInstance> instances;     Array<CIMInstance> instances;
     try     try
Line 981 
Line 1032 
                     "Error. Multiple definitons of : $0",                     "Error. Multiple definitons of : $0",
                     CIM_OBJECTMANAGER_CLASSNAME.getString());                     CIM_OBJECTMANAGER_CLASSNAME.getString());
             }             }
             CDEBUG("getInstanceFromRepository returning true");  
             return(true);             return(true);
         }         }
         else         else
         {         {
             CDEBUG("getInstanceFromRepository returning false");  
             return(false);             return(false);
         }         }
     }     }
Line 1036 
Line 1085 
         //         //
         // No instance in the repository. Build new instance and save it.         // No instance in the repository. Build new instance and save it.
         //         //
         CDEBUG("Creating New instance of CIMOBjectManager");  
   
         CIMClass targetClass;         CIMClass targetClass;
         instance = _buildInstanceSkeleton(objectPath, CIM_OBJECTMANAGER_CLASSNAME,         instance = _buildInstanceSkeleton(objectPath, CIM_OBJECTMANAGER_CLASSNAME,
                     targetClass);                     targetClass);


Legend:
Removed from v.1.40  
changed lines
  Added in v.1.41

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2