(file) Return to CMPI_Broker.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / ProviderManager2 / CMPI

Diff for /pegasus/src/Pegasus/ProviderManager2/CMPI/CMPI_Broker.cpp between version 1.53 and 1.53.2.9

version 1.53, 2009/06/30 10:40:14 version 1.53.2.9, 2009/10/30 15:51:52
Line 39 
Line 39 
 #include "CMPIProviderManager.h" #include "CMPIProviderManager.h"
 #include "CMPI_String.h" #include "CMPI_String.h"
 #include <Pegasus/ProviderManager2/CMPI/CMPIClassCache.h> #include <Pegasus/ProviderManager2/CMPI/CMPIClassCache.h>
   #include <Pegasus/ProviderManager2/CMPI/CMPI_ThreadContext.h>
  
 #include <Pegasus/Common/CIMName.h> #include <Pegasus/Common/CIMName.h>
 #include <Pegasus/Common/CIMPropertyList.h> #include <Pegasus/Common/CIMPropertyList.h>
 #include <Pegasus/Provider/CIMOMHandle.h> #include <Pegasus/Provider/CIMOMHandle.h>
 #include <Pegasus/Common/CIMValue.h> #include <Pegasus/Common/CIMValue.h>
 #include <Pegasus/Common/CIMType.h> #include <Pegasus/Common/CIMType.h>
   #include "CMPISCMOUtilities.h"
  
  
 PEGASUS_USING_STD; PEGASUS_USING_STD;
Line 154 
Line 156 
     return pl;     return pl;
 } }
  
 CIMClass* mbGetClass(const CMPIBroker *mb, const CIMObjectPath &cop)  SCMOClass* mbGetSCMOClass(
       const char* nameSpace,
       Uint32 nsL,
       const char* cls,
       Uint32 clsL)
 { {
     PEG_METHOD_ENTER(TRC_CMPIPROVIDERINTERFACE, "CMPI_Broker:mbGetClass()");      PEG_METHOD_ENTER(TRC_CMPIPROVIDERINTERFACE, "CMPI_Broker:mbGetSCMOClass()");
  
     mb=CM_BROKER;      const CMPIBroker * mb = CMPI_ThreadContext::getBroker();
     CMPI_Broker *xBroker=(CMPI_Broker*)mb;     CMPI_Broker *xBroker=(CMPI_Broker*)mb;
     CIMClass * ccp = xBroker->classCache.getClass(xBroker, cop);  
       const char* ns=nameSpace;
       if (0 == nsL)
       {
           //If we don't have a namespace here, we use the initnamespace from
           // the thread context, since we need one to be able to lookup the class
           const CMPIContext* ctx = CMPI_ThreadContext::getContext();
           if (0!=ctx)
           {
               CMPIStatus rc;
               CMPIData nsCtxData = CMGetContextEntry(ctx, CMPIInitNameSpace,&rc);
               if (rc.rc == CMPI_RC_OK)
               {
                   ns = CMGetCharsPtr(nsCtxData.value.string, 0);
               }
           }
   
       }
   
   
       SCMOClass* scmoCls =
           xBroker->classCache.getSCMOClass(xBroker, ns, nsL, cls, clsL);
   
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
     return ccp;      return scmoCls;
 } }
  
 extern "C" extern "C"
