On Nov 9, 2011, at 7:32 PM, Mike Huot wrote:

> Anyone know why we have catinc in filters rather than making categoryName == 
> 'blah1' & categoryName == 'blah2' work correctly? I tried chasing down 
> catinc's origins, but I could track it down(best I found was Tarus did it). I 
> have not used filters with categories until recently and stumbled across 
> this, umm, oddity. Just wondering if this is something that should be 
> addressed or is working as others would expect.

Well, catinc was my attempt at making categoryName == 'blah1' & categoryName == 
'blah2' work correctly. The filters would only examine one row in the database 
at a time, so if a node was in category 'blah1' and 'blah2' the original filter 
code could never work since there is no way for a single row to equal both 
'blah1' and 'blah2'.

Since this was the same situation with services and the "is[ServiceName]" 
operator, I basically cloned that behavior to scan all matching category rows 
and performing logic on all matches, thus it was possible for the filter to 
know that a particular device was in both categories, or to use the not 
operator, etc. This wasn't possible with straight equality.

Make sense?

If there is some logical way of making it work differently I'm all for it, but 
I'm curious to know how you would fix it.

-T

_______________________________________________________________________
Tarus BALOG, OpenNMS Maintainer             Main:   +1 919 533 0160
The OpenNMS Group, Inc.                     Fax:    +1 773 345 3645
Email: ta...@opennms.org                    URL: http://www.opennms.org
PGP Key Fingerprint: 8945 8521 9771 FEC9 5481  512B FECA 11D2 FD82 B45C



------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Please read the OpenNMS Mailing List FAQ:
http://www.opennms.org/index.php/Mailing_List_FAQ

opennms-devel mailing list

To *unsubscribe* or change your subscription options, see the bottom of this 
page:
https://lists.sourceforge.net/lists/listinfo/opennms-devel

Reply via email to