(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.6 and 1.9.4.1

version 1.6, 2008/01/30 05:23:47 version 1.9.4.1, 2008/07/01 15:18:17
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 103 
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 228 
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 564 
Line 571 
     // Modify the instance on disk     // Modify the instance on disk
     repository->modifyInstance(instanceReference.getNameSpace(),     repository->modifyInstance(instanceReference.getNameSpace(),
         omInstance, false,  propertyList);         omInstance, false,  propertyList);
     Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE,      PEG_TRACE((
         "Interop Provider Set Statistics gathering in CIM_ObjectManager: $0",          TRC_CONTROLPROVIDER,
         (statisticsFlag? "true" : "false"));          Tracer::LEVEL3,
           "Interop Provider Set Statistics gathering in CIM_ObjectManager: %s",
           (statisticsFlag? "true" : "false")));
     StatisticalData* sd = StatisticalData::current();     StatisticalData* sd = StatisticalData::current();
     sd->setCopyGSD(statisticsFlag);     sd->setCopyGSD(statisticsFlag);
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
Line 735 
Line 744 
     return assocInstances;     return assocInstances;
 } }
  
   #ifdef PEGASUS_ENABLE_DMTF_INDICATION_PROFILE_SUPPORT
   
   CIMInstance InteropProvider::buildAssociationInstance(
       const CIMName &className,
       const CIMName &propName1,
       const CIMObjectPath &objPath1,
       const CIMName &propName2,
       const CIMObjectPath &objPath2)
   {
       CIMClass cimClass = repository->getClass(
           PEGASUS_NAMESPACENAME_INTEROP,
           className,
           false,
           true,
           true);
   
       CIMInstance instance = cimClass.buildInstance(
           true,
           true,
           CIMPropertyList());
   
       instance.getProperty(instance.findProperty(propName1)).setValue(objPath1);
       instance.getProperty(instance.findProperty(propName2)).setValue(objPath2);
       instance.setPath(instance.buildPath(cimClass));
   
       return instance;
   }
   
   Array<CIMInstance> InteropProvider::enumElementCapabilityInstances(
       const OperationContext &opContext)
   {
       // Get CIM_IndicationServiceCapabilities instance
       Array<CIMObjectPath> capPaths = cimomHandle.enumerateInstanceNames(
           opContext,
           PEGASUS_NAMESPACENAME_INTEROP,
           PEGASUS_CLASSNAME_CIM_INDICATIONSERVICECAPABILITIES);
       PEGASUS_ASSERT(capPaths.size() == 1);
   
       // Get CIM_IndicationService instance
       Array<CIMObjectPath> servicePaths = cimomHandle.enumerateInstanceNames(
           opContext,
           PEGASUS_NAMESPACENAME_INTEROP,
           PEGASUS_CLASSNAME_CIM_INDICATIONSERVICE);
       PEGASUS_ASSERT(servicePaths.size() == 1);
   
       Array<CIMInstance> instances;
   
       instances.append(
           buildAssociationInstance(
               PEGASUS_CLASSNAME_PG_ELEMENTCAPABILITIES,
               PROPERTY_CAPABILITIES,
               capPaths[0],
               PROPERTY_MANAGEDELEMENT,
               servicePaths[0]));
   
       return instances;
   }
   
   Array<CIMInstance> InteropProvider::enumHostedIndicationServiceInstances(
       const OperationContext &opContext)
   {
       Array<CIMInstance> instances;
       CIMInstance cInst = getComputerSystemInstance();
   
       // Get CIM_IndicationService instance
       Array<CIMObjectPath> servicePaths = cimomHandle.enumerateInstanceNames(
           opContext,
           PEGASUS_NAMESPACENAME_INTEROP,
           PEGASUS_CLASSNAME_CIM_INDICATIONSERVICE);
   
       PEGASUS_ASSERT(servicePaths.size() == 1);
   
       instances.append(
           buildAssociationInstance(
               PEGASUS_CLASSNAME_PG_HOSTEDINDICATIONSERVICE,
               PROPERTY_ANTECEDENT,
               cInst.getPath(),
               PROPERTY_DEPENDENT,
               servicePaths[0]));
   
       return instances;
   }
   
   Array<CIMInstance> InteropProvider::enumServiceAffectsElementInstances(
       const OperationContext &opContext)
   {
       Array<CIMInstance> instances;
   
       // Get CIM_IndicationService instance
       Array<CIMObjectPath> servicePaths = cimomHandle.enumerateInstanceNames(
           opContext,
           PEGASUS_NAMESPACENAME_INTEROP,
           PEGASUS_CLASSNAME_CIM_INDICATIONSERVICE);
       PEGASUS_ASSERT(servicePaths.size() == 1);
   
       Array<CIMNamespaceName> namespaceNames = repository->enumerateNameSpaces();
       // Get CIM_IndicationFilter and CIM_ListenerDestination instances in all
       // namespaces and associate them with CIM_IndicationService instance using
       // PG_ServiceAffectsElement instance.
       for (Uint32 i = 0, n = namespaceNames.size() ; i < n ; ++i)
       {
           Array<CIMObjectPath> filterPaths;
           try
           {
               // Get CIM_IndicationFilter instance names
               filterPaths = cimomHandle.enumerateInstanceNames(
                   opContext,
                   namespaceNames[i],
                   PEGASUS_CLASSNAME_INDFILTER);
           }
           catch(CIMException &e)
           {
               // Ignore exception with CIM_ERR_INVALID_CLASS code. This will
               // happen when the class CIM_IndicationFilter can not be found
               // in this namespace.
               if (e.getCode() != CIM_ERR_INVALID_CLASS)
               {
                   PEG_TRACE((
                       TRC_CONTROLPROVIDER,
                       Tracer::LEVEL2,
                       "CIMException while enumerating the "
                           "CIM_IndicationFilter instances"
                               " in the namespace %s: %s.",
                        (const char*)namespaceNames[i].getString().getCString(),
                        (const char*)e.getMessage().getCString()));
               }
           }
           catch(Exception &e)
           {
               PEG_TRACE((
                   TRC_CONTROLPROVIDER,
                   Tracer::LEVEL1,
                   "Exception while enumerating the "
                       "CIM_IndicationFilter instances"
                           " in the namespace %s: %s.",
                   (const char*)namespaceNames[i].getString().getCString(),
                   (const char*)e.getMessage().getCString()));
           }
           catch(...)
           {
               PEG_TRACE((
                   TRC_CONTROLPROVIDER,
                   Tracer::LEVEL1,
                   "Unknown error occurred while enumerating the "
                       "CIM_IndicationFilter instances in the namespace %s.",
                   (const char*)namespaceNames[i].getString().getCString()));
           }
           for (Uint32 f = 0, fn = filterPaths.size(); f < fn ; ++f)
           {
               filterPaths[f].setNameSpace(namespaceNames[i]);
               instances.append(
                   buildAssociationInstance(
                       PEGASUS_CLASSNAME_PG_SERVICEAFFECTSELEMENT,
                       PROPERTY_AFFECTEDELEMENT,
                       filterPaths[f],
                       PROPERTY_AFFECTINGELEMENT,
                       servicePaths[0]));
           }
   
           Array<CIMObjectPath> handlerPaths;
           try
           {
               // Get CIM_ListenerDestination instance names
               handlerPaths = cimomHandle.enumerateInstanceNames(
                   opContext,
                   namespaceNames[i],
                   PEGASUS_CLASSNAME_LSTNRDST);
           }
           catch(CIMException &e)
           {
               // Ignore exception with CIM_ERR_INVALID_CLASS code. This will
               // happen when the class CIM_ListenerDestination can not be found
               // in this namespace.
               if (e.getCode() != CIM_ERR_INVALID_CLASS)
               {
                   PEG_TRACE((
                       TRC_CONTROLPROVIDER,
                       Tracer::LEVEL2,
                       "CIMException while enumerating the "
                           "CIM_ListenerDestination instances"
                               " in the namespace %s: %s.",
                        (const char*)namespaceNames[i].getString().getCString(),
                        (const char*)e.getMessage().getCString()));
               }
           }
           catch(Exception &e)
           {
               PEG_TRACE((
                   TRC_CONTROLPROVIDER,
                   Tracer::LEVEL1,
                   "Exception while enumerating the "
                       "CIM_ListenerDestination instances"
                           " in the namespace %s: %s.",
                   (const char*)namespaceNames[i].getString().getCString(),
                   (const char*)e.getMessage().getCString()));
           }
           catch(...)
           {
               PEG_TRACE((
                   TRC_CONTROLPROVIDER,
                   Tracer::LEVEL1,
                   "Unknown error occurred while enumerating the "
                       "CIM_ListenerDestination instances in the namespace %s.",
                   (const char*)namespaceNames[i].getString().getCString()));
           }
           for (Uint32 h = 0, hn = handlerPaths.size(); h < hn ; ++h)
           {
               handlerPaths[h].setNameSpace(namespaceNames[i]);
               instances.append(
                   buildAssociationInstance(
                       PEGASUS_CLASSNAME_PG_SERVICEAFFECTSELEMENT,
                       PROPERTY_AFFECTEDELEMENT,
                       handlerPaths[h],
                       PROPERTY_AFFECTINGELEMENT,
                       servicePaths[0]));
           }
       }
       return instances;
   }
   #endif
   
 PEGASUS_NAMESPACE_END PEGASUS_NAMESPACE_END
  
 // END OF FILE // END OF FILE


Legend:
Removed from v.1.6  
changed lines
  Added in v.1.9.4.1

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2