Line 183 
Line 211 
         CMPIFlags flgs =         CMPIFlags flgs =
             ctx->ft->getEntry(ctx,CMPIInvocationFlags,NULL).value.uint32;             ctx->ft->getEntry(ctx,CMPIInvocationFlags,NULL).value.uint32;
         const CIMPropertyList props = getList(properties);         const CIMPropertyList props = getList(properties);
         CIMObjectPath qop(  
             String::EMPTY,  
             CIMNamespaceName(),  
             CM_ObjectPath(cop)->getClassName(),  
             CM_ObjectPath(cop)->getKeyBindings());  
  
           SCMOInstance* scmoObjPath = SCMO_ObjectPath(cop);
           CIMObjectPath qop;
         try         try
         {         {
             CIMInstance ci = CM_CIMOM(mb)->getInstance(              scmoObjPath->getCIMObjectPath(qop);
   
               CIMResponseData resData = CM_CIMOM(mb)->getInstance(
                 *CM_Context(ctx),                 *CM_Context(ctx),
                 CM_ObjectPath(cop)->getNameSpace(),                  scmoObjPath->getNameSpace(),
                 qop, //*CM_ObjectPath(cop),                  qop,
                 false, // Use of localOnly is deprecated by DMTF.  
                 CM_IncludeQualifiers(flgs),                 CM_IncludeQualifiers(flgs),
                 CM_ClassOrigin(flgs),                 CM_ClassOrigin(flgs),
                 props);                 props);
  
             ci.setPath(*CM_ObjectPath(cop));              SCMOInstance& scmoOrgInst = resData.getSCMO()[0];
             CMSetStatus(rc,CMPI_RC_OK);  
               SCMOInstance* scmoInst = new SCMOInstance(scmoOrgInst);
   
               // Rebuild the objectPath
               if (0==scmoInst->getNameSpace())
               {
                   scmoInst->setNameSpace(scmoObjPath->getNameSpace());
               }
               if (0==scmoInst->getClassName())
               {
                   scmoInst->setClassName(scmoObjPath->getClassName());
               }
               scmoInst->buildKeyBindingsFromProperties();
   
             CMPIInstance* cmpiInst = reinterpret_cast<CMPIInstance*>(             CMPIInstance* cmpiInst = reinterpret_cast<CMPIInstance*>(
                 new CMPI_Object(new CIMInstance(ci)));                  new CMPI_Object(scmoInst,CMPI_Object::ObjectTypeInstance));
   
               CMSetStatus(rc,CMPI_RC_OK);
             PEG_METHOD_EXIT();             PEG_METHOD_EXIT();
             return cmpiInst;             return cmpiInst;
         }         }
Line 225 
Line 266 
  
         mb = CM_BROKER;         mb = CM_BROKER;
  
           SCMOInstance* scmoInst = SCMO_Instance(ci);
           CIMInstance inst;
         try         try
         {         {
               scmoInst->getCIMInstance(inst);
   
             CIMObjectPath ncop = CM_CIMOM(mb)->createInstance(             CIMObjectPath ncop = CM_CIMOM(mb)->createInstance(
                 *CM_Context(ctx),                 *CM_Context(ctx),
                 CM_ObjectPath(cop)->getNameSpace(),                  scmoInst->getNameSpace(),
                 *CM_Instance(ci));                  inst);
             CMSetStatus(rc,CMPI_RC_OK);  
               SCMOInstance* newScmoInst=
                   CMPISCMOUtilities::getSCMOFromCIMObjectPath(
                       ncop,
                       scmoInst->getNameSpace());
   
             CMPIObjectPath* cmpiObjPath = reinterpret_cast<CMPIObjectPath*>(             CMPIObjectPath* cmpiObjPath = reinterpret_cast<CMPIObjectPath*>(
                 new CMPI_Object(new CIMObjectPath(ncop)));                  new CMPI_Object(newScmoInst,CMPI_Object::ObjectTypeObjectPath));
   
               CMSetStatus(rc,CMPI_RC_OK);
             PEG_METHOD_EXIT();             PEG_METHOD_EXIT();
             return cmpiObjPath;             return cmpiObjPath;
         }         }
Line 257 
Line 309 
             ctx->ft->getEntry(ctx,CMPIInvocationFlags,NULL).value.uint32;             ctx->ft->getEntry(ctx,CMPIInvocationFlags,NULL).value.uint32;
         const CIMPropertyList props = getList(properties);         const CIMPropertyList props = getList(properties);
  
           SCMOInstance* scmoInst = SCMO_Instance(ci);
           CIMInstance inst;
         try         try
         {         {
             CIMInstance cmi(*CM_Instance(ci));              scmoInst->getCIMInstance(inst);
             cmi.setPath(*CM_ObjectPath(cop));  
             CM_CIMOM(mb)->modifyInstance(             CM_CIMOM(mb)->modifyInstance(
                 *CM_Context(ctx),                 *CM_Context(ctx),
                 CM_ObjectPath(cop)->getNameSpace(),                  SCMO_ObjectPath(cop)->getNameSpace(),
                 cmi,                  inst,
                 CM_IncludeQualifiers(flgs),                 CM_IncludeQualifiers(flgs),
                 props);                 props);
         }         }
