Research Article
Concept Tree-Based Event Matching Algorithm in Publish/Subscribe Systems
Algorithm 6
Event matching algorithm.
| match(e){ | (1) | initial a BitSet sid with a length of subscription number, and set all its elements to be 1 | (2) | for each pair <attribute, value> of e{ | (3) | name = root(attribute); | (4) | ptree = m1.get(name); | (5) | if ptree is not null{ | (6) | sid = treeMatch(ptree, attribute, sid); | (7) | } | (8) | switch(domain(attribute)){ | (9) | case xsd:string: | (10) | sid = stringMatch(name, value, sid); | (11) | break; | (12) | case xsd:decimal: | (13) | sid = gemMatch(name, value, sid); | (14) | break; | (15) | default: | (16) | vtree = m2.get(name); | (17) | if vtree is not null{ | (18) | sid = treeMatch(vtree, value, sid); | (19) | } | (20) | } | (21) | } | (22) | return sid; | | } |
|