📄 operationresponsehandler.cpp
字号:
String ExecQueryResponseHandler::getClass() const{ return String("ExecQueryResponseHandler");}void ExecQueryResponseHandler::transfer(){ CIMExecQueryResponseMessage& msg = *static_cast<CIMExecQueryResponseMessage*>(getResponse()); msg.cimObjects = getObjects();}Boolean ExecQueryResponseHandler::isAsync() const{ return false;}//// AssociatorsResponseHandler//AssociatorsResponseHandler::AssociatorsResponseHandler( CIMAssociatorsRequestMessage* request, CIMAssociatorsResponseMessage* response, PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback) : OperationResponseHandler(request, response, responseChunkCallback){}void AssociatorsResponseHandler::deliver(const CIMObject& cimObject){ if (cimObject.isUninitialized()) { MessageLoaderParms message( "Common.Exception.UNINITIALIZED_OBJECT_EXCEPTION", "The object is not initialized."); throw CIMException(CIM_ERR_FAILED, message); } SimpleObjectResponseHandler::deliver(cimObject);}String AssociatorsResponseHandler::getClass() const{ return String("AssociatorsResponseHandler");}void AssociatorsResponseHandler::transfer(){ CIMAssociatorsResponseMessage& msg = *static_cast<CIMAssociatorsResponseMessage*>(getResponse()); msg.cimObjects = getObjects();}//// AssociatorNamesResponseHandler//AssociatorNamesResponseHandler::AssociatorNamesResponseHandler( CIMAssociatorNamesRequestMessage* request, CIMAssociatorNamesResponseMessage* response, PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback) : OperationResponseHandler(request, response, responseChunkCallback){}void AssociatorNamesResponseHandler::deliver(const CIMObjectPath& cimObjectPath){ if (cimObjectPath.getClassName().isNull()) { MessageLoaderParms message( "Common.Exception.UNINITIALIZED_OBJECT_EXCEPTION", "The object is not initialized."); throw CIMException(CIM_ERR_FAILED, message); } SimpleObjectPathResponseHandler::deliver(cimObjectPath);}String AssociatorNamesResponseHandler::getClass() const{ return String("AssociatorNamesResponseHandler");}void AssociatorNamesResponseHandler::transfer(){ CIMAssociatorNamesResponseMessage& msg = *static_cast<CIMAssociatorNamesResponseMessage*>(getResponse()); msg.objectNames = getObjects();}//// ReferencesResponseHandler//ReferencesResponseHandler::ReferencesResponseHandler( CIMReferencesRequestMessage* request, CIMReferencesResponseMessage* response, PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback) : OperationResponseHandler(request, response, responseChunkCallback){}void ReferencesResponseHandler::deliver(const CIMObject& cimObject){ if (cimObject.isUninitialized()) { MessageLoaderParms message( "Common.Exception.UNINITIALIZED_OBJECT_EXCEPTION", "The object is not initialized."); throw CIMException(CIM_ERR_FAILED, message); } SimpleObjectResponseHandler::deliver(cimObject);}String ReferencesResponseHandler::getClass() const{ return String("ReferencesResponseHandler");}void ReferencesResponseHandler::transfer(){ CIMReferencesResponseMessage& msg = *static_cast<CIMReferencesResponseMessage*>(getResponse()); msg.cimObjects = getObjects();}//// ReferenceNamesResponseHandler//ReferenceNamesResponseHandler::ReferenceNamesResponseHandler( CIMReferenceNamesRequestMessage* request, CIMReferenceNamesResponseMessage* response, PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback) : OperationResponseHandler(request, response, responseChunkCallback){}void ReferenceNamesResponseHandler::deliver(const CIMObjectPath& cimObjectPath){ if (cimObjectPath.getClassName().isNull()) { MessageLoaderParms message( "Common.Exception.UNINITIALIZED_OBJECT_EXCEPTION", "The object is not initialized."); throw CIMException(CIM_ERR_FAILED, message); } SimpleObjectPathResponseHandler::deliver(cimObjectPath);}String ReferenceNamesResponseHandler::getClass() const{ return String("ReferenceNamesResponseHandler");}void ReferenceNamesResponseHandler::transfer(){ CIMReferenceNamesResponseMessage& msg = *static_cast<CIMReferenceNamesResponseMessage*>(getResponse()); msg.objectNames = getObjects();}//// InvokeMethodResponseHandler//InvokeMethodResponseHandler::InvokeMethodResponseHandler( CIMInvokeMethodRequestMessage* request, CIMInvokeMethodResponseMessage* response, PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback) : OperationResponseHandler(request, response, responseChunkCallback){}void InvokeMethodResponseHandler::deliverParamValue( const CIMParamValue& cimParamValue){ if (cimParamValue.isUninitialized()) { MessageLoaderParms message( "Common.Exception.UNINITIALIZED_OBJECT_EXCEPTION", "The object is not initialized."); throw CIMException(CIM_ERR_FAILED, message); } SimpleMethodResultResponseHandler::deliverParamValue(cimParamValue);}void InvokeMethodResponseHandler::deliver(const CIMValue& cimValue){ if (cimValue.isNull()) { MessageLoaderParms message( "Common.Exception.UNINITIALIZED_OBJECT_EXCEPTION", "The object is not initialized."); throw CIMException(CIM_ERR_FAILED, message); } SimpleMethodResultResponseHandler::deliver(cimValue);}String InvokeMethodResponseHandler::getClass() const{ return String("InvokeMethodResponseHandler");}void InvokeMethodResponseHandler::transfer(){ CIMInvokeMethodResponseMessage& msg = *static_cast<CIMInvokeMethodResponseMessage*>(getResponse()); msg.outParameters = getParamValues(); // ATTN-RK-20020903: Is it legal for the return value to be null? // if not, then the check must be done here since deliver() works off the // virtual size, which refers to out parameters! msg.retValue = getReturnValue();}//// EnableIndicationsResponseHandler//EnableIndicationsResponseHandler::EnableIndicationsResponseHandler( CIMRequestMessage* request, CIMResponseMessage* response, const CIMInstance& provider, PEGASUS_INDICATION_CALLBACK_T indicationCallback, PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback) : OperationResponseHandler(request, response, responseChunkCallback), _indicationCallback(indicationCallback){ _provider = provider;}void EnableIndicationsResponseHandler::deliver( const CIMIndication& cimIndication){ OperationContext context; Array<CIMObjectPath> subscriptionInstanceNames; context.insert( SubscriptionInstanceNamesContainer(subscriptionInstanceNames)); deliver(context, cimIndication);}void EnableIndicationsResponseHandler::deliver( const OperationContext& context, const CIMIndication& cimIndication){ if (cimIndication.isUninitialized()) { MessageLoaderParms message( "Common.Exception.UNINITIALIZED_OBJECT_EXCEPTION", "The object is not initialized."); throw CIMException(CIM_ERR_FAILED, message); } // ATTN: temporarily convert indication to instance CIMInstance cimInstance(cimIndication); // Get list of subscription instance names from context Array<CIMObjectPath> subscriptionInstanceNames; if (context.contains(SubscriptionInstanceNamesContainer::NAME)) { SubscriptionInstanceNamesContainer container = context.get(SubscriptionInstanceNamesContainer::NAME); subscriptionInstanceNames = container.getInstanceNames(); } else { subscriptionInstanceNames.clear(); } ContentLanguageList contentLangs; if (context.contains(ContentLanguageListContainer::NAME)) { // Get the Content-Language for this indication. The provider // does not have to add specify a language for the indication. ContentLanguageListContainer langContainer = context.get(ContentLanguageListContainer::NAME); contentLangs = langContainer.getLanguages(); } else { // The provider did not explicitly set a Content-Language for // the indication. Fall back to the lang set in this object. contentLangs = getLanguages(); } // create message CIMProcessIndicationRequestMessage* request = new CIMProcessIndicationRequestMessage( XmlWriter::getNextMessageId(), cimInstance.getPath().getNameSpace(), cimInstance, subscriptionInstanceNames, _provider, QueueIdStack()); // Must be filled in by the callback function request->operationContext = context; if (request->operationContext.contains(ContentLanguageListContainer::NAME)) { request->operationContext.set( ContentLanguageListContainer(contentLangs)); } else { request->operationContext.insert( ContentLanguageListContainer(contentLangs)); } _indicationCallback(request);}void EnableIndicationsResponseHandler::deliver( const Array<CIMIndication>& cimIndications){ OperationContext context; deliver(context, cimIndications);}void EnableIndicationsResponseHandler::deliver( const OperationContext& context, const Array<CIMIndication>& cimIndications){ for (Uint32 i = 0, n = cimIndications.size(); i < n; i++) { deliver(context, cimIndications[i]); }}String EnableIndicationsResponseHandler::getClass() const{ return String("EnableIndicationsResponseHandler");}Boolean EnableIndicationsResponseHandler::isAsync() const{ return false;}PEGASUS_NAMESPACE_END
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -