org.opennms.netmgt.dao
Interface FilterDao

All Known Implementing Classes:
JdbcFilterDao

public interface FilterDao

FilterDao interface.

Version:
$Id: $
Author:
DJ Gregor

Method Summary
 List<InetAddress> getActiveIPAddressList(String rule)
          Get the (non-deleted) IP addresses that match the specified rule.
 List<InetAddress> getIPAddressList(String rule)
          Get the IP addresses (including deleted) that match the specified rule.
 Map<InetAddress,Set<String>> getIPAddressServiceMap(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.

getIPAddressServiceMap

Map<InetAddress,Set<String>> getIPAddressServiceMap(String rule)
                                                    throws FilterParseException

getIPServiceMap

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

getActiveIPAddressList

List<InetAddress> getActiveIPAddressList(String rule)
                                         throws FilterParseException
Get the (non-deleted) IP addresses that match the specified rule.

Parameters:
rule - the filter rule
Returns:
a List of IP addresses.
Throws:
FilterParseException - if a rule is syntactically incorrect or failed in executing the SQL statement.

getIPAddressList

List<InetAddress> getIPAddressList(String rule)
                                   throws FilterParseException
Get the IP addresses (including deleted) that match the specified rule.

Parameters:
rule - the filter rule
Returns:
a List of IP addresses.
Throws:
FilterParseException - if a rule is syntactically incorrect or failed in executing the SQL statement.

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.