这篇教程C++ CMNewObjectPath函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中CMNewObjectPath函数的典型用法代码示例。如果您正苦于以下问题:C++ CMNewObjectPath函数的具体用法?C++ CMNewObjectPath怎么用?C++ CMNewObjectPath使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了CMNewObjectPath函数的26个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: IndCIMXMLHandlerEnumInstanceNamesCMPIStatus IndCIMXMLHandlerEnumInstanceNames(CMPIInstanceMI * mi, const CMPIContext * ctx, const CMPIResult * rslt, const CMPIObjectPath * ref){ CMPIStatus st; CMPIEnumeration *enm; CMPIContext *ctxLocal; _SFCB_ENTER(TRACE_INDPROVIDER, "IndCIMXMLHandlerEnumInstanceNames"); if (interOpNameSpace(ref,&st)!=1) _SFCB_RETURN(st); ctxLocal = prepareUpcall((CMPIContext *)ctx);#ifdef HAVE_OPTIMIZED_ENUMERATION CMPIString* cn; CMPIObjectPath* refLocal; cn = CMGetClassName(ref, &st); if (strcasecmp(CMGetCharPtr(cn), "cim_listenerdestination") == 0) { enm = _broker->bft->enumerateInstanceNames(_broker, ctxLocal, ref, &st); while(enm && enm->ft->hasNext(enm, &st)) { CMReturnObjectPath(rslt, (enm->ft->getNext(enm, &st)).value.ref); } refLocal = CMNewObjectPath(_broker,"root/interop","cim_listenerdestinationcimxml",&st); enm = _broker->bft->enumerateInstanceNames(_broker, ctxLocal, refLocal, &st); while(enm && enm->ft->hasNext(enm, &st)) { CMReturnObjectPath(rslt, (enm->ft->getNext(enm, &st)).value.ref); } refLocal = CMNewObjectPath(_broker,"root/interop","cim_indicationhandlercimxml",&st); enm = _broker->bft->enumerateInstanceNames(_broker, ctxLocal, refLocal, &st); while(enm && enm->ft->hasNext(enm, &st)) { CMReturnObjectPath(rslt, (enm->ft->getNext(enm, &st)).value.ref); } CMRelease(refLocal); } else { enm = _broker->bft->enumerateInstanceNames(_broker, ctxLocal, ref, &st); while(enm && enm->ft->hasNext(enm, &st)) { CMReturnObjectPath(rslt, (enm->ft->getNext(enm, &st)).value.ref); } }#else enm = _broker->bft->enumerateInstanceNames(_broker, ctxLocal, ref, &st); while(enm && enm->ft->hasNext(enm, &st)) { CMReturnObjectPath(rslt, (enm->ft->getNext(enm, &st)).value.ref); }#endif CMRelease(ctxLocal); if(enm) CMRelease(enm); _SFCB_RETURN(st);}
开发者ID:zaneb,项目名称:sblim-sfcb,代码行数:54,
示例2: get_assoc_targetClass_ObjectPathCMPIObjectPath *get_assoc_targetClass_ObjectPath(const CMPIBroker * broker, const CMPIObjectPath * ref, const char *_RefLeftClass, const char *_RefRightClass, CMPIStatus *rc){ CMPIObjectPath *op = NULL; const char *targetName = NULL; /* * get name of the target class */ targetName = get_assoc_targetClass_Name(broker, ref, _RefLeftClass, _RefRightClass, rc); if (targetName != NULL) { /* * create new object path of the target class */ op = CMNewObjectPath(broker, CMGetCharsPtr(CMGetNameSpace(ref, rc), NULL), targetName, rc); } return op;}
开发者ID:mchasal,项目名称:SFCB,代码行数:28,
示例3: _makeInst_ServiceProcessCMPIInstance * _makeInst_ServiceProcess( const CMPIBroker * _broker, const CMPIObjectPath * service, CMPIObjectPath * process, CMPIStatus * rc) { CMPIObjectPath * op = NULL; CMPIInstance * ci = NULL; _OSBASE_TRACE(4,("--- _makeInst_ServiceProcess() called")); /* create CMPIObjectPath of this association <_ClassName> */ op = CMNewObjectPath( _broker, CMGetCharPtr(CMGetNameSpace(service,rc)), _ClassName, rc ); if( CMIsNullObject(op) ) { CMSetStatusWithChars( _broker, rc, CMPI_RC_ERR_FAILED, "Create CMPIObjectPath failed." ); goto exit; } ci = CMNewInstance( _broker, op, rc); if( CMIsNullObject(ci) ) { CMSetStatusWithChars( _broker, rc, CMPI_RC_ERR_FAILED, "Create CMPIInstance failed." ); _OSBASE_TRACE(4,("--- _makeInst_ServiceProcess() failed : %s",CMGetCharPtr(rc->msg))); goto exit; } CMSetProperty( ci, _RefLeft, (CMPIValue*)&(service), CMPI_ref ); CMSetProperty( ci, _RefRight, (CMPIValue*)&(process), CMPI_ref ); exit: _OSBASE_TRACE(4,("--- _makeInst_ServiceProcess() exited")); return ci; }
开发者ID:zaneb,项目名称:sblim-cmpi-service,代码行数:33,
示例4: Linux_FanAssociatedSensorProviderAssociatorsCMPIStatus Linux_FanAssociatedSensorProviderAssociators( CMPIAssociationMI * mi, const CMPIContext * ctx, const CMPIResult * rslt, const CMPIObjectPath * cop, const char * assocClass, const char * resultClass, const char * role, const char * resultRole, const char ** propertyList){ UNUSED(mi); UNUSED(propertyList); CMPIStatus rc = {CMPI_RC_OK, NULL}; CMPIObjectPath * op = NULL; int refrc = 0; _OSBASE_TRACE(1,("--- %s CMPI Associators() called",_ClassName)); if( assocClass ) { op = CMNewObjectPath( _broker, CMGetCharPtr(CMGetNameSpace(cop,&rc)), _ClassName, &rc ); if( op==NULL ) { CMSetStatusWithChars( _broker, &rc, CMPI_RC_ERR_FAILED, "Create CMPIObjectPath failed." ); _OSBASE_TRACE(2, ("--- %s CMPI Associators() failed : %s",CMGetCharPtr(rc.msg))); return rc; } } if ( (assocClass == NULL) || (CMClassPathIsA(_broker,op,assocClass,&rc) == 1)) { if( _assoc_check_parameter_const( _broker,cop,_RefLeft,_RefRight, _RefLeftClass,_RefRightClass, resultClass,role,resultRole, &rc ) == 0 ) { goto exit; } refrc = _assoc_create_refs_1toN(_broker, ctx, rslt, cop, _ClassName,_RefLeftClass,_RefRightClass, _RefLeft,_RefRight, 1, 1, &rc); if( refrc != 0 ) { if( rc.msg != NULL ) { _OSBASE_TRACE(1, ("--- %s CMPI Associators() failed : %s", _ClassName,CMGetCharPtr(rc.msg))); } else { _OSBASE_TRACE(1,("--- %s CMPI Associators() failed",_ClassName)); } return rc; } } exit: CMReturnDone( rslt ); _OSBASE_TRACE(1,("--- %s CMPI Associators() exited",_ClassName)); CMReturn(CMPI_RC_OK);}
开发者ID:miminar,项目名称:sblim-cmpi-fan,代码行数:60,
示例5: get_assoc_targetClass_ObjectPathCMPIObjectPath *get_assoc_targetClass_ObjectPath(const CMPIBroker * broker, const CMPIObjectPath * ref, const char *_RefLeftClass, const char *_RefRightClass, CMPIStatus *rc){ CMPIObjectPath *op = NULL; const char *targetName = NULL; /* * get name of the target class */ targetName = get_assoc_targetClass_Name(broker, ref, _RefLeftClass, _RefRightClass, rc); if (targetName != NULL) { /* * create new object path of the target class */ op = CMNewObjectPath(broker, CMGetCharsPtr(CMGetNameSpace(ref, rc), NULL), targetName, rc); if (!op) CMSetStatusWithChars(_broker, rc, CMPI_RC_ERR_FAILED, "Create CMPIObjectPath failed in cmpiTestAssociationProvider"); } return op;}
开发者ID:buccella,项目名称:SFCB,代码行数:32,
示例6: dqRetryintdqRetry(CMPIContext * ctx, RTElement * cur){ _SFCB_ENTER(TRACE_INDPROVIDER, "dqRetry"); // Delete the instance in the repo CMPIObjectPath * op=CMNewObjectPath(_broker,"root/interop","SFCB_IndicationElement",NULL); CMAddKey(op,"IndicationID",&cur->instanceID,CMPI_uint32); CBDeleteInstance(_broker,ctx,op); CBDeleteInstance(_broker,ctx,cur->ind); CMRelease(op); // Remove the entry from the queue, closing the hole if (cur->next == cur) { // queue is empty free(cur); RQhead = NULL; } else { // not last cur->prev->next = cur->next; cur->next->prev = cur->prev; CMRelease(cur->ref); CMRelease(cur->sub); if (cur) free(cur); } _SFCB_RETURN(0);}
开发者ID:pravinmahajan,项目名称:sblim-sfcb,代码行数:27,
示例7: get_assoc_targetClass_Nameconst char *get_assoc_targetClass_Name(const CMPIBroker * broker, const CMPIObjectPath * ref, const char *_RefLeftClass, const char *_RefRightClass, CMPIStatus *rc){ CMPIString *sourceClass = NULL; CMPIObjectPath *op = NULL; /* * get name of source class */ sourceClass = CMGetClassName(ref, rc); op = CMNewObjectPath(broker, CMGetCharsPtr(CMGetNameSpace(ref, rc), NULL), _RefLeftClass, rc); if (strcmp(CMGetCharsPtr(sourceClass, NULL), "CMPI_TEST_Person") == 0) { return "CMPI_TEST_Vehicle"; } else if (strcmp(CMGetCharsPtr(sourceClass, NULL), "CMPI_TEST_Vehicle") == 0) { return "CMPI_TEST_Person"; } else { return NULL; }}
开发者ID:buccella,项目名称:SFCB,代码行数:27,
示例8: IndCIMXMLHandlerDeleteInstanceCMPIStatusIndCIMXMLHandlerDeleteInstance(CMPIInstanceMI * mi, const CMPIContext *ctx, const CMPIResult *rslt, const CMPIObjectPath * cop){ CMPIStatus st = { CMPI_RC_OK, NULL }; CMPIArgs *in, *out = NULL; CMPIObjectPath *op; CMPIData rv; _SFCB_ENTER(TRACE_INDPROVIDER, "IndCIMXMLHandlerDeleteInstance"); if (interOpNameSpace(cop, &st) == 0) _SFCB_RETURN(st); internalProviderGetInstance(cop, &st); if (st.rc) _SFCB_RETURN(st); in = CMNewArgs(_broker, NULL); CMAddArg(in, "key", &cop, CMPI_ref); op = CMNewObjectPath(_broker, "root/interop", "cim_indicationsubscription", &st); rv = CBInvokeMethod(_broker, ctx, op, "_removeHandler", in, out, &st); if (st.rc == CMPI_RC_OK) { st = InternalProviderDeleteInstance(NULL, ctx, rslt, cop); } _SFCB_RETURN(st);}
开发者ID:pravinmahajan,项目名称:sblim-sfcb,代码行数:33,
示例9: generateIndication2static voidgenerateIndication2(const char *methodname, const CMPIContext *ctx){ CMPIInstance *inst; CMPIObjectPath *cop; CMPIDateTime *dat; CMPIArray *ar; CMPIStatus rc; char buffer[32]; if (enabled && activated2) { cop = CMNewObjectPath(broker, "root/interop2", "Test_Indication", &rc); inst = CMNewInstance(broker, cop, &rc); sprintf(buffer, "%d", _nextUID++); CMSetProperty(inst, "IndicationIdentifier", buffer, CMPI_chars); dat = CMNewDateTime(broker, &rc); CMSetProperty(inst, "IndicationTime", &dat, CMPI_dateTime); CMSetProperty(inst, "MethodName", methodname, CMPI_chars); ar = CMNewArray(broker, 0, CMPI_string, &rc); CMSetProperty(inst, "CorrelatedIndications", &ar, CMPI_stringA); rc = CBDeliverIndication(broker, ctx, "root/interop", inst); if (rc.rc != CMPI_RC_OK) { fprintf(stderr, "+++ Could not send the indication!/n"); } gen2++; } fprintf(stderr, "+++ generateIndication2() done %d/n", gen2);}
开发者ID:buccella,项目名称:SFCB,代码行数:34,
示例10: TestCMPIAssociationProviderAssociatorNamesCMPIStatus TestCMPIAssociationProviderAssociatorNames( CMPIAssociationMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref, const char* _RefLeftClass, const char* _RefRightClass, const char* role, const char* resultRole){ CMPIObjectPath* op = NULL; CMPIObjectPath* rop = NULL; CMPIEnumeration* en = NULL; CMPIData data ; CMPIStatus rc = { CMPI_RC_OK, NULL }; PROV_LOG_OPEN (_ClassName, _ProviderLocation); PROV_LOG ("/n/n********************* %s CMPI AssociatorNames() called", _ClassName); /* get object path of the target class */ op = get_assoc_targetClass_ObjectPath( _broker, ref, _RefLeftClass, _RefRightClass, &rc); PROV_LOG (" New Object Path [%s]", CMGetCharsPtr (CMGetNameSpace (ref, &rc),NULL)); /* create new object path of association */ rop = CMNewObjectPath( _broker, CMGetCharsPtr(CMGetNameSpace(ref,&rc),NULL), _ClassName, &rc ); /* upcall to CIMOM; call enumInstanceNames() of the target class */ en = CBEnumInstanceNames( _broker, ctx, op, &rc); /* as long as object path entries are found in the enumeration */ while( CMHasNext( en, &rc) ) { /* get the object path */ data = CMGetNext(en, &rc); /* and return the target class object path as result of the * associatorNames() call */ CMReturnObjectPath( rslt, data.value.ref ); } PROV_LOG ("/n/n********************* %s CMPI AssociatorNames() exited", _ClassName); PROV_LOG_CLOSE (); return rc;}
开发者ID:rdobson,项目名称:openpegasus,代码行数:58,
示例11: _SMI_TRACECMPIObjectPath *RegisteredProfileCreateObjectPath( const char *ns, const char *name, CMPIStatus *status){ CMPIObjectPath *cop; char buf[256]; _SMI_TRACE(1,("RegisteredProfileCreateObjectPath() called")); if (strcasecmp(name, VolumeManagementName) == 0 || strcasecmp(name, ArrayName) == 0 || strcasecmp(name, ServerName) == 0) { cop = CMNewObjectPath( _BROKER, ns, RegisteredProfileName, status); } else { cop = CMNewObjectPath( _BROKER, ns, RegisteredSubProfileName, status); } if ((status->rc != CMPI_RC_OK) || CMIsNullObject(cop)) { _SMI_TRACE(1,("RegisteredProfileCreateObjectPath(): CMNewObjectPath() failed - %s", CMGetCharPtr(status->msg))); CMSetStatusWithChars(_BROKER, status, CMPI_RC_ERROR_SYSTEM, "Cannot create new objectpath"); goto exit; } CMAddKey(cop, InstanceIDName, cmpiutilMakeInstanceID(name, buf, 256), CMPI_chars);/* *buf = 0; strncat(buf, "SNIA:", 256); strncat(buf, name , 256); CMAddKey(cop, "InstanceID", buf , CMPI_chars);*/exit: _SMI_TRACE(1,("RegisteredProfileCreateObjectPath() done")); return cop;}
开发者ID:kkaempf,项目名称:smis-providers,代码行数:44,
示例12: make_ObjectPathCMPIObjectPath *make_ObjectPath(const CMPIBroker * broker, const char *ns, const char *className){ CMPIObjectPath *objPath = NULL; CMPIStatus rc = { CMPI_RC_OK, NULL }; objPath = CMNewObjectPath(broker, ns, className, &rc); CMAddKey(objPath, "ElementName", (CMPIValue *) className, CMPI_chars); return objPath;}
开发者ID:pravinmahajan,项目名称:sblim-sfcb,代码行数:10,
示例13: enqRetryintenqRetry(RTElement * element, const CMPIContext * ctx, int repo){ _SFCB_ENTER(TRACE_INDPROVIDER, "enqRetry"); // Put this one on the retry queue if (pthread_mutex_lock(&RQlock) != 0) { // lock failed return 1; } if (RQhead == NULL) { // Queue is empty _SFCB_TRACE(1,("--- Adding indication to new retry queue.")); RQhead = element; RQtail = element; RQtail->next = element; RQtail->prev = element; } else { _SFCB_TRACE(1,("--- Adding indication to retry queue.")); element->next = RQtail->next; element->next->prev = element; RQtail->next = element; element->prev = RQtail; RQtail = element; } if (repo==1) { // If this needs to be persisted in the repo // (not the initial fill from refillRetryQ) _SFCB_TRACE(1,("--- Creating SFCB_IndicationElement instance.")); CMPIObjectPath * op=CMNewObjectPath(_broker,"root/interop","SFCB_IndicationElement",NULL); // Add the indID as the only key CMAddKey(op,"IndicationID",&element->instanceID,CMPI_uint32); // Create the instance //element->SFCBIndEle=op; element->SFCBIndEle=op->ft->clone(op,NULL); CMPIInstance * ci=CMNewInstance(_broker,op,NULL); // Set all the properties CMSetProperty(ci,"IndicationID",&element->instanceID,CMPI_uint32); CMSetProperty(ci,"RetryCount",&(RQtail->count),CMPI_uint32); CMSetProperty(ci,"LastDelivery",&(RQtail->lasttry),CMPI_sint32); CMSetProperty(ci,"ld",&(element->ref),CMPI_ref); CMSetProperty(ci,"ind",&element->ind,CMPI_ref); CMSetProperty(ci,"sub",&element->sub,CMPI_ref); CBCreateInstance(_broker, ctx, op, ci, NULL); CMRelease(op); CMRelease(ci); } if (pthread_mutex_unlock(&RQlock) != 0) { // lock failed return 1; } _SFCB_RETURN(0);}
开发者ID:pravinmahajan,项目名称:sblim-sfcb,代码行数:54,
示例14: loopOnChildNamesstatic void loopOnChildNames(ClassRegister *cReg, char *cn, CMPIResult * rslt){ CMPIObjectPath *op; UtilList *ul = getChildren(cReg,cn); char *child; if (ul) for (child = (char *) ul->ft->getFirst(ul); child; child = (char *) ul->ft->getNext(ul)) { op=CMNewObjectPath(_broker,NULL,child,NULL); CMReturnObjectPath(rslt,op); loopOnChildNames(cReg,child,rslt); }}
开发者ID:zaneb,项目名称:sblim-sfcb,代码行数:11,
示例15: KBase_ToObjectPathCMPIObjectPath* KBase_ToObjectPath( const KBase* self, CMPIStatus* st){ KPos pos; CMPIObjectPath* cop; /* Check parameters */ if (self->magic != KMAGIC) { KSetStatus(st, ERR_FAILED); return NULL; } /* Create object path */ KFirst(&pos, self); if (!(cop = CMNewObjectPath(self->cb, KChars(self->ns), pos.classname, st))) { return NULL; } /* Set keys */ while (KMore(&pos)) { CMPIData cd; const KValue* value = (const KValue*)pos.field; if (value->exists && (pos.tag & KTAG_KEY)) { CMPIStatus st; cd = _data(value, pos.tag); if (value->null) st = CMAddKey(cop, pos.name, NULL, cd.type); else st = CMAddKey(cop, pos.name, &cd.value, cd.type); if (!KOkay(st)) { /* ATTN: log this but do not return! */ } } KNext(&pos); } return cop;}
开发者ID:jubalh,项目名称:konkretcmpi,代码行数:54,
示例16: ElementCapabilitiesInitInstancesvoidElementCapabilitiesInitInstances(const CMPIContext *ctx){ CMPIObjectPath *op = NULL, *opLeft = NULL, *opRight = NULL, *left = NULL, *right = NULL; CMPIValue val; CMPIEnumeration *enm = NULL; CMPIInstance *ci = NULL; CMPIContext *ctxLocal; ctxLocal = native_clone_CMPIContext(ctx); val.string = sfcb_native_new_CMPIString("$DefaultProvider$", NULL, 0); ctxLocal->ft->addEntry(ctxLocal, "rerouteToProvider", &val, CMPI_string); op = CMNewObjectPath(_broker, "root/interop", "SFCB_ElementCapabilities", NULL); ci = CMNewInstance(_broker, op, NULL); opLeft = CMNewObjectPath(_broker, "root/interop", "CIM_IndicationService", NULL); enm = CBEnumInstanceNames(_broker, ctx, opLeft, NULL); left = CMGetNext(enm, NULL).value.ref; opRight = CMNewObjectPath(_broker, "root/interop", "SFCB_IndicationServiceCapabilities", NULL); enm = CBEnumInstanceNames(_broker, ctx, opRight, NULL); right = CMGetNext(enm, NULL).value.ref; CMAddKey(op, "ManagedElement", &left, CMPI_ref); CMAddKey(op, "Capabilities", &right, CMPI_ref); CMSetProperty(ci, "ManagedElement", &left, CMPI_ref); CMSetProperty(ci, "Capabilities", &right, CMPI_ref); CBCreateInstance(_broker, ctxLocal, op, ci, NULL); CMRelease(ctxLocal); return;}
开发者ID:buccella,项目名称:SFCB,代码行数:40,
示例17: _SMI_TRACECMPIObjectPath *SoftwareIdentityCreateObjectPath( const char *ns, const char *name, CMPIStatus *status){ CMPIObjectPath *cop; char buf[256]; _SMI_TRACE(1,("SoftwareIdentityCreateObjectPath() called")); if (strcasecmp(name, SMIArrayName) == 0) { cop = CMNewObjectPath( _BROKER, ns, ArraySoftwareName, status); } else if (strcasecmp(name, SMIVolumeManagementName) == 0) { cop = CMNewObjectPath( _BROKER, ns, VolumeManagementSoftwareName, status); } if ((status->rc != CMPI_RC_OK) || CMIsNullObject(cop)) { _SMI_TRACE(1,("SoftwareIdentityCreateObjectPath(): CMNewObjectPath() failed - %s", CMGetCharPtr(status->msg))); CMSetStatusWithChars(_BROKER, status, CMPI_RC_ERROR_SYSTEM, "Cannot create new objectpath"); goto exit; } CMAddKey(cop, InstanceIDName, cmpiutilMakeInstanceID(name, buf, 256), CMPI_chars);exit: _SMI_TRACE(1,("SoftwareIdentityCreateObjectPath() done")); return cop;}
开发者ID:kkaempf,项目名称:smis-providers,代码行数:38,
示例18: refillRetryQint refillRetryQ (const CMPIContext * ctx){ _SFCB_ENTER(TRACE_INDPROVIDER, "refillRetryQ"); int qfill=0; if (RQhead==NULL) { // The queue is empty, check if there are instances to be restored CMPIObjectPath * op=CMNewObjectPath(_broker,"root/interop","SFCB_IndicationElement",NULL); CMPIEnumeration * enm = _broker->bft->enumerateInstances(_broker, ctx, op, NULL, NULL); while(enm && enm->ft->hasNext(enm, NULL)) { // get the properties from the repo instance CMPIData inst=CMGetNext(enm,NULL); CMPIData indID=CMGetProperty(inst.value.inst,"indicationID",NULL); CMPIData rcount=CMGetProperty(inst.value.inst,"retryCount",NULL); CMPIData last=CMGetProperty(inst.value.inst,"lastDelivery",NULL); CMPIData ind=CMGetProperty(inst.value.inst,"ind",NULL); CMPIData sub=CMGetProperty(inst.value.inst,"sub",NULL); CMPIData ld=CMGetProperty(inst.value.inst,"ld",NULL); _SFCB_TRACE(1,("--- Requeueing indication id:%d",indID.value.Int)); // Rebuild the queue element RTElement *element; element = (RTElement *) malloc(sizeof(*element)); element->instanceID=indID.value.Int; element->lasttry=last.value.Int; element->count=rcount.value.Int; element->ind=ind.value.ref->ft->clone(ind.value.ref,NULL); element->ref=ld.value.ref->ft->clone(ld.value.ref,NULL); element->sub=sub.value.ref->ft->clone(sub.value.ref,NULL); CMPIObjectPath * indele=CMGetObjectPath(inst.value.inst,NULL); element->SFCBIndEle=indele->ft->clone(indele,NULL); // call enq enqRetry(element,ctx,0); qfill=1; } // spawn thread if we queued anything if ((qfill == 1 ) && (retryRunning == 0)) { retryRunning=1; _SFCB_TRACE(1,("--- Starting retryExport thread")); pthread_attr_init(&tattr); pthread_attr_setdetachstate(&tattr, PTHREAD_CREATE_DETACHED); CMPIContext * pctx = native_clone_CMPIContext(ctx); pthread_create(&t, &tattr,&retryExport,(void *) pctx); } } _SFCB_RETURN(0); }
开发者ID:pravinmahajan,项目名称:sblim-sfcb,代码行数:46,
示例19: _makePath_TestClassACMPIObjectPath * _makePath_TestClassA( const CMPIBroker * _broker, const CMPIContext * ctx, const CMPIObjectPath * cop){ CMPIObjectPath * op = NULL; CMPIValue theKey; theKey.uint32 = 2; op=CMNewObjectPath( _broker, CMGetCharsPtr(CMGetNameSpace(cop,NULL), NULL), _ClassName, NULL); CMAddKey(op, "theKey", &theKey, CMPI_uint32); return op;}
开发者ID:brunolauze,项目名称:pegasus,代码行数:18,
示例20: CMNewObjectPathCMPIObjectPath *kvp_rasd_create_ref( const CMPIBroker *broker, const char *name_space, xen_utils_session *session, xen_vm_record *vm_rec, kvp *kvp_rec){ char inst_id[MAX_INSTANCEID_LEN]; CMPIObjectPath *result_setting = NULL; result_setting = CMNewObjectPath(broker, name_space, "Xen_KVPSettingData", NULL); if (result_setting) { _CMPICreateNewDeviceInstanceID(inst_id, MAX_INSTANCEID_LEN, kvp_rec->vm_uuid, kvp_rec->key); CMAddKey(result_setting, "InstanceID", (CMPIValue *)inst_id, CMPI_chars); } return result_setting;}
开发者ID:murisfurder,项目名称:xs-cim,代码行数:19,
示例21: _makePath_ServiceCMPIObjectPath * _makePath_Service( const CMPIBroker * _broker, const CMPIContext * ctx, const CMPIObjectPath * ref, LXS_Service * lxssvc, CMPIStatus * rc) { CMPIObjectPath * op = NULL; _OSBASE_TRACE(2,("--- _makePath_Service() called")); /* the sblim-cmpi-base package offers some tool methods to get common * system data */ if( !get_system_name() ) { CMSetStatusWithChars( _broker, rc, CMPI_RC_ERR_FAILED, "no host name found" ); _OSBASE_TRACE(2,("--- _makePath_Service() failed : %s",CMGetCharPtr(rc->msg))); goto exit; } op = CMNewObjectPath( _broker, CMGetCharPtr(CMGetNameSpace(ref,rc)), _ClassName, rc ); if( CMIsNullObject(op) ) { CMSetStatusWithChars( _broker, rc, CMPI_RC_ERR_FAILED, "Create CMPIObjectPath failed." ); _OSBASE_TRACE(2,("--- _makePath_Service() failed : %s",CMGetCharPtr(rc->msg))); goto exit; } CMAddKey(op, "SystemCreationClassName", CSCreationClassName, CMPI_chars); CMAddKey(op, "SystemName", get_system_name(), CMPI_chars); CMAddKey(op, "CreationClassName", _ClassName, CMPI_chars); CMAddKey(op, "Name", lxssvc->svName, CMPI_chars); exit: _OSBASE_TRACE(2,("--- _makePath_Service() exited")); return op; }
开发者ID:zaneb,项目名称:sblim-cmpi-service,代码行数:37,
示例22: _testBrokerEnc// To increase the coverage in CMPIBrokerEnc.cppstatic int _testBrokerEnc (const CMPIContext * ctx, const CMPIResult * rslt){ int flag = 1 ; int count; char* msgId; char* illegal; char path[100]; void* hdl; CMPIStatus rc = { CMPI_RC_OK, NULL }; CMPIString *type; CMPIString *cmpiStr; CMPIBoolean bol=0; CMPIBoolean bool=0; CMPIArray* cmpiArray = NULL ; CMPIInstance* instance = NULL; CMPIInstance* instance1 = NULL; CMPIInstance* instanceErr = NULL; CMPIObjectPath* objPath = NULL; CMPIObjectPath* objPath1 = NULL; CMPICount cmpiCnt = 5; CMPIType cmpiType = CMPI_uint64; CMPIDateTime* cmpiDateTime = NULL ; CMPIMsgFileHandle msgFileHandle; CMPIEnumeration* cmpiEnum; CMPISelectExp* selExp; CMPIValue val; CMPIError* err; CMPIStatus* rc1 = NULL; CMPIArgs* args = NULL; void* handle; CMPIInstanceFT* funcTable; PROV_LOG ("++++ _testBrokerEnc "); PROV_LOG ("++++ ObjectPath testing"); objPath1 = CMNewObjectPath (_broker, NULL, _ClassName, &rc); PROV_LOG ("++++ New object path with NULL namespace creation : (%s)", strCMPIStatus (rc)); CMRelease(objPath1); objPath1 = CMNewObjectPath (_broker, _Namespace, "abc", &rc); PROV_LOG ("++++ New object path with wrong classname : (%s)", strCMPIStatus (rc)); instance = CMNewInstance(_broker, NULL, &rc); PROV_LOG ("++++ New Instance with NULL object path : (%s)", strCMPIStatus (rc)); handle = objPath1->hdl; objPath1->hdl=NULL; instance = CMNewInstance(_broker, objPath1, &rc); PROV_LOG ("++++ New Instance with object path handle set to NULL: (%s)", strCMPIStatus (rc)); objPath1->hdl = handle; objPath = make_ObjectPath(_broker, _Namespace, _ClassName); instance = CMNewInstance(_broker, objPath, &rc); PROV_LOG ("++++ New Instance creation status: (%s)", strCMPIStatus (rc)); instance1 = CMClone(instance, &rc); instanceErr = CMClone(instance, &rc); cmpiStr = CMNewString(_broker, NULL, &rc); PROV_LOG ("++++ Status of mbNewString with NULL parameter:(%s)", strCMPIStatus (rc)); err = CMNewCMPIError(_broker, "abc", "abc", "abc", 4, 5, 6, rc1); if (err) { PROV_LOG ("++++ CMNewCMPIError called with null rc"); } cmpiDateTime = CMNewDateTimeFromChars(_broker, "datetime", &rc); PROV_LOG ("++++ Status of CMNewDateTimeFromChars with junk parameter:(%s)", strCMPIStatus (rc)); if (!CMClassPathIsA(_broker, NULL, NULL, &rc)) { PROV_LOG ("++++ Error Status of CMClassPathIsA:(%s)", strCMPIStatus (rc)); } if (!CMClassPathIsA(_broker, objPath, NULL, &rc)) { PROV_LOG ("++++ Error Status of CMClassPathIsA:(%s)", strCMPIStatus (rc)); } illegal = "$"; if (!CMClassPathIsA(_broker, objPath, illegal, &rc)) { PROV_LOG ("++++ Error Status of CMClassPathIsA:(%s)", strCMPIStatus (rc)); } rc = CMLogMessage(_broker, 2, "TestProvider",//.........这里部分代码省略.........
开发者ID:rdobson,项目名称:openpegasus,代码行数:101,
示例23: ClassProviderEnumClassNamesstatic CMPIStatusClassProviderEnumClassNames(CMPIClassMI * mi, const CMPIContext *ctx, const CMPIResult *rslt, const CMPIObjectPath * ref){ CMPIStatus st = { CMPI_RC_OK, NULL }; char *cn = NULL; CMPIFlags flgs = 0; CMPIString *cni; ClassBase *cb; Iterator it; char *key; int rc, n; ClassRecord *crec; CMPIObjectPath *op; ClassRegister *cReg; char *ns; _SFCB_ENTER(TRACE_PROVIDERS, "ClassProviderEnumClassNames"); cReg = getNsReg(ref, &rc); if (cReg == NULL) { CMPIStatus st = { CMPI_RC_ERR_INVALID_NAMESPACE, NULL }; _SFCB_RETURN(st); } ns = (char *) CMGetNameSpace(ref, NULL)->hdl; flgs = ctx->ft->getEntry(ctx, CMPIInvocationFlags, NULL).value.uint32; cni = ref->ft->getClassName(ref, NULL); if (cni) { cn = (char *) cni->hdl; if (cn && *cn == 0) cn = NULL; } cb = (ClassBase *) cReg->hdl; cReg->ft->wLock(cReg); if (cn && strcasecmp(cn, "$ClassProvider$") == 0) cn = NULL; if (cn == NULL) { n = 0; for (it = cReg->ft->getFirstClassRecord(cReg, &key, &crec); key && it && crec; it = cReg->ft->getNextClassRecord(cReg, it, &key, &crec)) { if ((flgs & CMPI_FLAG_DeepInheritance) || crec->parent == NULL) { if (((flgs & FL_assocsOnly) == 0) || crec->flags & CREC_isAssociation) { op = CMNewObjectPath(_broker, ns, key, NULL); CMReturnObjectPath(rslt, op); } } } } else { CMPIConstClass *cls = getClass(cReg, cn, NULL); if (cls == NULL) { st.rc = CMPI_RC_ERR_INVALID_CLASS; } else if ((flgs & CMPI_FLAG_DeepInheritance) == 0) { UtilList *ul = getChildren(cReg, cn); char *child; if (ul) for (child = (char *) ul->ft->getFirst(ul); child; child = (char *) ul->ft->getNext(ul)) { op = CMNewObjectPath(_broker, ns, child, NULL); CMReturnObjectPath(rslt, op); } } else if (flgs & CMPI_FLAG_DeepInheritance) { if (((flgs & FL_assocsOnly) == 0) || crec->flags & CREC_isAssociation) loopOnChildNames(cReg, cn, rslt); } } cReg->ft->wUnLock(cReg); _SFCB_RETURN(st);}
开发者ID:mchasal,项目名称:SFCB,代码行数:81,
示例24: IndCIMXMLHandlerInvokeMethodCMPIStatusIndCIMXMLHandlerInvokeMethod(CMPIMethodMI * mi, const CMPIContext *ctx, const CMPIResult *rslt, const CMPIObjectPath * ref, const char *methodName, const CMPIArgs * in, CMPIArgs * out){ _SFCB_ENTER(TRACE_INDPROVIDER, "IndCIMXMLHandlerInvokeMethod"); CMPIStatus st = { CMPI_RC_OK, NULL }; CMPIStatus circ = { CMPI_RC_OK, NULL }; struct timeval tv; struct timezone tz; static unsigned int indID=1; if (interOpNameSpace(ref, &st) == 0) _SFCB_RETURN(st); if (strcasecmp(methodName, "_deliver") == 0) { // On the first indication, check if reliable indications are enabled. if (RIEnabled == -1) { CMPIObjectPath *op=CMNewObjectPath(_broker,"root/interop","CIM_IndicationService",NULL); CMPIEnumeration *isenm = _broker->bft->enumerateInstances(_broker, ctx, op, NULL, NULL); CMPIData isinst=CMGetNext(isenm,NULL); CMPIData mc=CMGetProperty(isinst.value.inst,"DeliveryRetryAttempts",NULL); RIEnabled=mc.value.uint16; } CMPIInstance *indo=CMGetArg(in,"indication",NULL).value.inst; CMPIInstance *ind=CMClone(indo,NULL); CMPIContext *ctxLocal=NULL; CMPIObjectPath *iop=NULL,*subop=NULL; CMPIInstance *sub=NULL; if (RIEnabled) { ctxLocal = prepareUpcall((CMPIContext *) ctx); // Set the indication sequence values iop=CMGetObjectPath(ind,NULL); CMAddKey(iop,"SFCB_IndicationID",&indID,CMPI_uint32); CMSetProperty(ind,"SFCB_IndicationID",&indID,CMPI_uint32); // Prevent this property from showing up in the indication filterFlagProperty(ind, "SFCB_IndicationID"); sub=CMGetArg(in,"subscription",NULL).value.inst; CMPIData handler=CMGetProperty(sub, "Handler", &st); CMPIObjectPath *hop=handler.value.ref; CMPIInstance *hdlr=CBGetInstance(_broker, ctxLocal, hop, NULL, &st); // Build the complete sequence context // Get the stub from the handler CMPIString *context = CMGetProperty(hdlr, "SequenceContext", &st).value.string; // and add the sfcb start time char *cstr=malloc( (strlen(context->ft->getCharPtr(context,NULL)) + strlen(sfcBrokerStart) + 1) * sizeof(char)); sprintf(cstr,"%s%s",context->ft->getCharPtr(context,NULL),sfcBrokerStart); context = sfcb_native_new_CMPIString(cstr, NULL, 0); // and put it in the indication CMSetProperty(ind, "SequenceContext", &context, CMPI_string); free(cstr); CMRelease(context); // Get the proper sequence number CMPIValue lastseq = CMGetProperty(hdlr, "LastSequenceNumber", &st).value; lastseq.sint64++; // Handle wrapping of the signed int if (lastseq.sint64 < 0) lastseq.sint64=0; // Update the last used number in the handler CMSetProperty(hdlr, "LastSequenceNumber", &lastseq.sint64, CMPI_sint64); CBModifyInstance(_broker, ctxLocal, hop, hdlr, NULL); // And the indication CMSetProperty(ind, "SequenceNumber", &lastseq, CMPI_sint64); } // Now send the indication st = deliverInd(ref, in, ind); if (st.rc != 0) { if (RIEnabled){ _SFCB_TRACE(1,("--- Indication delivery failed, adding to retry queue")); // Indication delivery failed, send to retry queue // build an element RTElement *element; element = (RTElement *) malloc(sizeof(*element)); element->ref=ref->ft->clone(ref,NULL); // Get the OP of the subscription and indication subop=CMGetObjectPath(sub,NULL); element->sub=subop->ft->clone(subop,NULL); element->ind=iop->ft->clone(iop,NULL); // Store other attrs element->instanceID=indID; element->count=0; gettimeofday(&tv, &tz); element->lasttry=tv.tv_sec; // Push the indication to the repo CBCreateInstance(_broker, ctxLocal, iop, ind, &circ); if (circ.rc != 0) { mlogf(M_ERROR,M_SHOW,"Pushing indication instance to repository failed, rc:%d/n",circ.rc); } indID++; // Add it to the retry queue//.........这里部分代码省略.........
开发者ID:pravinmahajan,项目名称:sblim-sfcb,代码行数:101,
示例25: retryExportvoid *retryExport(void *lctx){ _SFCB_ENTER(TRACE_INDPROVIDER, "retryExport"); CMPIObjectPath *ref; CMPIArgs *in; CMPIInstance *sub; CMPIContext *ctx = (CMPIContext *) lctx; CMPIContext *ctxLocal; RTElement *cur, *purge; struct timeval tv; struct timezone tz; int rint, maxcount, ract, rtint; CMPIUint64 sfc = 0; CMPIObjectPath *op; CMPIEnumeration *isenm = NULL; //Setup signal handlers struct sigaction sa; sa.sa_handler = handle_sig_retry; sa.sa_flags = 0; sigemptyset(&sa.sa_mask); sigaction(SIGUSR2, &sa, NULL); CMPIStatus st = { CMPI_RC_OK, NULL }; ctxLocal = prepareUpcall(ctx); // Get the retry params from IndService op = CMNewObjectPath(_broker, "root/interop", "CIM_IndicationService", NULL); isenm = _broker->bft->enumerateInstances(_broker, ctx, op, NULL, NULL); CMPIData isinst = CMGetNext(isenm, NULL); CMPIData mc = CMGetProperty(isinst.value.inst, "DeliveryRetryAttempts", NULL); CMPIData ri = CMGetProperty(isinst.value.inst, "DeliveryRetryInterval", NULL); CMPIData ra = CMGetProperty(isinst.value.inst, "SubscriptionRemovalAction", NULL); CMPIData rti = CMGetProperty(isinst.value.inst, "SubscriptionRemovalTimeInterval", NULL); maxcount = mc.value.uint16; // Number of times to retry delivery rint = ri.value.uint32; // Interval between retries rtint = rti.value.uint32; // Time to allow sub to keep failing until ract = ra.value.uint16; // ... this action is taken // Now, run the queue sleep(5); //Prevent deadlock on startup when localmode is used. pthread_mutex_lock(&RQlock); cur = RQhead; while (RQhead != NULL) { if(retryShutdown) break; // Provider shutdown ref = cur->ref; // Build the CMPIArgs that deliverInd needs CMPIInstance *iinst=internalProviderGetInstance(cur->ind,&st); if (st.rc != 0 ) { mlogf(M_ERROR,M_SHOW,"Failed to retrieve indication instance from repository, rc:%d/n",st.rc); purge=cur; cur=cur->next; dqRetry(ctx,purge); continue; } in=CMNewArgs(_broker,NULL); CMAddArg(in,"indication",&iinst,CMPI_instance); sub=internalProviderGetInstance(cur->sub,&st); if (st.rc == CMPI_RC_ERR_NOT_FOUND) { // sub got deleted, purge this indication and move on _SFCB_TRACE(1,("--- Subscription for indication gone, deleting indication.")); purge = cur; cur = cur->next; dqRetry(ctx,purge); } else { // Still valid, retry gettimeofday(&tv, &tz); if ((cur->lasttry + rint) > tv.tv_sec) { _SFCB_TRACE(1,("--- sleeping.")); // no retries are ready, release the lock // and sleep for an interval, then relock pthread_mutex_unlock(&RQlock); sleep(rint); if(retryShutdown) break; // Provider shutdown pthread_mutex_lock(&RQlock); } st = deliverInd(ref, in, iinst); if ((st.rc == 0) || (cur->count >= maxcount - 1)) { // either it worked, or we maxed out on retries // If it succeeded, clear the failtime if (st.rc == 0) { _SFCB_TRACE(1,("--- Indication succeeded.")); sfc = 0; CMSetProperty(sub, "DeliveryFailureTime", &sfc, CMPI_uint64); CBModifyInstance(_broker, ctxLocal, cur->sub, sub, NULL); } // remove from queue in either case//.........这里部分代码省略.........
开发者ID:pravinmahajan,项目名称:sblim-sfcb,代码行数:101,
示例26: IndCIMXMLHandlerCreateInstanceCMPIStatusIndCIMXMLHandlerCreateInstance(CMPIInstanceMI * mi, const CMPIContext *ctx, const CMPIResult *rslt, const CMPIObjectPath * cop, const CMPIInstance *ci){ CMPIStatus st = { CMPI_RC_OK, NULL }; CMPIArgs *in, *out = NULL; CMPIObjectPath *op; CMPIData rv; unsigned short persistenceType; _SFCB_ENTER(TRACE_INDPROVIDER, "IndCIMXMLHandlerCreateInstance"); if (interOpNameSpace(cop, &st) == 0) _SFCB_RETURN(st); internalProviderGetInstance(cop, &st); if (st.rc == CMPI_RC_ERR_FAILED) _SFCB_RETURN(st); if (st.rc == CMPI_RC_OK) { setStatus(&st, CMPI_RC_ERR_ALREADY_EXISTS, NULL); _SFCB_RETURN(st); } CMPIInstance *ciLocal = CMClone(ci, NULL); memLinkInstance(ciLocal); CMPIObjectPath* copLocal = CMClone(cop, NULL); memLinkObjectPath(copLocal); setCCN(copLocal,ciLocal,"CIM_ComputerSystem"); CMPIString *sysname=ciLocal->ft->getProperty(ciLocal,"SystemName",&st).value.string; if (sysname == NULL || sysname->hdl == NULL) { char hostName[512]; hostName[0]=0; gethostname(hostName,511); /* should be the same as SystemName of IndicationService */ CMAddKey(copLocal, "SystemName", hostName, CMPI_chars); CMSetProperty(ciLocal,"SystemName",hostName,CMPI_chars); } CMPIString *dest = CMGetProperty(ciLocal, "destination", &st).value.string; if (dest == NULL || CMGetCharPtr(dest) == NULL) { setStatus(&st, CMPI_RC_ERR_FAILED, "Destination property not found; is required"); CMRelease(ciLocal); _SFCB_RETURN(st); } else { /* if no scheme is given, assume http (as * req. for param by mof) */ char *ds = CMGetCharPtr(dest); if (strstr(ds, "://") == NULL) { char *prefix = "http://"; int n = strlen(ds) + strlen(prefix) + 1; char *newdest = (char *) malloc(n * sizeof(char)); strcpy(newdest, prefix); strcat(newdest, ds); CMSetProperty(ciLocal, "destination", newdest, CMPI_chars); free(newdest); } } CMPIData persistence = CMGetProperty(ciLocal, "persistencetype", &st); if (persistence.state == CMPI_nullValue || persistence.state == CMPI_notFound) { persistenceType = 2; /* default is 2 = permanent */ } else if (persistence.value.uint16 < 1 || persistence.value.uint16 > 3) { setStatus(&st, CMPI_RC_ERR_FAILED, "PersistenceType property must be 1, 2, or 3"); CMRelease(ciLocal); _SFCB_RETURN(st); } else { persistenceType = persistence.value.uint16; } CMSetProperty(ciLocal, "persistencetype", &persistenceType, CMPI_uint16); if (CMClassPathIsA(_broker, copLocal, "cim_listenerdestination", NULL)) { //get the creation timestamp struct timeval tv; struct timezone tz; char context[100]; gettimeofday(&tv, &tz); struct tm cttm; char * gtime = (char *) malloc(15 * sizeof(char)); memset(gtime, 0, 15 * sizeof(char)); if (gmtime_r(&tv.tv_sec, &cttm) != NULL) { strftime(gtime, 15, "%Y%m%d%H%M%S", &cttm); } // Even though reliable indications may be disabled, we need to do this // in case it ever gets enabled. // Get the IndicationService name CMPIObjectPath * isop = CMNewObjectPath(_broker, "root/interop", "CIM_IndicationService", NULL); CMPIEnumeration * isenm = _broker->bft->enumerateInstances(_broker, ctx, isop, NULL, NULL); CMPIData isinst = CMGetNext(isenm, NULL); CMPIData mc = CMGetProperty(isinst.value.inst, "Name", NULL);//.........这里部分代码省略.........
开发者ID:pravinmahajan,项目名称:sblim-sfcb,代码行数:101,
注:本文中的CMNewObjectPath函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ CMOS_READ函数代码示例 C++ CMICMDBASE_GETOPTION函数代码示例 |