org.opennms.netmgt.dao
Interface FilterDao

All Known Implementing Classes:
JdbcFilterDao

public interface FilterDao

FilterDao interface.

Version:
$Id: $
Author:
DJ Gregor

Method Summary
 List<String> getIPList(String rule)
          getIPList
 Map<String,Set<String>> getIPServiceMap(String rule)
          getIPServiceMap
 SortedMap<Integer,String> getNodeMap(String rule)
          This method returns a map of all node IDs and node labels that match the rule that is passed in, sorted by node ID.
 boolean isRuleMatching(String rule)
          Does this rule match anything in the database? In particular, does it return at least one record from the database?
 boolean isValid(String addr, String rule)
          isValid
 void validateRule(String rule)
          validateRule
 void walkMatchingNodes(String rule, EntityVisitor visitor)
          walkMatchingNodes
 

Method Detail

walkMatchingNodes

void walkMatchingNodes(String rule,
                       EntityVisitor visitor)

walkMatchingNodes

Parameters:
rule - a String object.
visitor - a EntityVisitor object.

getNodeMap

SortedMap<Integer,String> getNodeMap(String rule)
                                     throws FilterParseException
This method returns a map of all node IDs and node labels that match the rule that is passed in, sorted by node ID.

Parameters:
rule - an expression rule to be parsed and executed.
Returns:
SortedMap containing all node IDs and node labels selected by the rule.
Throws:
FilterParseException - if a rule is syntactically incorrect or failed in executing the SQL statement
FilterParseException - if any.

getIPServiceMap

Map<String,Set<String>> getIPServiceMap(String rule)
                                        throws FilterParseException

getIPServiceMap

Parameters:
rule - a String object.
Returns:
a Map object.
Throws:
FilterParseException - if any.

getIPList

List<String> getIPList(String rule)
                       throws FilterParseException

getIPList

Parameters:
rule - a String object.
Returns:
a List object.
Throws:
FilterParseException - if any.

isValid

boolean isValid(String addr,
                String rule)
                throws FilterParseException

isValid

Parameters:
addr - a String object.
rule - a String object.
Returns:
a boolean.
Throws:
FilterParseException - if any.

isRuleMatching

boolean isRuleMatching(String rule)
                       throws FilterParseException
Does this rule match anything in the database? In particular, does it return at least one record from the database?

Parameters:
rule - rule to match on
Returns:
true if there is at least one match, false otherwise
Throws:
FilterParseException - if any.

validateRule

void validateRule(String rule)
                  throws FilterParseException

validateRule

Parameters:
rule - a String object.
Throws:
FilterParseException - if any.


Copyright © 2011. All Rights Reserved.