version 1.157, 2009/06/30 10:40:14
|
version 1.157.2.7, 2009/10/24 23:34:48
|
|
|
#include "CMPI_ObjectPath.h" | #include "CMPI_ObjectPath.h" |
#include "CMPI_Result.h" | #include "CMPI_Result.h" |
#include "CMPI_SelectExp.h" | #include "CMPI_SelectExp.h" |
|
#include "CMPISCMOUtilities.h" |
|
#include "CMPI_Value.h" |
|
|
| |
#include <Pegasus/Common/CIMMessage.h> | #include <Pegasus/Common/CIMMessage.h> |
#include <Pegasus/Common/OperationContext.h> | #include <Pegasus/Common/OperationContext.h> |
|
|
selxTab.lookup(i.key(), selx); | selxTab.lookup(i.key(), selx); |
if (selx->eSelx) | if (selx->eSelx) |
delete selx->eSelx; | delete selx->eSelx; |
if (selx->qContext) |
|
delete selx->qContext; |
|
delete selx; | delete selx; |
//Same as above! | //Same as above! |
//selxTab.remove(i.key()); | //selxTab.remove(i.key()); |
|
|
(const char*) | (const char*) |
request->instanceName.getClassName().getString().getCString())); | request->instanceName.getClassName().getString().getCString())); |
| |
// make target object path |
|
CIMObjectPath objectPath( |
|
System::getHostName(), |
|
request->nameSpace, |
|
request->instanceName.getClassName(), |
|
request->instanceName.getKeyBindings()); |
|
|
|
Boolean remote=false; | Boolean remote=false; |
OpProviderHolder ph; | OpProviderHolder ph; |
CString remoteInfo; | CString remoteInfo; |
|
|
| |
CMPIStatus rc={CMPI_RC_OK,NULL}; | CMPIStatus rc={CMPI_RC_OK,NULL}; |
CMPI_ContextOnStack eCtx(request->operationContext); | CMPI_ContextOnStack eCtx(request->operationContext); |
CMPI_ObjectPathOnStack eRef(objectPath); |
|
CMPI_ResultOnStack eRes(handler,pr.getBroker()); | CMPI_ResultOnStack eRes(handler,pr.getBroker()); |
CMPI_ThreadContext thr(pr.getBroker(),&eCtx); | CMPI_ThreadContext thr(pr.getBroker(),&eCtx); |
| |
CMPIPropertyList props(request->propertyList); | CMPIPropertyList props(request->propertyList); |
CString nameSpace = request->nameSpace.getString().getCString(); | CString nameSpace = request->nameSpace.getString().getCString(); |
|
CString className = request->className.getString().getCString(); |
| |
_setupCMPIContexts( | _setupCMPIContexts( |
&eCtx, | &eCtx, |
|
|
request->includeClassOrigin, | request->includeClassOrigin, |
true); | true); |
| |
|
// make target object path |
|
SCMOClass* scmoClass = |
|
mbGetSCMOClass( |
|
pr.getBroker(), |
|
(const char*)nameSpace, |
|
(const char*)className); |
|
if (0 == scmoClass) |
|
{ |
|
// This indicates a severe error, since we should't have come |
|
// here at all, if the class is invalid |
|
PEG_TRACE((TRC_PROVIDERMANAGER,Tracer::LEVEL1, |
|
"CMPIProviderManager::handleGetInstanceRequest - " |
|
"Failed to obtain CIMClass for Namespace: %s Classname: %s", |
|
(const char*) nameSpace, |
|
(const char*) className)); |
|
|
|
CIMException cimException(CIM_ERR_NOT_FOUND); |
|
throw cimException; |
|
} |
|
|
|
SCMOInstance objectPath(*scmoClass,request->instanceName); |
|
objectPath.setHostName((const char*)System::getHostName().getCString()); |
|
CMPI_ObjectPathOnStack eRef(objectPath); |
|
|
CMPIProvider::pm_service_op_lock op_lock(&pr); | CMPIProvider::pm_service_op_lock op_lock(&pr); |
| |
PEG_TRACE(( | PEG_TRACE(( |
|
|
handler.setContext(response->operationContext); | handler.setContext(response->operationContext); |
} | } |
| |
if (rc.rc!=CMPI_RC_OK) |
_throwCIMException(rc, eRes.resError); |
{ |
|
CIMException cimException( |
|
(CIMStatusCode)rc.rc, |
|
rc.msg ? CMGetCharsPtr(rc.msg, NULL) : String::EMPTY); |
|
|
|
if (eRes.resError) |
|
{ |
|
for (CMPI_Error* currErr=eRes.resError; |
|
currErr!=NULL; |
|
currErr=currErr->nextError) |
|
{ |
|
cimException.addError( |
|
((CIMError*)currErr->hdl)->getInstance()); |
|
} |
|
} |
|
throw cimException; |
|
} |
|
} | } |
HandlerCatch(handler); | HandlerCatch(handler); |
| |
|
|
(const char*) request->nameSpace.getString().getCString(), | (const char*) request->nameSpace.getString().getCString(), |
(const char*) request->className.getString().getCString())); | (const char*) request->className.getString().getCString())); |
| |
// make target object path |
|
CIMObjectPath objectPath( |
|
System::getHostName(), |
|
request->nameSpace, |
|
request->className); |
|
| |
Boolean remote=false; | Boolean remote=false; |
OpProviderHolder ph; | OpProviderHolder ph; |
|
|
| |
CMPIStatus rc={CMPI_RC_OK,NULL}; | CMPIStatus rc={CMPI_RC_OK,NULL}; |
CMPI_ContextOnStack eCtx(request->operationContext); | CMPI_ContextOnStack eCtx(request->operationContext); |
CMPI_ObjectPathOnStack eRef(objectPath); |
|
CMPI_ResultOnStack eRes(handler,pr.getBroker()); | CMPI_ResultOnStack eRes(handler,pr.getBroker()); |
CMPI_ThreadContext thr(pr.getBroker(),&eCtx); | CMPI_ThreadContext thr(pr.getBroker(),&eCtx); |
CMPIPropertyList props(propertyList); | CMPIPropertyList props(propertyList); |
CString nameSpace = request->nameSpace.getString().getCString(); | CString nameSpace = request->nameSpace.getString().getCString(); |
|
CString className = request->className.getString().getCString(); |
| |
_setupCMPIContexts( | _setupCMPIContexts( |
&eCtx, | &eCtx, |
|
|
request->includeClassOrigin, | request->includeClassOrigin, |
true); | true); |
| |
|
// make target object path |
|
SCMOClass* scmoClass = |
|
mbGetSCMOClass( |
|
pr.getBroker(), |
|
(const char*)nameSpace, |
|
(const char*)className); |
|
if (0 == scmoClass) |
|
{ |
|
// This indicates a severe error, since we should't have come |
|
// here at all, if the class is invalid |
|
PEG_TRACE((TRC_PROVIDERMANAGER,Tracer::LEVEL1, |
|
"CMPIProviderManager::handleEnumerateInstancesRequest - " |
|
"Failed to obtain CIMClass for Namespace: %s Classname: %s", |
|
(const char*) nameSpace, |
|
(const char*) className)); |
|
|
|
CIMException cimException(CIM_ERR_NOT_FOUND); |
|
throw cimException; |
|
} |
|
|
|
SCMOInstance objectPath(*scmoClass); |
|
CMPI_ObjectPathOnStack eRef(objectPath); |
|
|
CMPIProvider::pm_service_op_lock op_lock(&pr); | CMPIProvider::pm_service_op_lock op_lock(&pr); |
| |
PEG_TRACE(( | PEG_TRACE(( |
|
|
handler.setContext(response->operationContext); | handler.setContext(response->operationContext); |
} | } |
| |
if (rc.rc!=CMPI_RC_OK) |
_throwCIMException(rc, eRes.resError); |
{ |
|
CIMException cimException( |
|
(CIMStatusCode)rc.rc, |
|
rc.msg ? CMGetCharsPtr(rc.msg, NULL) : String::EMPTY); |
|
|
|
if (eRes.resError) |
|
{ |
|
for (CMPI_Error* currErr=eRes.resError; |
|
currErr!=NULL; |
|
currErr=currErr->nextError) |
|
{ |
|
cimException.addError( |
|
((CIMError*)currErr->hdl)->getInstance()); |
|
} |
|
} |
|
throw cimException; |
|
} |
|
|
|
} | } |
HandlerCatch(handler); | HandlerCatch(handler); |
| |
|
|
(const char*) request->nameSpace.getString().getCString(), | (const char*) request->nameSpace.getString().getCString(), |
(const char*) request->className.getString().getCString())); | (const char*) request->className.getString().getCString())); |
| |
// make target object path |
|
CIMObjectPath objectPath( |
|
System::getHostName(), |
|
request->nameSpace, |
|
request->className); |
|
|
|
Boolean remote=false; | Boolean remote=false; |
OpProviderHolder ph; | OpProviderHolder ph; |
CString remoteInfo; | CString remoteInfo; |
|
|
| |
CMPIStatus rc={CMPI_RC_OK,NULL}; | CMPIStatus rc={CMPI_RC_OK,NULL}; |
CMPI_ContextOnStack eCtx(request->operationContext); | CMPI_ContextOnStack eCtx(request->operationContext); |
CMPI_ObjectPathOnStack eRef(objectPath); |
|
CMPI_ResultOnStack eRes(handler,pr.getBroker()); | CMPI_ResultOnStack eRes(handler,pr.getBroker()); |
CMPI_ThreadContext thr(pr.getBroker(),&eCtx); | CMPI_ThreadContext thr(pr.getBroker(),&eCtx); |
| |
CString nameSpace = request->nameSpace.getString().getCString(); | CString nameSpace = request->nameSpace.getString().getCString(); |
|
CString className = request->className.getString().getCString(); |
| |
_setupCMPIContexts( | _setupCMPIContexts( |
&eCtx, | &eCtx, |
|
|
false, | false, |
true); | true); |
| |
|
// make target object path |
|
SCMOClass* scmoClass = |
|
mbGetSCMOClass( |
|
pr.getBroker(), |
|
(const char*)nameSpace, |
|
(const char*)className); |
|
if (0 == scmoClass) |
|
{ |
|
// This indicates a severe error, since we should't have come |
|
// here at all, if the class is invalid |
|
PEG_TRACE((TRC_PROVIDERMANAGER,Tracer::LEVEL1, |
|
"CMPIProviderManager::handleEnumerateInstanceNamesRequest - " |
|
"Failed to obtain CIMClass for Namespace: %s Classname: %s", |
|
(const char*) nameSpace, |
|
(const char*) className)); |
|
|
|
CIMException cimException(CIM_ERR_NOT_FOUND); |
|
throw cimException; |
|
} |
|
|
|
SCMOInstance objectPath(*scmoClass); |
|
CMPI_ObjectPathOnStack eRef(objectPath); |
|
|
CMPIProvider::pm_service_op_lock op_lock(&pr); | CMPIProvider::pm_service_op_lock op_lock(&pr); |
| |
PEG_TRACE(( | PEG_TRACE(( |
|
|
CMGetCharsPtr(cldata.value.string, NULL))))); | CMGetCharsPtr(cldata.value.string, NULL))))); |
handler.setContext(response->operationContext); | handler.setContext(response->operationContext); |
} | } |
|
_throwCIMException(rc, eRes.resError); |
if (rc.rc!=CMPI_RC_OK) |
|
{ |
|
CIMException cimException( |
|
(CIMStatusCode)rc.rc, |
|
rc.msg ? CMGetCharsPtr(rc.msg, NULL) : String::EMPTY); |
|
|
|
if (eRes.resError) |
|
{ |
|
for (CMPI_Error* currErr=eRes.resError; |
|
currErr!=NULL; |
|
currErr=currErr->nextError) |
|
{ |
|
cimException.addError( |
|
((CIMError*)currErr->hdl)->getInstance()); |
|
} |
|
} |
|
throw cimException; |
|
} |
|
} | } |
HandlerCatch(handler); | HandlerCatch(handler); |
| |
|
|
request->newInstance.getPath().getClassName().getString().getCString() | request->newInstance.getPath().getClassName().getString().getCString() |
)); | )); |
| |
// make target object path |
|
CIMObjectPath objectPath( |
|
System::getHostName(), |
|
request->nameSpace, |
|
request->newInstance.getPath().getClassName(), |
|
request->newInstance.getPath().getKeyBindings()); |
|
request->newInstance.setPath(objectPath); |
|
|
|
Boolean remote=false; | Boolean remote=false; |
OpProviderHolder ph; | OpProviderHolder ph; |
CString remoteInfo; | CString remoteInfo; |
|
|
| |
CMPIStatus rc={CMPI_RC_OK,NULL}; | CMPIStatus rc={CMPI_RC_OK,NULL}; |
CMPI_ContextOnStack eCtx(request->operationContext); | CMPI_ContextOnStack eCtx(request->operationContext); |
CMPI_ObjectPathOnStack eRef(objectPath); |
|
CMPI_ResultOnStack eRes(handler,pr.getBroker()); | CMPI_ResultOnStack eRes(handler,pr.getBroker()); |
CMPI_InstanceOnStack eInst(request->newInstance); |
|
CMPI_ThreadContext thr(pr.getBroker(),&eCtx); | CMPI_ThreadContext thr(pr.getBroker(),&eCtx); |
| |
CString nameSpace = request->nameSpace.getString().getCString(); | CString nameSpace = request->nameSpace.getString().getCString(); |
|
CString className = request->newInstance.getPath().getClassName(). |
|
getString().getCString(); |
| |
_setupCMPIContexts( | _setupCMPIContexts( |
&eCtx, | &eCtx, |
|
|
false, | false, |
true); | true); |
| |
|
// make target object path and new instance |
|
SCMOClass* scmoClass = |
|
mbGetSCMOClass( |
|
pr.getBroker(), |
|
(const char*)nameSpace, |
|
(const char*)className); |
|
if (0 == scmoClass) |
|
{ |
|
// This indicates a severe error, since we should't have come |
|
// here at all, if the class is invalid |
|
PEG_TRACE((TRC_PROVIDERMANAGER,Tracer::LEVEL1, |
|
"CMPIProviderManager::handleGetInstanceRequest - " |
|
"Failed to obtain CIMClass for Namespace: %s Classname: %s", |
|
(const char*) nameSpace, |
|
(const char*) className)); |
|
|
|
CIMException cimException(CIM_ERR_NOT_FOUND); |
|
throw cimException; |
|
} |
|
|
|
SCMOInstance newInstance(*scmoClass,request->newInstance); |
|
newInstance.setHostName( |
|
(const char*)System::getHostName().getCString()); |
|
CMPI_ObjectPathOnStack eRef(newInstance); |
|
CMPI_InstanceOnStack eInst(newInstance); |
|
|
CMPIProvider::pm_service_op_lock op_lock(&pr); | CMPIProvider::pm_service_op_lock op_lock(&pr); |
| |
PEG_TRACE(( | PEG_TRACE(( |
|
|
CMGetCharsPtr(cldata.value.string, NULL))))); | CMGetCharsPtr(cldata.value.string, NULL))))); |
handler.setContext(response->operationContext); | handler.setContext(response->operationContext); |
} | } |
|
_throwCIMException(rc, eRes.resError); |
if (rc.rc!=CMPI_RC_OK) |
|
{ |
|
CIMException cimException( |
|
(CIMStatusCode)rc.rc, |
|
rc.msg ? CMGetCharsPtr(rc.msg, NULL) : String::EMPTY); |
|
|
|
if (eRes.resError) |
|
{ |
|
for (CMPI_Error* currErr=eRes.resError; |
|
currErr!=NULL; |
|
currErr=currErr->nextError) |
|
{ |
|
cimException.addError( |
|
((CIMError*)currErr->hdl)->getInstance()); |
|
} |
|
} |
|
throw cimException; |
|
} |
|
} | } |
HandlerCatch(handler); | HandlerCatch(handler); |
| |
|
|
(const char*) request->modifiedInstance.\ | (const char*) request->modifiedInstance.\ |
getPath().getClassName().getString().getCString())); | getPath().getClassName().getString().getCString())); |
| |
// make target object path |
|
CIMObjectPath objectPath( |
|
System::getHostName(), |
|
request->nameSpace, |
|
request->modifiedInstance.getPath ().getClassName(), |
|
request->modifiedInstance.getPath ().getKeyBindings()); |
|
|
|
Boolean remote=false; | Boolean remote=false; |
OpProviderHolder ph; | OpProviderHolder ph; |
CString remoteInfo; | CString remoteInfo; |
|
|
| |
CMPIStatus rc={CMPI_RC_OK,NULL}; | CMPIStatus rc={CMPI_RC_OK,NULL}; |
CMPI_ContextOnStack eCtx(request->operationContext); | CMPI_ContextOnStack eCtx(request->operationContext); |
CMPI_ObjectPathOnStack eRef(objectPath); |
|
CMPI_ResultOnStack eRes(handler,pr.getBroker()); | CMPI_ResultOnStack eRes(handler,pr.getBroker()); |
CMPI_InstanceOnStack eInst(request->modifiedInstance); |
|
CMPI_ThreadContext thr(pr.getBroker(),&eCtx); | CMPI_ThreadContext thr(pr.getBroker(),&eCtx); |
| |
CMPIPropertyList props(request->propertyList); | CMPIPropertyList props(request->propertyList); |
| |
CString nameSpace = request->nameSpace.getString().getCString(); | CString nameSpace = request->nameSpace.getString().getCString(); |
|
CString className = request->modifiedInstance.getPath().getClassName(). |
|
getString().getCString(); |
| |
_setupCMPIContexts( | _setupCMPIContexts( |
&eCtx, | &eCtx, |
|
|
false, | false, |
true); | true); |
| |
|
// make target object path and modified instance |
|
SCMOClass* scmoClass = |
|
mbGetSCMOClass( |
|
pr.getBroker(), |
|
(const char*)nameSpace, |
|
(const char*)className); |
|
if (0 == scmoClass) |
|
{ |
|
// This indicates a severe error, since we should't have come |
|
// here at all, if the class is invalid |
|
PEG_TRACE((TRC_PROVIDERMANAGER,Tracer::LEVEL1, |
|
"CMPIProviderManager::handleGetInstanceRequest - " |
|
"Failed to obtain CIMClass for Namespace: %s Classname: %s", |
|
(const char*) nameSpace, |
|
(const char*) className)); |
|
|
|
CIMException cimException(CIM_ERR_NOT_FOUND); |
|
throw cimException; |
|
} |
|
|
|
SCMOInstance modInstance(*scmoClass,request->modifiedInstance); |
|
modInstance.setHostName( |
|
(const char*)System::getHostName().getCString()); |
|
CMPI_ObjectPathOnStack eRef(modInstance); |
|
CMPI_InstanceOnStack eInst(modInstance); |
|
|
CMPIProvider::pm_service_op_lock op_lock(&pr); | CMPIProvider::pm_service_op_lock op_lock(&pr); |
| |
PEG_TRACE(( | PEG_TRACE(( |
|
|
CMGetCharsPtr(cldata.value.string, NULL))))); | CMGetCharsPtr(cldata.value.string, NULL))))); |
handler.setContext(response->operationContext); | handler.setContext(response->operationContext); |
} | } |
|
_throwCIMException(rc, eRes.resError); |
if (rc.rc!=CMPI_RC_OK) |
|
{ |
|
CIMException cimException( |
|
(CIMStatusCode)rc.rc, |
|
rc.msg ? CMGetCharsPtr(rc.msg, NULL) : String::EMPTY); |
|
|
|
if (eRes.resError) |
|
{ |
|
for (CMPI_Error* currErr=eRes.resError; |
|
currErr!=NULL; |
|
currErr=currErr->nextError) |
|
{ |
|
cimException.addError( |
|
((CIMError*)currErr->hdl)->getInstance()); |
|
} |
|
} |
|
throw cimException; |
|
} |
|
} | } |
HandlerCatch(handler); | HandlerCatch(handler); |
| |
|
|
(const char*) | (const char*) |
request->instanceName.getClassName().getString().getCString())); | request->instanceName.getClassName().getString().getCString())); |
| |
// make target object path |
|
CIMObjectPath objectPath( |
|
System::getHostName(), |
|
request->nameSpace, |
|
request->instanceName.getClassName(), |
|
request->instanceName.getKeyBindings()); |
|
|
|
Boolean remote=false; | Boolean remote=false; |
OpProviderHolder ph; | OpProviderHolder ph; |
CString remoteInfo; | CString remoteInfo; |
|
|
| |
CMPIStatus rc={CMPI_RC_OK,NULL}; | CMPIStatus rc={CMPI_RC_OK,NULL}; |
CMPI_ContextOnStack eCtx(request->operationContext); | CMPI_ContextOnStack eCtx(request->operationContext); |
CMPI_ObjectPathOnStack eRef(objectPath); |
|
CMPI_ResultOnStack eRes(handler,pr.getBroker()); | CMPI_ResultOnStack eRes(handler,pr.getBroker()); |
CMPI_ThreadContext thr(pr.getBroker(),&eCtx); | CMPI_ThreadContext thr(pr.getBroker(),&eCtx); |
| |
CString nameSpace = request->nameSpace.getString().getCString(); | CString nameSpace = request->nameSpace.getString().getCString(); |
|
CString className = request->instanceName.getClassName(). |
|
getString().getCString(); |
| |
_setupCMPIContexts( | _setupCMPIContexts( |
&eCtx, | &eCtx, |
|
|
false, | false, |
true); | true); |
| |
|
// make target object path |
|
SCMOClass* scmoClass = |
|
mbGetSCMOClass( |
|
pr.getBroker(), |
|
(const char*)nameSpace, |
|
(const char*)className); |
|
if (0 == scmoClass) |
|
{ |
|
// This indicates a severe error, since we should't have come |
|
// here at all, if the class is invalid |
|
PEG_TRACE((TRC_PROVIDERMANAGER,Tracer::LEVEL1, |
|
"CMPIProviderManager::handleGetInstanceRequest - " |
|
"Failed to obtain CIMClass for Namespace: %s Classname: %s", |
|
(const char*) nameSpace, |
|
(const char*) className)); |
|
|
|
CIMException cimException(CIM_ERR_NOT_FOUND); |
|
throw cimException; |
|
} |
|
|
|
SCMOInstance objectPath(*scmoClass, request->instanceName); |
|
objectPath.setHostName((const char*)System::getHostName().getCString()); |
|
CMPI_ObjectPathOnStack eRef(objectPath); |
|
|
CMPIProvider::pm_service_op_lock op_lock(&pr); | CMPIProvider::pm_service_op_lock op_lock(&pr); |
| |
PEG_TRACE(( | PEG_TRACE(( |
|
|
CMGetCharsPtr(cldata.value.string, NULL))))); | CMGetCharsPtr(cldata.value.string, NULL))))); |
handler.setContext(response->operationContext); | handler.setContext(response->operationContext); |
} | } |
|
_throwCIMException(rc, eRes.resError); |
if (rc.rc!=CMPI_RC_OK) |
|
{ |
|
CIMException cimException( |
|
(CIMStatusCode)rc.rc, |
|
rc.msg ? CMGetCharsPtr(rc.msg, NULL) : String::EMPTY); |
|
|
|
if (eRes.resError) |
|
{ |
|
for (CMPI_Error* currErr=eRes.resError; |
|
currErr!=NULL; |
|
currErr=currErr->nextError) |
|
{ |
|
cimException.addError( |
|
((CIMError*)currErr->hdl)->getInstance()); |
|
} |
|
} |
|
throw cimException; |
|
} |
|
} | } |
HandlerCatch(handler); | HandlerCatch(handler); |
| |
|
|
(const char*) request->nameSpace.getString().getCString(), | (const char*) request->nameSpace.getString().getCString(), |
(const char*) request->className.getString().getCString())); | (const char*) request->className.getString().getCString())); |
| |
// make target object path |
|
CIMObjectPath objectPath( |
|
System::getHostName(), |
|
request->nameSpace, |
|
request->className); |
|
|
|
Boolean remote=false; | Boolean remote=false; |
OpProviderHolder ph; | OpProviderHolder ph; |
CString remoteInfo; | CString remoteInfo; |
|
|
| |
CMPIStatus rc={CMPI_RC_OK,NULL}; | CMPIStatus rc={CMPI_RC_OK,NULL}; |
CMPI_ContextOnStack eCtx(request->operationContext); | CMPI_ContextOnStack eCtx(request->operationContext); |
CMPI_ObjectPathOnStack eRef(objectPath); |
|
CMPI_ResultOnStack eRes(handler,pr.getBroker()); | CMPI_ResultOnStack eRes(handler,pr.getBroker()); |
CMPI_ThreadContext thr(pr.getBroker(),&eCtx); | CMPI_ThreadContext thr(pr.getBroker(),&eCtx); |
| |
const CString queryLan=request->queryLanguage.getCString(); | const CString queryLan=request->queryLanguage.getCString(); |
const CString query=request->query.getCString(); | const CString query=request->query.getCString(); |
CString nameSpace = request->nameSpace.getString().getCString(); | CString nameSpace = request->nameSpace.getString().getCString(); |
|
CString className = request->className.getString().getCString(); |
| |
_setupCMPIContexts( | _setupCMPIContexts( |
&eCtx, | &eCtx, |
|
|
false, | false, |
true); | true); |
| |
|
// make target object path |
|
SCMOClass* scmoClass = |
|
mbGetSCMOClass( |
|
pr.getBroker(), |
|
(const char*)nameSpace, |
|
(const char*)className); |
|
if (0 == scmoClass) |
|
{ |
|
// This indicates a severe error, since we should't have come |
|
// here at all, if the class is invalid |
|
PEG_TRACE((TRC_PROVIDERMANAGER,Tracer::LEVEL1, |
|
"CMPIProviderManager::handleGetInstanceRequest - " |
|
"Failed to obtain CIMClass for Namespace: %s Classname: %s", |
|
(const char*) nameSpace, |
|
(const char*) className)); |
|
|
|
CIMException cimException(CIM_ERR_NOT_FOUND); |
|
throw cimException; |
|
} |
|
|
|
SCMOInstance objectPath(*scmoClass); |
|
objectPath.setHostName((const char*)System::getHostName().getCString()); |
|
CMPI_ObjectPathOnStack eRef(objectPath); |
|
|
CMPIProvider::pm_service_op_lock op_lock(&pr); | CMPIProvider::pm_service_op_lock op_lock(&pr); |
| |
PEG_TRACE(( | PEG_TRACE(( |
|
|
CMGetCharsPtr(cldata.value.string, NULL))))); | CMGetCharsPtr(cldata.value.string, NULL))))); |
handler.setContext(response->operationContext); | handler.setContext(response->operationContext); |
} | } |
|
_throwCIMException(rc, eRes.resError); |
if (rc.rc!=CMPI_RC_OK) |
|
{ |
|
CIMException cimException( |
|
(CIMStatusCode)rc.rc, |
|
rc.msg ? CMGetCharsPtr(rc.msg, NULL) : String::EMPTY); |
|
|
|
if (eRes.resError) |
|
{ |
|
for (CMPI_Error* currErr=eRes.resError; |
|
currErr!=NULL; |
|
currErr=currErr->nextError) |
|
{ |
|
cimException.addError( |
|
((CIMError*)currErr->hdl)->getInstance()); |
|
} |
|
} |
|
throw cimException; |
|
} |
|
| |
} | } |
HandlerCatch(handler); | HandlerCatch(handler); |
|
|
(const char*) | (const char*) |
request->objectName.getClassName().getString().getCString())); | request->objectName.getClassName().getString().getCString())); |
| |
// make target object path |
|
CIMObjectPath objectPath( |
|
System::getHostName(), |
|
request->nameSpace, |
|
request->objectName.getClassName()); |
|
|
|
objectPath.setKeyBindings(request->objectName.getKeyBindings()); |
|
|
|
CIMObjectPath assocPath( |
|
System::getHostName(), |
|
request->nameSpace, |
|
request->assocClass.getString()); |
|
|
|
Boolean remote=false; | Boolean remote=false; |
OpProviderHolder ph; | OpProviderHolder ph; |
CString remoteInfo; | CString remoteInfo; |
|
|
| |
CMPIStatus rc={CMPI_RC_OK,NULL}; | CMPIStatus rc={CMPI_RC_OK,NULL}; |
CMPI_ContextOnStack eCtx(request->operationContext); | CMPI_ContextOnStack eCtx(request->operationContext); |
CMPI_ObjectPathOnStack eRef(objectPath); |
|
CMPI_ResultOnStack eRes(handler,pr.getBroker()); | CMPI_ResultOnStack eRes(handler,pr.getBroker()); |
CMPI_ThreadContext thr(pr.getBroker(),&eCtx); | CMPI_ThreadContext thr(pr.getBroker(),&eCtx); |
const CString aClass=request->assocClass.getString().getCString(); | const CString aClass=request->assocClass.getString().getCString(); |
|
|
const CString rRole=request->role.getCString(); | const CString rRole=request->role.getCString(); |
const CString resRole=request->resultRole.getCString(); | const CString resRole=request->resultRole.getCString(); |
CString nameSpace = request->nameSpace.getString().getCString(); | CString nameSpace = request->nameSpace.getString().getCString(); |
|
CString className = |
|
request->objectName.getClassName().getString().getCString(); |
| |
CMPIPropertyList props(request->propertyList); | CMPIPropertyList props(request->propertyList); |
| |
|
|
request->includeClassOrigin, | request->includeClassOrigin, |
true); | true); |
| |
|
// make target object path |
|
SCMOClass* scmoClass = |
|
mbGetSCMOClass( |
|
pr.getBroker(), |
|
(const char*)nameSpace, |
|
(const char*)className); |
|
if (0 == scmoClass) |
|
{ |
|
// This indicates a severe error, since we should't have come |
|
// here at all, if the class is invalid |
|
PEG_TRACE((TRC_PROVIDERMANAGER,Tracer::LEVEL1, |
|
"CMPIProviderManager::handleAssociatorsRequest - " |
|
"Failed to obtain CIMClass for Namespace: %s Classname: %s", |
|
(const char*) nameSpace, |
|
(const char*) className)); |
|
|
|
CIMException cimException(CIM_ERR_NOT_FOUND); |
|
throw cimException; |
|
} |
|
|
|
SCMOInstance objectPath(*scmoClass,request->objectName); |
|
objectPath.setHostName((const char*)System::getHostName().getCString()); |
|
CMPI_ObjectPathOnStack eRef(objectPath); |
|
|
CMPIProvider::pm_service_op_lock op_lock(&pr); | CMPIProvider::pm_service_op_lock op_lock(&pr); |
| |
PEG_TRACE(( | PEG_TRACE(( |
|
|
ContentLanguageList( | ContentLanguageList( |
LanguageParser::parseContentLanguageHeader( | LanguageParser::parseContentLanguageHeader( |
CMGetCharsPtr(cldata.value.string, NULL))))); | CMGetCharsPtr(cldata.value.string, NULL))))); |
handler.setContext(response->operationContext); |
handler.setContext(response->operationContext); |
} |
|
|
|
if (rc.rc!=CMPI_RC_OK) |
|
{ |
|
CIMException cimException( |
|
(CIMStatusCode)rc.rc, |
|
rc.msg ? CMGetCharsPtr(rc.msg, NULL) : String::EMPTY); |
|
|
|
if (eRes.resError) |
|
{ |
|
for (CMPI_Error* currErr=eRes.resError; |
|
currErr!=NULL; |
|
currErr=currErr->nextError) |
|
{ |
|
cimException.addError( |
|
((CIMError*)currErr->hdl)->getInstance()); |
|
} |
|
} |
|
throw cimException; |
|
} | } |
|
_throwCIMException(rc, eRes.resError); |
} | } |
HandlerCatch(handler); | HandlerCatch(handler); |
| |
|
|
(const char*) | (const char*) |
request->objectName.getClassName().getString().getCString())); | request->objectName.getClassName().getString().getCString())); |
| |
// make target object path |
|
CIMObjectPath objectPath( |
|
System::getHostName(), |
|
request->nameSpace, |
|
request->objectName.getClassName()); |
|
|
|
objectPath.setKeyBindings(request->objectName.getKeyBindings()); |
|
|
|
CIMObjectPath assocPath( |
|
System::getHostName(), |
|
request->nameSpace, |
|
request->assocClass.getString()); |
|
|
|
Boolean remote=false; | Boolean remote=false; |
OpProviderHolder ph; | OpProviderHolder ph; |
CString remoteInfo; | CString remoteInfo; |
|
|
| |
CMPIStatus rc={CMPI_RC_OK,NULL}; | CMPIStatus rc={CMPI_RC_OK,NULL}; |
CMPI_ContextOnStack eCtx(request->operationContext); | CMPI_ContextOnStack eCtx(request->operationContext); |
CMPI_ObjectPathOnStack eRef(objectPath); |
|
CMPI_ResultOnStack eRes(handler,pr.getBroker()); | CMPI_ResultOnStack eRes(handler,pr.getBroker()); |
CMPI_ThreadContext thr(pr.getBroker(),&eCtx); | CMPI_ThreadContext thr(pr.getBroker(),&eCtx); |
const CString aClass=request->assocClass.getString().getCString(); | const CString aClass=request->assocClass.getString().getCString(); |
|
|
const CString rRole=request->role.getCString(); | const CString rRole=request->role.getCString(); |
const CString resRole=request->resultRole.getCString(); | const CString resRole=request->resultRole.getCString(); |
CString nameSpace = request->nameSpace.getString().getCString(); | CString nameSpace = request->nameSpace.getString().getCString(); |
|
CString className = |
|
request->objectName.getClassName().getString().getCString(); |
| |
_setupCMPIContexts( | _setupCMPIContexts( |
&eCtx, | &eCtx, |
|
|
false, | false, |
true); | true); |
| |
|
// make target object path |
|
SCMOClass* scmoClass = |
|
mbGetSCMOClass( |
|
pr.getBroker(), |
|
(const char*)nameSpace, |
|
(const char*)className); |
|
if (0 == scmoClass) |
|
{ |
|
// This indicates a severe error, since we should't have come |
|
// here at all, if the class is invalid |
|
PEG_TRACE((TRC_PROVIDERMANAGER,Tracer::LEVEL1, |
|
"CMPIProviderManager::handleAssociatorNamesRequest - " |
|
"Failed to obtain CIMClass for Namespace: %s Classname: %s", |
|
(const char*) nameSpace, |
|
(const char*) className)); |
|
|
|
CIMException cimException(CIM_ERR_NOT_FOUND); |
|
throw cimException; |
|
} |
|
|
|
SCMOInstance objectPath(*scmoClass,request->objectName); |
|
objectPath.setHostName((const char*)System::getHostName().getCString()); |
|
CMPI_ObjectPathOnStack eRef(objectPath); |
|
|
CMPIProvider::pm_service_op_lock op_lock(&pr); | CMPIProvider::pm_service_op_lock op_lock(&pr); |
| |
PEG_TRACE(( | PEG_TRACE(( |
|
|
CMGetCharsPtr(cldata.value.string, NULL))))); | CMGetCharsPtr(cldata.value.string, NULL))))); |
handler.setContext(response->operationContext); | handler.setContext(response->operationContext); |
} | } |
|
_throwCIMException(rc, eRes.resError); |
if (rc.rc!=CMPI_RC_OK) |
|
{ |
|
CIMException cimException( |
|
(CIMStatusCode)rc.rc, |
|
rc.msg ? CMGetCharsPtr(rc.msg, NULL) : String::EMPTY); |
|
|
|
if (eRes.resError) |
|
{ |
|
for (CMPI_Error* currErr=eRes.resError; |
|
currErr!=NULL; |
|
currErr=currErr->nextError) |
|
{ |
|
cimException.addError( |
|
((CIMError*)currErr->hdl)->getInstance()); |
|
} |
|
} |
|
throw cimException; |
|
} |
|
} | } |
HandlerCatch(handler); | HandlerCatch(handler); |
| |
|
|
(const char*) | (const char*) |
request->objectName.getClassName().getString().getCString())); | request->objectName.getClassName().getString().getCString())); |
| |
// make target object path |
|
CIMObjectPath objectPath( |
|
System::getHostName(), |
|
request->nameSpace, |
|
request->objectName.getClassName()); |
|
|
|
objectPath.setKeyBindings(request->objectName.getKeyBindings()); |
|
|
|
CIMObjectPath resultPath( |
|
System::getHostName(), |
|
request->nameSpace, |
|
request->resultClass.getString()); |
|
|
|
Boolean remote=false; | Boolean remote=false; |
OpProviderHolder ph; | OpProviderHolder ph; |
CString remoteInfo; | CString remoteInfo; |
|
|
| |
CMPIStatus rc={CMPI_RC_OK,NULL}; | CMPIStatus rc={CMPI_RC_OK,NULL}; |
CMPI_ContextOnStack eCtx(request->operationContext); | CMPI_ContextOnStack eCtx(request->operationContext); |
CMPI_ObjectPathOnStack eRef(objectPath); |
|
CMPI_ResultOnStack eRes(handler,pr.getBroker()); | CMPI_ResultOnStack eRes(handler,pr.getBroker()); |
CMPI_ThreadContext thr(pr.getBroker(),&eCtx); | CMPI_ThreadContext thr(pr.getBroker(),&eCtx); |
const CString rClass=request->resultClass.getString().getCString(); | const CString rClass=request->resultClass.getString().getCString(); |
const CString rRole=request->role.getCString(); | const CString rRole=request->role.getCString(); |
CString nameSpace = request->nameSpace.getString().getCString(); | CString nameSpace = request->nameSpace.getString().getCString(); |
|
CString className = |
|
request->objectName.getClassName().getString().getCString(); |
| |
CMPIPropertyList props(request->propertyList); | CMPIPropertyList props(request->propertyList); |
| |
|
|
request->includeClassOrigin, | request->includeClassOrigin, |
true); | true); |
| |
|
// make target object path |
|
SCMOClass* scmoClass = |
|
mbGetSCMOClass( |
|
pr.getBroker(), |
|
(const char*)nameSpace, |
|
(const char*)className); |
|
if (0 == scmoClass) |
|
{ |
|
// This indicates a severe error, since we should't have come |
|
// here at all, if the class is invalid |
|
PEG_TRACE((TRC_PROVIDERMANAGER,Tracer::LEVEL1, |
|
"CMPIProviderManager::handleAssociatorsRequest - " |
|
"Failed to obtain CIMClass for Namespace: %s Classname: %s", |
|
(const char*) nameSpace, |
|
(const char*) className)); |
|
|
|
CIMException cimException(CIM_ERR_NOT_FOUND); |
|
throw cimException; |
|
} |
|
|
|
SCMOInstance objectPath(*scmoClass,request->objectName); |
|
objectPath.setHostName((const char*)System::getHostName().getCString()); |
|
CMPI_ObjectPathOnStack eRef(objectPath); |
|
|
CMPIProvider::pm_service_op_lock op_lock(&pr); | CMPIProvider::pm_service_op_lock op_lock(&pr); |
| |
PEG_TRACE(( | PEG_TRACE(( |
|
|
CMGetCharsPtr(cldata.value.string, NULL))))); | CMGetCharsPtr(cldata.value.string, NULL))))); |
handler.setContext(response->operationContext); | handler.setContext(response->operationContext); |
} | } |
|
_throwCIMException(rc, eRes.resError); |
if (rc.rc!=CMPI_RC_OK) |
|
{ |
|
CIMException cimException( |
|
(CIMStatusCode)rc.rc, |
|
rc.msg ? CMGetCharsPtr(rc.msg, NULL) : String::EMPTY); |
|
|
|
if (eRes.resError) |
|
{ |
|
for (CMPI_Error* currErr=eRes.resError; |
|
currErr!=NULL; |
|
currErr=currErr->nextError) |
|
{ |
|
cimException.addError( |
|
((CIMError*)currErr->hdl)->getInstance()); |
|
} |
|
} |
|
throw cimException; |
|
} |
|
} | } |
HandlerCatch(handler); | HandlerCatch(handler); |
| |
|
|
(const char*) | (const char*) |
request->objectName.getClassName().getString().getCString())); | request->objectName.getClassName().getString().getCString())); |
| |
// make target object path |
|
CIMObjectPath objectPath( |
|
System::getHostName(), |
|
request->nameSpace, |
|
request->objectName.getClassName()); |
|
|
|
objectPath.setKeyBindings(request->objectName.getKeyBindings()); |
|
|
|
CIMObjectPath resultPath( |
|
System::getHostName(), |
|
request->nameSpace, |
|
request->resultClass.getString()); |
|
|
|
Boolean remote=false; | Boolean remote=false; |
OpProviderHolder ph; | OpProviderHolder ph; |
CString remoteInfo; | CString remoteInfo; |
|
|
| |
CMPIStatus rc={CMPI_RC_OK,NULL}; | CMPIStatus rc={CMPI_RC_OK,NULL}; |
CMPI_ContextOnStack eCtx(request->operationContext); | CMPI_ContextOnStack eCtx(request->operationContext); |
CMPI_ObjectPathOnStack eRef(objectPath); |
|
CMPI_ResultOnStack eRes(handler,pr.getBroker()); | CMPI_ResultOnStack eRes(handler,pr.getBroker()); |
CMPI_ThreadContext thr(pr.getBroker(),&eCtx); | CMPI_ThreadContext thr(pr.getBroker(),&eCtx); |
const CString rClass=request->resultClass.getString().getCString(); | const CString rClass=request->resultClass.getString().getCString(); |
const CString rRole=request->role.getCString(); | const CString rRole=request->role.getCString(); |
| |
CString nameSpace = request->nameSpace.getString().getCString(); | CString nameSpace = request->nameSpace.getString().getCString(); |
|
CString className = |
|
request->objectName.getClassName().getString().getCString(); |
| |
_setupCMPIContexts( | _setupCMPIContexts( |
&eCtx, | &eCtx, |
|
|
false, | false, |
true); | true); |
| |
|
// make target object path |
|
SCMOClass* scmoClass = |
|
mbGetSCMOClass( |
|
pr.getBroker(), |
|
(const char*)nameSpace, |
|
(const char*)className); |
|
if (0 == scmoClass) |
|
{ |
|
// This indicates a severe error, since we should't have come |
|
// here at all, if the class is invalid |
|
PEG_TRACE((TRC_PROVIDERMANAGER,Tracer::LEVEL1, |
|
"CMPIProviderManager::handleAssociatorNamesRequest - " |
|
"Failed to obtain CIMClass for Namespace: %s Classname: %s", |
|
(const char*) nameSpace, |
|
(const char*) className)); |
|
|
|
CIMException cimException(CIM_ERR_NOT_FOUND); |
|
throw cimException; |
|
} |
|
|
|
SCMOInstance objectPath(*scmoClass,request->objectName); |
|
objectPath.setHostName((const char*)System::getHostName().getCString()); |
|
CMPI_ObjectPathOnStack eRef(objectPath); |
|
|
CMPIProvider::pm_service_op_lock op_lock(&pr); | CMPIProvider::pm_service_op_lock op_lock(&pr); |
| |
PEG_TRACE(( | PEG_TRACE(( |
|
|
CMGetCharsPtr(cldata.value.string, NULL))))); | CMGetCharsPtr(cldata.value.string, NULL))))); |
handler.setContext(response->operationContext); | handler.setContext(response->operationContext); |
} | } |
|
_throwCIMException(rc, eRes.resError); |
if (rc.rc!=CMPI_RC_OK) |
|
{ |
|
CIMException cimException( |
|
(CIMStatusCode)rc.rc, |
|
rc.msg ? CMGetCharsPtr(rc.msg, NULL) : String::EMPTY); |
|
|
|
if (eRes.resError) |
|
{ |
|
for (CMPI_Error* currErr=eRes.resError; |
|
currErr!=NULL; |
|
currErr=currErr->nextError) |
|
{ |
|
cimException.addError( |
|
((CIMError*)currErr->hdl)->getInstance()); |
|
} |
|
} |
|
throw cimException; |
|
} |
|
} | } |
HandlerCatch(handler); | HandlerCatch(handler); |
| |
|
|
(const char*) | (const char*) |
request->instanceName.getClassName().getString().getCString())); | request->instanceName.getClassName().getString().getCString())); |
| |
// make target object path |
|
CIMObjectPath objectPath( |
|
System::getHostName(), |
|
request->nameSpace, |
|
request->instanceName.getClassName(), |
|
request->instanceName.getKeyBindings()); |
|
|
|
Boolean remote=false; | Boolean remote=false; |
OpProviderHolder ph; | OpProviderHolder ph; |
CString remoteInfo; | CString remoteInfo; |
|
|
&remoteInfo, | &remoteInfo, |
remote); | remote); |
| |
CIMObjectPath instanceReference(request->instanceName); |
|
|
|
// ATTN: propagate namespace |
|
instanceReference.setNameSpace(request->nameSpace); |
|
|
|
CMPIStatus rc={CMPI_RC_OK,NULL}; | CMPIStatus rc={CMPI_RC_OK,NULL}; |
CMPI_ContextOnStack eCtx(request->operationContext); | CMPI_ContextOnStack eCtx(request->operationContext); |
CMPI_ObjectPathOnStack eRef(objectPath); |
|
CMPI_ResultOnStack eRes(handler,pr.getBroker()); | CMPI_ResultOnStack eRes(handler,pr.getBroker()); |
CMPI_ThreadContext thr(pr.getBroker(),&eCtx); | CMPI_ThreadContext thr(pr.getBroker(),&eCtx); |
CMPI_ArgsOnStack eArgsIn(request->inParameters); | CMPI_ArgsOnStack eArgsIn(request->inParameters); |
|
|
CMPI_ArgsOnStack eArgsOut(outArgs); | CMPI_ArgsOnStack eArgsOut(outArgs); |
CString mName=request->methodName.getString().getCString(); | CString mName=request->methodName.getString().getCString(); |
CString nameSpace = request->nameSpace.getString().getCString(); | CString nameSpace = request->nameSpace.getString().getCString(); |
|
CString className = request->className.getString().getCString(); |
| |
_setupCMPIContexts( | _setupCMPIContexts( |
&eCtx, | &eCtx, |
|
|
false, | false, |
true); | true); |
| |
|
// make target object path |
|
SCMOClass* scmoClass = |
|
mbGetSCMOClass( |
|
pr.getBroker(), |
|
(const char*)nameSpace, |
|
(const char*)className); |
|
if (0 == scmoClass) |
|
{ |
|
// This indicates a severe error, since we should't have come |
|
// here at all, if the class is invalid |
|
PEG_TRACE((TRC_PROVIDERMANAGER,Tracer::LEVEL1, |
|
"CMPIProviderManager::handleGetInstanceRequest - " |
|
"Failed to obtain CIMClass for Namespace: %s Classname: %s", |
|
(const char*) nameSpace, |
|
(const char*) className)); |
|
|
|
CIMException cimException(CIM_ERR_NOT_FOUND); |
|
throw cimException; |
|
} |
|
|
|
SCMOInstance objectPath(*scmoClass,request->instanceName); |
|
objectPath.setHostName((const char*)System::getHostName().getCString()); |
|
CMPI_ObjectPathOnStack eRef(objectPath); |
|
|
CMPIProvider::pm_service_op_lock op_lock(&pr); | CMPIProvider::pm_service_op_lock op_lock(&pr); |
| |
PEG_TRACE(( | PEG_TRACE(( |
|
|
CMGetCharsPtr(cldata.value.string, NULL))))); | CMGetCharsPtr(cldata.value.string, NULL))))); |
handler.setContext(response->operationContext); | handler.setContext(response->operationContext); |
} | } |
|
_throwCIMException(rc, eRes.resError); |
if (rc.rc!=CMPI_RC_OK) |
|
{ |
|
CIMException cimException( |
|
(CIMStatusCode)rc.rc, |
|
rc.msg ? CMGetCharsPtr(rc.msg, NULL) : String::EMPTY); |
|
|
|
if (eRes.resError) |
|
{ |
|
for (CMPI_Error* currErr=eRes.resError; |
|
currErr!=NULL; |
|
currErr=currErr->nextError) |
|
{ |
|
cimException.addError( |
|
((CIMError*)currErr->hdl)->getInstance()); |
|
} |
|
} |
|
throw cimException; |
|
} |
|
| |
// Even if external normalization is enabled we don't normalize the | // Even if external normalization is enabled we don't normalize the |
// Embedded instances present in output args. Normalize them here. | // Embedded instances present in output args. Normalize them here. |
|
|
return className; | return className; |
} | } |
| |
|
void CMPIProviderManager::_throwCIMException( |
|
CMPIStatus rc, |
|
CMPI_Error* cmpiError) |
|
{ |
|
if (rc.rc!=CMPI_RC_OK) |
|
{ |
|
CIMException cimException( |
|
(CIMStatusCode)rc.rc, |
|
rc.msg ? CMGetCharsPtr(rc.msg, NULL) : String::EMPTY); |
|
if (cmpiError) |
|
{ |
|
for (CMPI_Error* currErr=cmpiError; |
|
currErr!=NULL; |
|
currErr=currErr->nextError) |
|
{ |
|
cimException.addError( |
|
((CIMError*)currErr->hdl)->getInstance()); |
|
} |
|
} |
|
throw cimException; |
|
} |
|
|
|
} |
|
|
Message * CMPIProviderManager::handleCreateSubscriptionRequest( | Message * CMPIProviderManager::handleCreateSubscriptionRequest( |
const Message * message) | const Message * message) |
{ | { |
|
|
request->operationContext.get( | request->operationContext.get( |
SubscriptionFilterConditionContainer::NAME); | SubscriptionFilterConditionContainer::NAME); |
| |
CIMOMHandleQueryContext *_context= |
CIMOMHandleQueryContext _context( |
new CIMOMHandleQueryContext( |
|
CIMNamespaceName( | CIMNamespaceName( |
request->nameSpace.getString()), | request->nameSpace.getString()), |
*pr.getCIMOMHandle()); | *pr.getCIMOMHandle()); |
| |
CMPI_SelectExp *eSelx=new CMPI_SelectExp( | CMPI_SelectExp *eSelx=new CMPI_SelectExp( |
request->operationContext, | request->operationContext, |
_context, |
&_context, |
request->query, | request->query, |
sub_cntr.getQueryLanguage()); | sub_cntr.getQueryLanguage()); |
| |
srec->eSelx=eSelx; | srec->eSelx=eSelx; |
srec->qContext=_context; |
|
| |
CMPI_ThreadContext thr(pr.getBroker(),&eCtx); | CMPI_ThreadContext thr(pr.getBroker(),&eCtx); |
| |
String lang(sub_cntr.getQueryLanguage()); | String lang(sub_cntr.getQueryLanguage()); |
CString className = _getClassNameFromQuery( | CString className = _getClassNameFromQuery( |
_context, |
&_context, |
request->query, | request->query, |
lang).getCString(); | lang).getCString(); |
|
CString nameSpace = request->nameSpace.getString().getCString(); |
| |
CIMObjectPath indClassPath( | CIMObjectPath indClassPath( |
System::getHostName(), | System::getHostName(), |
|
|
| |
eSelx->classNames.append(indClassPath); | eSelx->classNames.append(indClassPath); |
| |
|
SCMOClass* scmoIndClass = |
|
mbGetSCMOClass( |
|
pr.getBroker(), |
|
(const char*)nameSpace, |
|
(const char*)className); |
|
if (0 == scmoIndClass) |
|
{ |
|
// This indicates a severe error, since we should't have |
|
// come here at all, if the class is invalid |
|
PEG_TRACE((TRC_PROVIDERMANAGER,Tracer::LEVEL1, |
|
"CMPIProviderManager::handleCreateSubscriptionRequest-" |
|
"Failed to obtain CIMClass for Namespace: %s " |
|
" Classname: %s", |
|
(const char*) nameSpace, |
|
(const char*) className)); |
|
|
|
CIMException cimException(CIM_ERR_NOT_FOUND); |
|
throw cimException; |
|
} |
|
|
|
SCMOInstance indClassPathSCMO(*scmoIndClass); |
|
indClassPathSCMO.setHostName( |
|
(const char*)System::getHostName().getCString()); |
|
eSelx->classNamesSCMO.append(indClassPathSCMO); |
|
|
CIMPropertyList propertyList = request->propertyList; | CIMPropertyList propertyList = request->propertyList; |
if (!propertyList.isNull()) | if (!propertyList.isNull()) |
{ | { |
|
|
} | } |
| |
Uint16 repeatNotificationPolicy = request->repeatNotificationPolicy; | Uint16 repeatNotificationPolicy = request->repeatNotificationPolicy; |
CString nameSpace = request->nameSpace.getString().getCString(); |
|
| |
// includeQualifiers and includeClassOrigin not of interest for | // includeQualifiers and includeClassOrigin not of interest for |
// this type of request | // this type of request |
|
|
// filter can be activated for any of the subclasses. | // filter can be activated for any of the subclasses. |
for (Uint32 i = 0, n = request->classNames.size(); i < n; i++) | for (Uint32 i = 0, n = request->classNames.size(); i < n; i++) |
{ | { |
|
CString subClassName = |
|
request->classNames[i].getString().getCString(); |
|
|
|
// make target object paths |
CIMObjectPath classPath( | CIMObjectPath classPath( |
System::getHostName(), | System::getHostName(), |
request->nameSpace, | request->nameSpace, |
request->classNames[i]); | request->classNames[i]); |
| |
CMPI_ObjectPathOnStack eRef(classPath); |
SCMOClass* scmoClass = |
|
mbGetSCMOClass( |
|
pr.getBroker(), |
|
(const char*)nameSpace, |
|
(const char*)subClassName); |
|
if (0 == scmoClass) |
|
{ |
|
// This indicates a severe error, since we should't have |
|
// come here at all, if the class is invalid |
|
PEG_TRACE((TRC_PROVIDERMANAGER,Tracer::LEVEL1, |
|
"CMPIProviderManager::handleCreateSubscriptionRequest-" |
|
"Failed to obtain CIMClass for Namespace: %s " |
|
" Classname: %s", |
|
(const char*) nameSpace, |
|
(const char*) className)); |
|
|
|
CIMException cimException(CIM_ERR_NOT_FOUND); |
|
throw cimException; |
|
} |
|
|
|
SCMOInstance classPathSCMO(*scmoClass); |
|
classPathSCMO.setHostName( |
|
(const char*)System::getHostName().getCString()); |
|
CMPI_ObjectPathOnStack eRef(classPathSCMO); |
| |
if (pr.getIndMI()->ft->ftVersion >= 100) | if (pr.getIndMI()->ft->ftVersion >= 100) |
{ | { |
|
|
{ | { |
filterActivated = true; | filterActivated = true; |
eSelx->classNames.append(classPath); | eSelx->classNames.append(classPath); |
|
eSelx->classNamesSCMO.append(classPathSCMO); |
|
|
} | } |
else | else |
{ | { |
|
|
if (--srec->count<=0) | if (--srec->count<=0) |
{ | { |
selxTab.remove(sPath); | selxTab.remove(sPath); |
delete _context; |
|
delete eSelx; | delete eSelx; |
delete srec; | delete srec; |
} | } |
|
|
}; | }; |
| |
CMPI_SelectExp *eSelx=srec->eSelx; | CMPI_SelectExp *eSelx=srec->eSelx; |
CIMOMHandleQueryContext *qContext=srec->qContext; |
|
| |
CString className = eSelx->classNames[0].getClassName(). | CString className = eSelx->classNames[0].getClassName(). |
getString().getCString(); | getString().getCString(); |
|
|
// the FROM clause of filter query. | // the FROM clause of filter query. |
for (Uint32 i = 1, n = eSelx->classNames.size(); i < n ; ++i) | for (Uint32 i = 1, n = eSelx->classNames.size(); i < n ; ++i) |
{ | { |
CMPI_ObjectPathOnStack eRef(eSelx->classNames[i]); |
CMPI_ObjectPathOnStack eRef(eSelx->classNamesSCMO[i]); |
if (pr.getIndMI()->ft->ftVersion >= 100) | if (pr.getIndMI()->ft->ftVersion >= 100) |
{ | { |
rc = pr.getIndMI()->ft->deActivateFilter( | rc = pr.getIndMI()->ft->deActivateFilter( |
|
|
| |
if (srec->count<=0) | if (srec->count<=0) |
{ | { |
delete qContext; |
|
delete eSelx; | delete eSelx; |
delete srec; | delete srec; |
} | } |
|
|
request->instanceName.getClassName().getString().getCString(), | request->instanceName.getClassName().getString().getCString(), |
(const char*) request->propertyName.getString().getCString())); | (const char*) request->propertyName.getString().getCString())); |
| |
// make target object path |
|
CIMObjectPath objectPath( |
|
System::getHostName(), |
|
request->nameSpace, |
|
request->instanceName.getClassName(), |
|
request->instanceName.getKeyBindings()); |
|
|
|
Boolean remote=false; | Boolean remote=false; |
OpProviderHolder ph; | OpProviderHolder ph; |
CString remoteInfo; | CString remoteInfo; |
|
|
| |
CMPIStatus rc={CMPI_RC_OK,NULL}; | CMPIStatus rc={CMPI_RC_OK,NULL}; |
CMPI_ContextOnStack eCtx(request->operationContext); | CMPI_ContextOnStack eCtx(request->operationContext); |
CMPI_ObjectPathOnStack eRef(objectPath); |
|
CMPI_ResultOnStack eRes(GI_handler,pr.getBroker()); | CMPI_ResultOnStack eRes(GI_handler,pr.getBroker()); |
CMPI_ThreadContext thr(pr.getBroker(),&eCtx); | CMPI_ThreadContext thr(pr.getBroker(),&eCtx); |
| |
|
|
CMPIPropertyList props(localPropertyList); | CMPIPropertyList props(localPropertyList); |
| |
CString nameSpace = request->nameSpace.getString().getCString(); | CString nameSpace = request->nameSpace.getString().getCString(); |
|
CString className = |
|
request->instanceName.getClassName().getString().getCString(); |
|
|
// Leave includeQualifiers and includeClassOrigin as false for this | // Leave includeQualifiers and includeClassOrigin as false for this |
// call to getInstance | // call to getInstance |
_setupCMPIContexts( | _setupCMPIContexts( |
|
|
false, | false, |
true); | true); |
| |
|
// make target object path |
|
SCMOClass* scmoClass = |
|
mbGetSCMOClass( |
|
pr.getBroker(), |
|
(const char*)nameSpace, |
|
(const char*)className); |
|
if (0 == scmoClass) |
|
{ |
|
// This indicates a severe error, since we should't have come |
|
// here at all, if the class is invalid |
|
PEG_TRACE((TRC_PROVIDERMANAGER,Tracer::LEVEL1, |
|
"CMPIProviderManager::handleGetInstanceRequest - " |
|
"Failed to obtain CIMClass for Namespace: %s Classname: %s", |
|
(const char*) nameSpace, |
|
(const char*) className)); |
|
|
|
CIMException cimException(CIM_ERR_NOT_FOUND); |
|
throw cimException; |
|
} |
|
|
|
SCMOInstance objectPath(*scmoClass,request->instanceName); |
|
objectPath.setHostName((const char*)System::getHostName().getCString()); |
|
CMPI_ObjectPathOnStack eRef(objectPath); |
|
|
CMPIProvider::pm_service_op_lock op_lock(&pr); | CMPIProvider::pm_service_op_lock op_lock(&pr); |
| |
PEG_TRACE(( | PEG_TRACE(( |
|
|
CMGetCharsPtr(cldata.value.string, NULL))))); | CMGetCharsPtr(cldata.value.string, NULL))))); |
handler.setContext(response->operationContext); | handler.setContext(response->operationContext); |
} | } |
|
_throwCIMException(rc, eRes.resError); |
if (rc.rc!=CMPI_RC_OK) |
|
{ |
|
CIMException cimException( |
|
(CIMStatusCode)rc.rc, |
|
rc.msg ? CMGetCharsPtr(rc.msg, NULL) : String::EMPTY); |
|
|
|
if (eRes.resError) |
|
{ |
|
for (CMPI_Error* currErr=eRes.resError; |
|
currErr!=NULL; |
|
currErr=currErr->nextError) |
|
{ |
|
cimException.addError( |
|
((CIMError*)currErr->hdl)->getInstance()); |
|
} |
|
} |
|
throw cimException; |
|
} |
|
| |
// Copy property value from instance to getProperty response | // Copy property value from instance to getProperty response |
CIMInstance& instance = GI_response->getResponseData().getCimInstance(); |
Array<SCMOInstance>& arInstance = |
|
GI_response->getResponseData().getSCMO(); |
|
if (arInstance.size() > 0) |
|
{ |
|
SCMOInstance& instance = arInstance[0]; |
if(!(instance.isUninitialized())) | if(!(instance.isUninitialized())) |
{ | { |
Uint32 pos = instance.findProperty(request->propertyName); |
CString pName = |
|
request->propertyName.getString().getCString(); |
|
|
|
// Construct a temporary CMPI Instance object, on which we |
|
// can use the encpsulation functions to retrieve the property. |
|
CMPI_InstanceOnStack tmpInst(instance); |
|
|
|
CMPIStatus trc; |
|
CMPIData data = |
|
CMGetProperty(&tmpInst, (const char*)pName, &trc); |
| |
if (pos != PEG_NOT_FOUND) |
if (trc.rc == CMPI_RC_OK) |
{ | { |
response->value = instance.getProperty(pos).getValue(); |
// Convert the CMPIData to a CIMValue |
|
CIMValue val = |
|
value2CIMValue(&(data.value), data.type, &(trc.rc)); |
|
|
|
response->value = val; |
} | } |
// Else property not found. Return CIM_ERR_NO_SUCH_PROPERTY. | // Else property not found. Return CIM_ERR_NO_SUCH_PROPERTY. |
else | else |
{ | { |
throw PEGASUS_CIM_EXCEPTION( | throw PEGASUS_CIM_EXCEPTION( |
CIM_ERR_NO_SUCH_PROPERTY, | CIM_ERR_NO_SUCH_PROPERTY, |
request->propertyName.getString() |
request->propertyName.getString()); |
); |
} |
} | } |
} | } |
} | } |
|
|
| |
try | try |
{ | { |
|
CString nameSpace = request->nameSpace.getString().getCString(); |
|
CString className = |
|
request->instanceName.getClassName().getString().getCString(); |
|
|
PEG_TRACE((TRC_PROVIDERMANAGER,Tracer::LEVEL3, | PEG_TRACE((TRC_PROVIDERMANAGER,Tracer::LEVEL3, |
"CMPIProviderManager::handleSetPropertyRequest" | "CMPIProviderManager::handleSetPropertyRequest" |
" - Host name: %s Name space: %s " | " - Host name: %s Name space: %s " |
"Class name: %s Property name: %s", | "Class name: %s Property name: %s", |
(const char*) System::getHostName().getCString(), | (const char*) System::getHostName().getCString(), |
(const char*) request->nameSpace.getString().getCString(), |
(const char*) nameSpace, |
(const char*) |
(const char*) className, |
request->instanceName.getClassName().getString().getCString(), |
|
(const char*) request->propertyName.getString().getCString())); | (const char*) request->propertyName.getString().getCString())); |
| |
// make target object path |
|
CIMObjectPath objectPath( |
|
System::getHostName(), |
|
request->nameSpace, |
|
request->instanceName.getClassName(), |
|
request->instanceName.getKeyBindings()); |
|
|
|
Boolean remote=false; | Boolean remote=false; |
OpProviderHolder ph; | OpProviderHolder ph; |
CString remoteInfo; | CString remoteInfo; |
|
|
| |
CMPIStatus rc={CMPI_RC_OK,NULL}; | CMPIStatus rc={CMPI_RC_OK,NULL}; |
CMPI_ContextOnStack eCtx(request->operationContext); | CMPI_ContextOnStack eCtx(request->operationContext); |
CMPI_ObjectPathOnStack eRef(objectPath); |
|
CMPI_ResultOnStack eRes(MI_handler,pr.getBroker()); | CMPI_ResultOnStack eRes(MI_handler,pr.getBroker()); |
CMPI_InstanceOnStack eInst(localModifiedInstance); |
|
CMPI_ThreadContext thr(pr.getBroker(),&eCtx); | CMPI_ThreadContext thr(pr.getBroker(),&eCtx); |
| |
CMPIPropertyList props(localPropertyList); | CMPIPropertyList props(localPropertyList); |
CString nameSpace = request->nameSpace.getString().getCString(); |
|
| |
// Leave includeQualifiers as false for this call to modifyInstance | // Leave includeQualifiers as false for this call to modifyInstance |
_setupCMPIContexts( | _setupCMPIContexts( |
|
|
false, | false, |
true); | true); |
| |
|
// make target object path |
|
SCMOClass* scmoClass = |
|
mbGetSCMOClass( |
|
pr.getBroker(), |
|
(const char*)nameSpace, |
|
(const char*)className); |
|
if (0 == scmoClass) |
|
{ |
|
// This indicates a severe error, since we should't have come |
|
// here at all, if the class is invalid |
|
PEG_TRACE((TRC_PROVIDERMANAGER,Tracer::LEVEL1, |
|
"CMPIProviderManager::handleGetInstanceRequest - " |
|
"Failed to obtain CIMClass for Namespace: %s Classname: %s", |
|
(const char*) nameSpace, |
|
(const char*) className)); |
|
|
|
CIMException cimException(CIM_ERR_NOT_FOUND); |
|
throw cimException; |
|
} |
|
|
|
SCMOInstance modInst(*scmoClass, localModifiedInstance); |
|
modInst.setHostName((const char*)System::getHostName().getCString()); |
|
modInst.setPropertyFilter((const char **)props.getList()); |
|
CMPI_ObjectPathOnStack eRef(modInst); |
|
CMPI_InstanceOnStack eInst(modInst); |
|
|
CMPIProvider::pm_service_op_lock op_lock(&pr); | CMPIProvider::pm_service_op_lock op_lock(&pr); |
| |
PEG_TRACE(( | PEG_TRACE(( |
|
|
CMGetCharsPtr(cldata.value.string, NULL))))); | CMGetCharsPtr(cldata.value.string, NULL))))); |
handler.setContext(response->operationContext); | handler.setContext(response->operationContext); |
} | } |
|
_throwCIMException(rc, eRes.resError); |
if (rc.rc!=CMPI_RC_OK) |
|
{ |
|
CIMException cimException( |
|
(CIMStatusCode)rc.rc, |
|
rc.msg ? CMGetCharsPtr(rc.msg, NULL) : String::EMPTY); |
|
|
|
if (eRes.resError) |
|
{ |
|
for (CMPI_Error* currErr=eRes.resError; |
|
currErr!=NULL; |
|
currErr=currErr->nextError) |
|
{ |
|
cimException.addError( |
|
((CIMError*)currErr->hdl)->getInstance()); |
|
} |
|
} |
|
throw cimException; |
|
} |
|
} | } |
HandlerCatch(handler); | HandlerCatch(handler); |
| |