Providers generate indications of CIM events by creating instances of subclasses of the CIM_Indication class.
The following table lists the intrinsic CIM events that a provider should generate.
Table 6–4 CIM Events Indication Classes
Event Class |
Description |
---|---|
CIM_InstCreation |
Notifies when a new instance is created. |
CIM_InstDeletion |
Notifies when an existing instance is deleted. |
CIM_InstModification |
Notifies when an instance is modified. The indication must include a copy of the previous instance whose change generated the indication. |
Implement the EventProvider interface. For example:
public class sampleEventProvider implements InstanceProvider EventProvider{ // Reference for provider to contact the CIM Object Manager private ProviderCIMOMHandle cimom; }
Execute each of the methods listed in Table 6–3 for each instance indication that the provider handles.
Create an indication listed in Table 6–4 for each create, modify, and delete instance event type. For example, in the createInstance method:
public CIMObjectPath createInstance(CIMObjectPath op, CIMInstance ci) throws CIMException { CIMObjectpath newop = ip.createInstance(op, ci); CIMInstance indication = new CIMInstance(); indication.setClassName("CIM_InstCreation"); CIMProperty cp = new CIMProperty(); cp.setName("SourceInstance"); cp.setValue(new CIMValue(ci)); Vector v = new Vector(); v.addElement(cp); indication.setProperties(v); ... }
Deliver the event indication to the CIM Object Manager. For example:
cimom.deliverEvent(op.getNameSpace(), indication); return newop;