version 1.53, 2009/06/30 10:40:14
|
version 1.53.2.9, 2009/10/30 15:51:52
|
|
|
#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; |
|
|
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" |
|
|
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; |
} | } |
|
|
| |
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; |
} | } |
|
|
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); |
} | } |
|
|
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(); |
| |
|
|
| |
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; |
} | } |
|
|
| |
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; |
} | } |
|
|
| |
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; |
} | } |
|
|
// 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(); |
|
|
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(), |
|
|
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; |
} | } |
|
|
// 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; |
} | } |
|
|
// 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(); |
|
|
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, |
|
|
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))); |
|
|
// 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; |
} | } |
|
|
"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); |
|
|
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); |
} | } |
|
|
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()); |
|
|
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 |
|
|
SubscriptionInstanceNamesContainer( | SubscriptionInstanceNamesContainer( |
subscriptionInstanceNames)); | subscriptionInstanceNames)); |
} | } |
CIMIndication cimIndication(*CM_Instance(ind)); |
CIMIndication cimIndication(indInst); |
try | try |
{ | { |
prec->handler->deliver( | prec->handler->deliver( |