void LifecycleIndicationProvider::deleteInstance( const OperationContext & context, const CIMObjectPath & instanceReference, ResponseHandler & handler) { // cout << "LifecycleIndicationProvider::deleteInstance()" << endl; CIMInstance localInstance; // convert a potential fully qualified reference into a local reference // (class name and keys only). CIMObjectPath localReference = CIMObjectPath( String(), CIMNamespaceName(), instanceReference.getClassName(), instanceReference.getKeyBindings()); // begin processing the request handler.processing(); // instance index corresponds to reference index for(Uint32 i = 0, n = _instances.size(); i < n; i++) { if(localReference == _instances[i].getPath()) { localInstance = _instances[i]; // remove instance from the array _instances.remove(i); break; } } // complete processing the request handler.complete(); // If there is at least one subscription active for the lifecycle indication // InstDeletion_for_Sample_LifecycleIndicationProviderClass, then generate // that indication here, embedding the just-deleted instance as the // SourceInstance property. See LifecycleIndicationProviderR.mof. if (_lifecycle_indications_enabled) { CIMInstance indicationInstance( CIMName( "InstDeletion_for_Sample_LifecycleIndicationProviderClass")); CIMObjectPath path; path.setNameSpace("root/SampleProvider"); path.setClassName( "InstDeletion_for_Sample_LifecycleIndicationProviderClass"); indicationInstance.setPath(path); char buffer[32]; sprintf(buffer, "%d", _nextUID++); indicationInstance.addProperty (CIMProperty ("IndicationIdentifier",String(buffer))); CIMDateTime currentDateTime = CIMDateTime::getCurrentDateTime (); indicationInstance.addProperty (CIMProperty ("IndicationTime", currentDateTime)); // Before we send the Lifecycle Indication for the delete of this // instance, change the "lastOp" property value to "deleteInstance". Uint32 ix = localInstance.findProperty(CIMName("lastOp")); if (ix != PEG_NOT_FOUND) { localInstance.removeProperty(ix); localInstance.addProperty( CIMProperty( CIMName("lastOp"), String("deleteInstance"))); } indicationInstance.addProperty (CIMProperty ("SourceInstance",CIMObject(localInstance))); _indication_handler->deliver (indicationInstance); // cout << "LifecycleIndicationProvider::deleteInstance() sent " // "InstDeletion_for_Sample_LifecycleIndicationProviderClass" // << endl; } }