Create an instance of the CIM_IndicationFilter class
CIMClass cimfilter = cc.getClass
(new CIMObjectPath "CIM_IndicationFilter"),
true, true, true, null);
CIMInstance ci = cimfilter.newInstance();
|
Specify the name of the event filter
Name = "filter_all_new_solarisdiskdrive" |
Create a WQL string identifying event indications to return
String filterString = "SELECT *
FROM CIM_InstCreation WHERE sourceInstance
ISA Solaris_DiskDrive";
|
Set property values in the cimfilter instance to identify the following information:
Name of the filter
Filter string to select CIM events
Query language (WQL) to parse the query string
ci.setProperty("Name", new
CIMValue("filter_all_new_solarisdiskdrives"));
ci.setProperty("Query", new CIMValue(filterString));
ci.setProperty("QueryLanguage", new CIMValue("WQL");)
Create a cimfilter instance that is called filter. Store the instance in the CIM Object Manager Repository
CIMObjectPath filter =
cc.createInstance(new CIMObjectPath(),
ci);
|
CIMClass cimfilter = cc.getClass(new CIMObjectPath
("CIM_IndicationFilter"), true);
CIMInstance ci = cimfilter.newInstance();
//Assuming that the test_a class exists in the name space
String filterString = "select * from CIM_InstCreation where
sourceInstance isa test_a"
ci.setProperty("query", new CIMValue(filterString));
CIMObjectPath filter = cc.createInstance(newCIMObjectPath(), ci);