Line 283 
Line 337 
             TRC_CMPIPROVIDERINTERFACE,             TRC_CMPIPROVIDERINTERFACE,
             "CMPI_Broker:mbDeleteInstance()");             "CMPI_Broker:mbDeleteInstance()");
         mb = CM_BROKER;         mb = CM_BROKER;
         CIMObjectPath qop(  
             String::EMPTY,CIMNamespaceName(),  
             CM_ObjectPath(cop)->getClassName(),  
             CM_ObjectPath(cop)->getKeyBindings());  
  
           SCMOInstance* scmoObjPath = SCMO_ObjectPath(cop);
           CIMObjectPath qop;
         try         try
         {         {
               scmoObjPath->getCIMObjectPath(qop);
   
             CM_CIMOM(mb)->deleteInstance(             CM_CIMOM(mb)->deleteInstance(
                 *CM_Context(ctx),                 *CM_Context(ctx),
                 CM_ObjectPath(cop)->getNameSpace(),                  SCMO_ObjectPath(cop)->getNameSpace(),
                 qop); //*CM_ObjectPath(cop));                  qop);
         }         }
         HandlerCatchReturnStatus();         HandlerCatchReturnStatus();
  
Line 314 
Line 368 
  
         try         try
         {         {
             Array<CIMObject> const &en = CM_CIMOM(mb)->execQuery(              CIMResponseData resData = CM_CIMOM(mb)->execQuery(
                 *CM_Context(ctx),                 *CM_Context(ctx),
                 CM_ObjectPath(cop)->getNameSpace(),                  SCMO_ObjectPath(cop)->getNameSpace(),
                 String(lang),                 String(lang),
                 String(query));                 String(query));
                 CMSetStatus(rc,CMPI_RC_OK);  
   
               Array<SCMOInstance>* aObj =
                   new Array<SCMOInstance>(resData.getSCMO());
   
  
             CMPIEnumeration* cmpiEnum = reinterpret_cast<CMPIEnumeration*> (             CMPIEnumeration* cmpiEnum = reinterpret_cast<CMPIEnumeration*> (
                 new CMPI_Object(                  new CMPI_Object(new CMPI_ObjEnumeration(aObj)));
                 new CMPI_ObjEnumeration(new Array<CIMObject>(en))));  
               CMSetStatus(rc,CMPI_RC_OK);
             PEG_METHOD_EXIT();             PEG_METHOD_EXIT();
             return cmpiEnum;             return cmpiEnum;
         }         }
Line 350 
Line 409 
  
         try         try
         {         {
             Array<CIMInstance> const &en =              CIMResponseData resData =
                 CM_CIMOM(mb)->enumerateInstances(                 CM_CIMOM(mb)->enumerateInstances(
                     *CM_Context(ctx),                     *CM_Context(ctx),
                     CM_ObjectPath(cop)->getNameSpace(),                      SCMO_ObjectPath(cop)->getNameSpace(),
                     CM_ObjectPath(cop)->getClassName(),                      SCMO_ObjectPath(cop)->getClassName(),
                     CM_DeepInheritance(flgs),                      true,
                     false, //Use of localOnly is deprecated by DMTF.  
                     CM_IncludeQualifiers(flgs),                     CM_IncludeQualifiers(flgs),
                     CM_ClassOrigin(flgs),                     CM_ClassOrigin(flgs),
                     props);                     props);
  
             CMSetStatus(rc,CMPI_RC_OK);  
   
             // Workaround for bugzilla 4620  
             // When running out of process the returned instances don't contain             // When running out of process the returned instances don't contain
             // a name space. Create a writable copy of the array and add the              // a namespace.
             // namespace from the input parameters.              // Add the namespace from the input parameters where neccessary
               resData.completeNamespace(SCMO_ObjectPath(cop));
  
             Array<CIMInstance> * aInst = new Array<CIMInstance>(en);              Array<SCMOInstance>* aInst =
             Uint32 arrSize = aInst->size();                  new Array<SCMOInstance>(resData.getSCMO());
             if (arrSize && (*aInst)[0].getPath().getNameSpace().  
                 getString().size() == 0)  
             {  
                 for (Uint32 index = 0; index < arrSize; index++)  
                 {  
                     CIMObjectPath orgCop = (*aInst)[index].getPath();  
                     orgCop.setNameSpace(CM_ObjectPath(cop)->getNameSpace());  
                     (*aInst)[index].setPath(orgCop);  
                 }  
             }  
  
             CMPIEnumeration* cmpiEnum = reinterpret_cast<CMPIEnumeration*>(             CMPIEnumeration* cmpiEnum = reinterpret_cast<CMPIEnumeration*>(
                 new CMPI_Object(new CMPI_InstEnumeration(aInst)));                 new CMPI_Object(new CMPI_InstEnumeration(aInst)));
   
               CMSetStatus(rc,CMPI_RC_OK);
             PEG_METHOD_EXIT();             PEG_METHOD_EXIT();
             return cmpiEnum;             return cmpiEnum;
         }         }
Line 404 
Line 452 
  
         try         try
         {         {
             Array<CIMObjectPath> const &en =              CIMResponseData resData =
                 CM_CIMOM(mb)->enumerateInstanceNames(                 CM_CIMOM(mb)->enumerateInstanceNames(
                     *CM_Context(ctx),                     *CM_Context(ctx),
                     CM_ObjectPath(cop)->getNameSpace(),                      SCMO_ObjectPath(cop)->getNameSpace(),
                     CM_ObjectPath(cop)->getClassName());                      SCMO_ObjectPath(cop)->getClassName());
                     CMSetStatus(rc,CMPI_RC_OK);  
  
             // When running out of process the returned instances don't contain             // When running out of process the returned instances don't contain
             // a name space. Create a writable copy of the array and add the              // a namespace.
             // namespace from the input parameters.              // Add the namespace from the input parameters where neccessary
             Array<CIMObjectPath> * aRef = new Array<CIMObjectPath>(en);              resData.completeNamespace(SCMO_ObjectPath(cop));
             Uint32 arrSize = aRef->size();  
             if (arrSize && (*aRef)[0].getNameSpace().getString().size() == 0)              Array<SCMOInstance>* aRef =
             {                  new Array<SCMOInstance>(resData.getSCMO());
                 for (Uint32 index = 0; index < arrSize; index++)  
                 {  
                     (*aRef)[index].setNameSpace(  
                         CM_ObjectPath(cop)->getNameSpace());  
                 }  
             }  
             CMPIEnumeration* cmpiEnum = reinterpret_cast<CMPIEnumeration*>(             CMPIEnumeration* cmpiEnum = reinterpret_cast<CMPIEnumeration*>(
                 new CMPI_Object(new CMPI_OpEnumeration(aRef)));                 new CMPI_Object(new CMPI_OpEnumeration(aRef)));
   
               CMSetStatus(rc,CMPI_RC_OK);
             PEG_METHOD_EXIT();             PEG_METHOD_EXIT();
             return cmpiEnum;             return cmpiEnum;
         }         }
Line 453 
Line 498 
         //  distinguish instanceNames from classNames in every case         //  distinguish instanceNames from classNames in every case
         //  The instanceName of a singleton instance of a keyless class has no         //  The instanceName of a singleton instance of a keyless class has no
         //  key bindings         //  key bindings
         if (!CM_ObjectPath(cop)->getKeyBindings().size())          if (!SCMO_ObjectPath(cop)->getKeyBindingCount())
         {         {
             CMSetStatus(rc, CMPI_RC_ERR_FAILED);             CMSetStatus(rc, CMPI_RC_ERR_FAILED);
             PEG_METHOD_EXIT();             PEG_METHOD_EXIT();
Line 462 
Line 507 
         CMPIFlags flgs =         CMPIFlags flgs =
             ctx->ft->getEntry(ctx,CMPIInvocationFlags,NULL).value.uint32;             ctx->ft->getEntry(ctx,CMPIInvocationFlags,NULL).value.uint32;
         const CIMPropertyList props = getList(properties);         const CIMPropertyList props = getList(properties);
         CIMObjectPath qop(  
             String::EMPTY,CIMNamespaceName(),  
             CM_ObjectPath(cop)->getClassName(),  
             CM_ObjectPath(cop)->getKeyBindings());  
  
           SCMOInstance* scmoObjPath = SCMO_ObjectPath(cop);
           CIMObjectPath qop;
         try         try
         {         {
             Array<CIMObject> const &en =              scmoObjPath->getCIMObjectPath(qop);
               // For compatibility with previous implementations have empty ns
               qop.setNameSpace(CIMNamespaceName());
   
               CIMResponseData resData =
                 CM_CIMOM(mb)->associators(                 CM_CIMOM(mb)->associators(
                     *CM_Context(ctx),                     *CM_Context(ctx),
                     CM_ObjectPath(cop)->getNameSpace(),                      SCMO_ObjectPath(cop)->getNameSpace(),
                     qop,                     qop,
                     assocClass ? CIMName(assocClass) : CIMName(),                     assocClass ? CIMName(assocClass) : CIMName(),
                     resultClass ? CIMName(resultClass) : CIMName(),                     resultClass ? CIMName(resultClass) : CIMName(),
Line 482 
Line 529 
                     CM_ClassOrigin(flgs),                     CM_ClassOrigin(flgs),
                     props);                     props);
  
             CMSetStatus(rc,CMPI_RC_OK);  
   
             // Workaround for bugzilla 4620  
             // When running out of process the returned instances don't contain             // When running out of process the returned instances don't contain
             // a name space. Create a writable copy of the array and add the              // a namespace.
             // namespace from the input parameters.              // Add the namespace from the input parameters where neccessary
             Array<CIMObject> * aObj = new Array<CIMObject>(en);              resData.completeNamespace(scmoObjPath);
             Uint32 arrSize = aObj->size();  
             if (arrSize && (*aObj)[0].getPath().getNameSpace().              Array<SCMOInstance>* aObj =
                 getString().size() == 0)                  new Array<SCMOInstance>(resData.getSCMO());
             {  
                 for (Uint32 index = 0; index < arrSize; index++)  
                 {  
                     CIMObjectPath orgCop = (*aObj)[index].getPath();  
                     orgCop.setNameSpace(CM_ObjectPath(cop)->getNameSpace());  
                     (*aObj)[index].setPath(orgCop);  
                 }  
             }  
  
             CMPIEnumeration* cmpiEnum = reinterpret_cast<CMPIEnumeration*>(             CMPIEnumeration* cmpiEnum = reinterpret_cast<CMPIEnumeration*>(
                 new CMPI_Object(new CMPI_ObjEnumeration(aObj)));                 new CMPI_Object(new CMPI_ObjEnumeration(aObj)));
   
               CMSetStatus(rc,CMPI_RC_OK);
             PEG_METHOD_EXIT();             PEG_METHOD_EXIT();
             return cmpiEnum;             return cmpiEnum;
         }         }
Line 529 
Line 567 
         //  distinguish instanceNames from classNames in every case         //  distinguish instanceNames from classNames in every case
         //  The instanceName of a singleton instance of a keyless class has no         //  The instanceName of a singleton instance of a keyless class has no
         //  key bindings         //  key bindings
         if (!CM_ObjectPath(cop)->getKeyBindings().size())          if (!SCMO_ObjectPath(cop)->getKeyBindingCount())
         {         {
             CMSetStatus(rc, CMPI_RC_ERR_FAILED);             CMSetStatus(rc, CMPI_RC_ERR_FAILED);
             PEG_METHOD_EXIT();             PEG_METHOD_EXIT();
             return 0;             return 0;
         }         }
         CIMObjectPath qop(  
             String::EMPTY,CIMNamespaceName(),  
             CM_ObjectPath(cop)->getClassName(),  
             CM_ObjectPath(cop)->getKeyBindings());  
  
           SCMOInstance* scmoObjPath = SCMO_ObjectPath(cop);
           CIMObjectPath qop;
         try         try
         {         {
             Array<CIMObjectPath> const &en =              scmoObjPath->getCIMObjectPath(qop);
               // For compatibility with previous implementations have empty ns
               qop.setNameSpace(CIMNamespaceName());
   
               CIMResponseData resData =
                 CM_CIMOM(mb)->associatorNames(                 CM_CIMOM(mb)->associatorNames(
                     *CM_Context(ctx),                     *CM_Context(ctx),
                     CM_ObjectPath(cop)->getNameSpace(),                      scmoObjPath->getNameSpace(),
                     qop,                     qop,
                     assocClass ? CIMName(assocClass) : CIMName(),                     assocClass ? CIMName(assocClass) : CIMName(),
                     resultClass ? CIMName(resultClass) : CIMName(),                     resultClass ? CIMName(resultClass) : CIMName(),
                     role ? String(role) : String::EMPTY,                     role ? String(role) : String::EMPTY,
                     resultRole ? String(resultRole) : String::EMPTY);                     resultRole ? String(resultRole) : String::EMPTY);
                     CMSetStatus(rc,CMPI_RC_OK);  
  
             // When running out of process the returned instances don't contain             // When running out of process the returned instances don't contain
             // a name space. Create a writable copy of the array and add the              // a namespace.
             // namespace from the input parameters.              // Add the namespace from the input parameters where neccessary
             Array<CIMObjectPath> * aRef = new Array<CIMObjectPath>(en);              resData.completeNamespace(scmoObjPath);
             Uint32 arrSize = aRef->size();  
             if (arrSize && (*aRef)[0].getNameSpace().getString().size() == 0)              Array<SCMOInstance>* aRef =
             {                  new Array<SCMOInstance>(resData.getSCMO());
                 for (Uint32 index = 0; index < arrSize; index++)  
                 {  
                     (*aRef)[index].setNameSpace(  
                         CM_ObjectPath(cop)->getNameSpace());  
                 }  
             }  
  
             CMPIEnumeration* cmpiEnum = reinterpret_cast<CMPIEnumeration*>(             CMPIEnumeration* cmpiEnum = reinterpret_cast<CMPIEnumeration*>(
                 new CMPI_Object(new CMPI_OpEnumeration(aRef)));                 new CMPI_Object(new CMPI_OpEnumeration(aRef)));
   
               CMSetStatus(rc,CMPI_RC_OK);
             PEG_METHOD_EXIT();             PEG_METHOD_EXIT();
             return cmpiEnum;             return cmpiEnum;
         }         }
Line 594 
Line 630 
         //  distinguish instanceNames from classNames in every case         //  distinguish instanceNames from classNames in every case
         //  The instanceName of a singleton instance of a keyless class has no         //  The instanceName of a singleton instance of a keyless class has no
         //  key bindings         //  key bindings
         if (!CM_ObjectPath(cop)->getKeyBindings().size())          if (!SCMO_ObjectPath(cop)->getKeyBindingCount())
         {         {
             CMSetStatus(rc, CMPI_RC_ERR_FAILED);             CMSetStatus(rc, CMPI_RC_ERR_FAILED);
             PEG_METHOD_EXIT();             PEG_METHOD_EXIT();
Line 603 
Line 639 
         CMPIFlags flgs =         CMPIFlags flgs =
            ctx->ft->getEntry(ctx,CMPIInvocationFlags,NULL).value.uint32;            ctx->ft->getEntry(ctx,CMPIInvocationFlags,NULL).value.uint32;
         CIMPropertyList props = getList(properties);         CIMPropertyList props = getList(properties);
         CIMObjectPath qop(  
             String::EMPTY,  
             CIMNamespaceName(),  
             CM_ObjectPath(cop)->getClassName(),  
             CM_ObjectPath(cop)->getKeyBindings());  
  
   
           SCMOInstance* scmoObjPath = SCMO_ObjectPath(cop);
           CIMObjectPath qop;
         try         try
         {         {
             Array<CIMObject> const &en =              scmoObjPath->getCIMObjectPath(qop);
               // For compatibility with previous implementations have empty ns
               qop.setNameSpace(CIMNamespaceName());
   
               CIMResponseData resData =
                 CM_CIMOM(mb)->references(                 CM_CIMOM(mb)->references(
                     *CM_Context(ctx),                     *CM_Context(ctx),
                     CM_ObjectPath(cop)->getNameSpace(),                      scmoObjPath->getNameSpace(),
                     qop,                     qop,
                     resultClass ? CIMName(resultClass) : CIMName(),                     resultClass ? CIMName(resultClass) : CIMName(),
                     role ? String(role) : String::EMPTY,                     role ? String(role) : String::EMPTY,
Line 623 
Line 661 
                     props);                     props);
  
             CMSetStatus(rc,CMPI_RC_OK);             CMSetStatus(rc,CMPI_RC_OK);
             // Workaround for bugzilla 4620  
             // When running out of process the returned instances don't contain              // Add the namespace from the input parameters when neccessary
             // a name space. Create a writable copy of the array and add the              resData.completeNamespace(scmoObjPath);
             // namespace from the input parameters.  
             Array<CIMObject> * aObj = new Array<CIMObject>(en);              Array<SCMOInstance>* aObj =
             Uint32 arrSize = aObj->size();                  new Array<SCMOInstance>(resData.getSCMO());
             if (arrSize && (*aObj)[0].getPath().getNameSpace().  
                 getString().size() == 0)  
             {  
                 for (Uint32 index = 0; index < arrSize; index++)  
                 {  
                     CIMObjectPath orgCop = (*aObj)[index].getPath();  
                     orgCop.setNameSpace(CM_ObjectPath(cop)->getNameSpace());  
                     (*aObj)[index].setPath(orgCop);  
                 }  
             }  
  
             CMPIEnumeration* cmpiEnum = reinterpret_cast<CMPIEnumeration*>(             CMPIEnumeration* cmpiEnum = reinterpret_cast<CMPIEnumeration*>(
                 new CMPI_Object(new CMPI_ObjEnumeration(aObj)));                 new CMPI_Object(new CMPI_ObjEnumeration(aObj)));
Line 666 
Line 694 
         //  distinguish instanceNames from classNames in every case         //  distinguish instanceNames from classNames in every case
         //  The instanceName of a singleton instance of a keyless class has no         //  The instanceName of a singleton instance of a keyless class has no
         //  key bindings         //  key bindings
         if (!CM_ObjectPath(cop)->getKeyBindings().size())          if (!SCMO_ObjectPath(cop)->getKeyBindingCount())
         {         {
             CMSetStatus(rc, CMPI_RC_ERR_FAILED);             CMSetStatus(rc, CMPI_RC_ERR_FAILED);
             PEG_METHOD_EXIT();             PEG_METHOD_EXIT();
             return 0;             return 0;
         }         }
         CIMObjectPath qop(  
             String::EMPTY,  
             CIMNamespaceName(),  
             CM_ObjectPath(cop)->getClassName(),  
             CM_ObjectPath(cop)->getKeyBindings());  
  
           SCMOInstance* scmoObjPath = SCMO_ObjectPath(cop);
           CIMObjectPath qop;
         try         try
         {         {
             Array<CIMObjectPath> const &en =              scmoObjPath->getCIMObjectPath(qop);
               // For compatibility with previous implementations have empty ns
               qop.setNameSpace(CIMNamespaceName());
   
               CIMResponseData resData =
                 CM_CIMOM(mb)->referenceNames(                 CM_CIMOM(mb)->referenceNames(
                     *CM_Context(ctx),                     *CM_Context(ctx),
                     CM_ObjectPath(cop)->getNameSpace(),                      scmoObjPath->getNameSpace(),
                     qop,                     qop,
                     resultClass ? CIMName(resultClass) : CIMName(),                     resultClass ? CIMName(resultClass) : CIMName(),
                     role ? String(role) : String::EMPTY);                     role ? String(role) : String::EMPTY);
                     CMSetStatus(rc,CMPI_RC_OK);  
  
             // When running out of process the returned instances don't contain              // Add the namespace from the input parameters when neccessary
             // a name space. Create a writable copy of the array and add the              resData.completeNamespace(scmoObjPath);
             // namespace from the input parameters.  
             Array<CIMObjectPath> * aRef = new Array<CIMObjectPath>(en);              Array<SCMOInstance>* aRef =
             Uint32 arrSize = aRef->size();                  new Array<SCMOInstance>(resData.getSCMO());
             if (arrSize && (*aRef)[0].getNameSpace().getString().size() == 0)  
             {  
                 for (Uint32 index = 0; index < arrSize; index++)  
                 {  
                     (*aRef)[index].setNameSpace(  
                         CM_ObjectPath(cop)->getNameSpace());  
                 }  
             }  
  
             CMPIEnumeration* cmpiEnum = reinterpret_cast<CMPIEnumeration*>(             CMPIEnumeration* cmpiEnum = reinterpret_cast<CMPIEnumeration*>(
                 new CMPI_Object(new CMPI_OpEnumeration(aRef)));                 new CMPI_Object(new CMPI_OpEnumeration(aRef)));
               CMSetStatus(rc,CMPI_RC_OK);
             PEG_METHOD_EXIT();             PEG_METHOD_EXIT();
             return cmpiEnum;             return cmpiEnum;
         }         }
Line 729 
Line 750 
             "CMPI_Broker:mbInvokeMethod()");             "CMPI_Broker:mbInvokeMethod()");
         CMPIData data = {0,CMPI_nullValue,{0}};         CMPIData data = {0,CMPI_nullValue,{0}};
         mb = CM_BROKER;         mb = CM_BROKER;
         CIMObjectPath qop(  
             String::EMPTY,CIMNamespaceName(),  
             CM_ObjectPath(cop)->getClassName(),  
             CM_ObjectPath(cop)->getKeyBindings());  
  
   
           SCMOInstance* scmoObjPath = SCMO_ObjectPath(cop);
           CIMObjectPath qop;
         try         try
         {         {
               scmoObjPath->getCIMObjectPath(qop);
   
             CIMValue v = CM_CIMOM(mb)->invokeMethod(             CIMValue v = CM_CIMOM(mb)->invokeMethod(
                 *CM_Context(ctx),                 *CM_Context(ctx),
                 CM_ObjectPath(cop)->getNameSpace(),                  SCMO_ObjectPath(cop)->getNameSpace(),
                 qop,                 qop,
                 method ? String(method) : String::EMPTY,                 method ? String(method) : String::EMPTY,
                 *CM_Args(in),                 *CM_Args(in),
                 *CM_Args(out));                 *CM_Args(out));
   
                 CIMType vType=v.getType();                 CIMType vType=v.getType();
                 CMPIType t = type2CMPIType(vType,v.isArray());                 CMPIType t = type2CMPIType(vType,v.isArray());
                 value2CMPIData(v,t,&data);                 value2CMPIData(v,t,&data);
   
             if (rc)             if (rc)
             {             {
                 CMSetStatus(rc,CMPI_RC_OK);                 CMSetStatus(rc,CMPI_RC_OK);
Line 772 
Line 796 
         CMPIrc rc;         CMPIrc rc;
         CIMValue v = value2CIMValue(val,type,&rc);         CIMValue v = value2CIMValue(val,type,&rc);
  
           SCMOInstance* scmoObjPath = SCMO_ObjectPath(cop);
           CIMObjectPath qop;
         try         try
         {         {
               scmoObjPath->getCIMObjectPath(qop);
   
             CM_CIMOM(mb)->setProperty(             CM_CIMOM(mb)->setProperty(
                 *CM_Context(ctx),                 *CM_Context(ctx),
                 CM_ObjectPath(cop)->getNameSpace(),                  SCMO_ObjectPath(cop)->getNameSpace(),
                 *CM_ObjectPath(cop),                  qop,
                 String(name),                 String(name),
                 v);                 v);
         }         }
Line 800 
Line 828 
         mb = CM_BROKER;         mb = CM_BROKER;
         CMPIData data = {0,CMPI_nullValue,{0}};         CMPIData data = {0,CMPI_nullValue,{0}};
  
           SCMOInstance* scmoObjPath = SCMO_ObjectPath(cop);
           CIMObjectPath qop;
           scmoObjPath->getCIMObjectPath(qop);
   
         try         try
         {         {
             CIMValue v = CM_CIMOM(mb)->getProperty(             CIMValue v = CM_CIMOM(mb)->getProperty(
                 *CM_Context(ctx),                 *CM_Context(ctx),
                 CM_ObjectPath(cop)->getNameSpace(),                  SCMO_ObjectPath(cop)->getNameSpace(),
                 *CM_ObjectPath(cop),                  qop,
                 String(name));                 String(name));
             CIMType vType = v.getType();             CIMType vType = v.getType();
             CMPIType t = type2CMPIType(vType,v.isArray());             CMPIType t = type2CMPIType(vType,v.isArray());
Line 883 
Line 915 
         CMPI_Broker *mb = (CMPI_Broker*)eMb;         CMPI_Broker *mb = (CMPI_Broker*)eMb;
         CMPIProviderManager::indProvRecord *prec;         CMPIProviderManager::indProvRecord *prec;
         OperationContext* context = CM_Context(ctx);         OperationContext* context = CM_Context(ctx);
   
           SCMOInstance* scmoInst = SCMO_Instance(ind);
           CIMInstance indInst;
           scmoInst->getCIMInstance(indInst);
   
         // When an indication to be delivered comes from Remote providers,         // When an indication to be delivered comes from Remote providers,
         // the CMPIBroker contains the name of the provider in the form         // the CMPIBroker contains the name of the provider in the form
         // of physical-name:logical-name. Search using logical-name. -V 5884         // of physical-name:logical-name. Search using logical-name. -V 5884
Line 916 
Line 953 
                         SubscriptionInstanceNamesContainer(                         SubscriptionInstanceNamesContainer(
                             subscriptionInstanceNames));                             subscriptionInstanceNames));
                 }                 }
                 CIMIndication cimIndication(*CM_Instance(ind));                  CIMIndication cimIndication(indInst);
                 try                 try
                 {                 {
                     prec->handler->deliver(                     prec->handler->deliver(


Legend:
Removed from v.1.53  
changed lines
  Added in v.1.53.2.9

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2