本文整理汇总了C++中OperationContext::insert方法的典型用法代码示例。如果您正苦于以下问题:C++ OperationContext::insert方法的具体用法?C++ OperationContext::insert怎么用?C++ OperationContext::insert使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OperationContext
的用法示例。
在下文中一共展示了OperationContext::insert方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getResponseContext
OperationContext ClientCIMOMHandleRep::getResponseContext()
{
OperationContext ctx;
Thread* curThrd = Thread::getCurrent();
if (curThrd == NULL)
{
ctx.insert(ContentLanguageListContainer(ContentLanguageList()));
}
else
{
ContentLanguageList* contentLangs = (ContentLanguageList*)
curThrd->reference_tsd(TSD_CIMOM_HANDLE_CONTENT_LANGUAGES);
curThrd->dereference_tsd();
if (contentLangs == NULL)
{
ctx.insert(ContentLanguageListContainer(ContentLanguageList()));
}
else
{
ctx.insert(ContentLanguageListContainer(*contentLangs));
// delete the old tsd to free the memory
curThrd->delete_tsd(TSD_CIMOM_HANDLE_CONTENT_LANGUAGES);
}
}
return ctx;
}
示例2: deliver
void EnableIndicationsResponseHandler::deliver(const CIMIndication & cimIndication)
{
OperationContext context;
Array<CIMObjectPath> subscriptionInstanceNames;
context.insert(SubscriptionInstanceNamesContainer(subscriptionInstanceNames));
deliver(context, cimIndication);
}
示例3: return
ThreadReturnType PEGASUS_THREAD_CDECL
CIMListenerIndicationDispatcherRep::deliver_routine(void *param)
{
CIMListenerIndicationDispatchEvent* event =
static_cast<CIMListenerIndicationDispatchEvent*>(param);
if(event!=NULL)
{
CIMIndicationConsumer* consumer = event->getConsumer();
OperationContext context;
context.insert(ContentLanguageListContainer(
event->getContentLanguages()));
if(consumer)
{
consumer->consumeIndication(context,
event->getURL(),event->getIndicationInstance());
}
delete event;
}
return (0);
}
示例4: _generateIndication
//.........这里部分代码省略.........
(methodName.equal ("SendTestIndicationMatchingInstance")) ||
(methodName.equal ("SendTestIndicationUnmatchingNamespace")) ||
(methodName.equal ("SendTestIndicationUnmatchingClassName")))
{
indicationInstance.addProperty
(CIMProperty ("MethodName", CIMValue (methodName.getString())));
}
else
{
indicationInstance.addProperty
(CIMProperty ("MethodName",
CIMValue (String ("generateIndication"))));
}
//
// For SendTestIndicationExtraProperty, add an extra property,
// ExtraProperty, that is not a member of the indication class
//
if (methodName.equal ("SendTestIndicationExtraProperty"))
{
indicationInstance.addProperty
(CIMProperty ("ExtraProperty",
CIMValue (String ("extraProperty"))));
}
CIMIndication cimIndication (indicationInstance);
//
// For SendTestIndicationSubclass,
// SendTestIndicationMatchingInstance,
// SendTestIndicationUnmatchingNamespace or
// SendTestIndicationUnmatchingClassName, include
// SubscriptionInstanceNamesContainer in operation context
//
if ((methodName.equal ("SendTestIndicationSubclass")) ||
(methodName.equal ("SendTestIndicationMatchingInstance")) ||
(methodName.equal ("SendTestIndicationUnmatchingNamespace")) ||
(methodName.equal ("SendTestIndicationUnmatchingClassName")))
{
Array <CIMObjectPath> subscriptionInstanceNames;
Array <CIMKeyBinding> subscriptionKeyBindings;
String filterString;
filterString.append ("CIM_IndicationFilter.CreationClassName=\"CIM_IndicationFilter\",Name=\"PIFilter01\",SystemCreationClassName=\"");
filterString.append (System::getSystemCreationClassName ());
filterString.append ("\",SystemName=\"");
filterString.append (System::getFullyQualifiedHostName ());
filterString.append ("\"");
subscriptionKeyBindings.append (CIMKeyBinding ("Filter",
filterString, CIMKeyBinding::REFERENCE));
String handlerString;
handlerString.append ("CIM_IndicationHandlerCIMXML.CreationClassName=\"CIM_IndicationHandlerCIMXML\",Name=\"PIHandler01\",SystemCreationClassName=\"");
handlerString.append (System::getSystemCreationClassName ());
handlerString.append ("\",SystemName=\"");
handlerString.append (System::getFullyQualifiedHostName ());
handlerString.append ("\"");
subscriptionKeyBindings.append (CIMKeyBinding ("Handler",
handlerString, CIMKeyBinding::REFERENCE));
CIMObjectPath subscriptionPath ("",
CIMNamespaceName ("root/PG_InterOp"),
CIMName ("CIM_IndicationSubscription"),
subscriptionKeyBindings);
subscriptionInstanceNames.append (subscriptionPath);
OperationContext context;
context.insert (SubscriptionInstanceNamesContainer
(subscriptionInstanceNames));
handler->deliver (context, indicationInstance);
}
else
{
// deliver an indication without trapOid
handler->deliver (indicationInstance);
}
//
// Only deliver extra indication with trapOid for SendTestIndication
//
if ((!methodName.equal ("SendTestIndicationNormal")) &&
(!methodName.equal ("SendTestIndicationSubclass")) &&
(!methodName.equal ("SendTestIndicationMissingProperty")) &&
(!methodName.equal ("SendTestIndicationExtraProperty")) &&
(!methodName.equal ("SendTestIndicationMatchingInstance")) &&
(!methodName.equal ("SendTestIndicationUnmatchingNamespace")) &&
(!methodName.equal ("SendTestIndicationUnmatchingClassName")))
{
// deliver another indication with a trapOid which contains in the
// operationContext container
OperationContext context;
// add trap OID to the context
context.insert
(SnmpTrapOidContainer("1.3.6.1.4.1.900.2.3.9002.9600"));
handler->deliver (context, indicationInstance);
}
}
}
示例5: mbDeliverIndication
static CMPIStatus mbDeliverIndication(
const CMPIBroker* eMb,
const CMPIContext* ctx,
const char *ns,
const CMPIInstance* ind)
{
PEG_METHOD_ENTER(
TRC_CMPIPROVIDERINTERFACE,
"CMPI_Broker:mbDeliverIndication()");
eMb = CM_BROKER;
CMPI_Broker *mb = (CMPI_Broker*)eMb;
IndProvRecord *indProvRec;
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,
// the CMPIBroker contains the name of the provider in the form
// of physical-name:logical-name. Search using logical-name. -V 5884
String provider_name;
CMPIUint32 n;
if ( (n = mb->name.find(':') ) != PEG_NOT_FOUND)
{
provider_name = mb->name.subString (n + 1);
}
else
{
provider_name = mb->name;
}
ReadLock readLock(CMPIProviderManager::rwSemProvTab);
if (CMPIProviderManager::indProvTab.lookup(provider_name, indProvRec))
{
if (indProvRec->isEnabled())
{
try
{
context->get(SubscriptionInstanceNamesContainer::NAME);
}
catch (const Exception &e)
{
PEG_TRACE((TRC_CMPIPROVIDERINTERFACE,Tracer::LEVEL1,
"Exception: %s",
(const char*)e.getMessage().getCString()));
Array<CIMObjectPath> subscriptionInstanceNames;
context->insert(
SubscriptionInstanceNamesContainer(
subscriptionInstanceNames));
}
CIMIndication cimIndication(indInst);
try
{
indProvRec->getHandler()->deliver(
*context,
// OperationContext(*CM_Context(ctx)),
cimIndication);
PEG_METHOD_EXIT();
CMReturn(CMPI_RC_OK);
}
HandlerCatchReturnStatus();
}
}
PEG_METHOD_EXIT();
CMReturn(CMPI_RC_ERR_FAILED);
}