Once the Indication classes have been defined as described above, it is necessary to create filters which allow particular types of indications to pass through.
Figure 7.7 on page 137 contains an example of the XML that a WBEM client could use to create a CIM_IndicationFilter. It would be useful for you to examine that example closely while reading this section as it shows the properties in an instance of CIM_IndicationFilter.
Figure 8.4 shows part of the mof definition of the CIM_IndicationFilter class (I have omitted many of the properties). The properties of greatest interest are:
Name . This is the name of the filter. Being able to identify a filter allows it to be reused in different contexts.
Query. This is the actual filter which defines whether or not a particular Indication should be passed through or be dropped. The format of the filter depends on the language chosen to express it (see QueryLanguage). An example, using the WQL, might read as follows :
SELECT Temperature, Name FROM TemperatureIndication WHERE Name != "Alison"
to accept all TemperatureIndication indications which do not refer to a toaster with the name "Alison." In particular this filter will extract the Name and Temperature properties for passing to the listener.
QueryLanguage. In principle, the Query Language may be any language comprehensible to the WBEM server. In practice, two languages are commonly used:
Web Query Language (WQL): A dialect of SQL as defined by ANSI with extensions to support CIM. A query in WQL might look like:
select * from Solaris_DiskDrive where Storage_Capacity = 1000
CIM Query Language (CQL): this language is defined by the DMTF in document DSP0202 (Query Specification) and is also based on SQL and XML-Query as defined by W3C, the World Wide Web Consortium.
// ============================== // IndicationFilter // ============================== [Association, Version("2.6.0"), Description ( "CIM_IndicationFilter defines the criteria for generating " "an Indication and what data should be returned in the " "Indication. It is derived from CIM_ManagedElement to " "allow modeling the dependency of the filter on a specific " "service.") ] class CIM_IndicationFilter: CIM_ManagedElement { // Note: many properties deleted [Key, Description ("The name of the filter.") ] string Name; [Required, Description ("A query expression that defines the " "condition(s) under which Indications will be " "generated. For some Indication classes, the query " "expression may also define the instance properties " "to be copied to the CIM_InstIndication's" "SourceInstance and PreviousInstance properties. " "Query language semantics include projection " "(e.g., Select), range (e.g., From) and predicate " "(e.g., Where)."), ModelCorrespondence {"CIM_IndicationFilter.QueryLanguage"} ] string Query; [Required, Description ( "The language in which the query is expressed.") ] string QueryLanguage; };