Package org.opennms.netmgt.filter.api
Interface FilterDao
-
- All Known Implementing Classes:
ConfigTesterFilterDao
,JdbcFilterDao
,MockFilterDao
,UnimplementedFilterDao
public interface FilterDao
FilterDao interface.
- Version:
- $Id: $
- Author:
- DJ Gregor
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
flushActiveIpAddressListCache()
java.util.List<java.net.InetAddress>
getActiveIPAddressList(java.lang.String rule)
Get the (non-deleted) IP addresses that match the specified rule.java.util.List<java.net.InetAddress>
getIPAddressList(java.lang.String rule)
Get the IP addresses (including deleted) that match the specified rule.java.util.Map<java.net.InetAddress,java.util.Set<java.lang.String>>
getIPAddressServiceMap(java.lang.String rule)
getIPServiceMapjava.util.Map<java.lang.Integer,java.util.Map<java.net.InetAddress,java.util.Set<java.lang.String>>>
getNodeIPAddressServiceMap(java.lang.String rule)
Retrieve a mapping of IP-services scoped by node that match the given rule.java.util.SortedMap<java.lang.Integer,java.lang.String>
getNodeMap(java.lang.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(java.lang.String rule)
Does this rule match anything in the database? In particular, does it return at least one record from the database?boolean
isValid(java.lang.String addr, java.lang.String rule)
isValidvoid
validateRule(java.lang.String rule)
validateRule
-
-
-
Method Detail
-
getNodeMap
java.util.SortedMap<java.lang.Integer,java.lang.String> getNodeMap(java.lang.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 statementFilterParseException
- if any.
-
getIPAddressServiceMap
java.util.Map<java.net.InetAddress,java.util.Set<java.lang.String>> getIPAddressServiceMap(java.lang.String rule) throws FilterParseException
getIPServiceMap
- Parameters:
rule
- aString
object.- Returns:
- a
Map
object. - Throws:
FilterParseException
- if any.
-
getNodeIPAddressServiceMap
java.util.Map<java.lang.Integer,java.util.Map<java.net.InetAddress,java.util.Set<java.lang.String>>> getNodeIPAddressServiceMap(java.lang.String rule) throws FilterParseException
Retrieve a mapping of IP-services scoped by node that match the given rule.- Parameters:
rule
- filter rule to evaluate- Returns:
- map of IP-services
- Throws:
FilterParseException
- if the rule is invalid
-
flushActiveIpAddressListCache
void flushActiveIpAddressListCache()
-
getActiveIPAddressList
java.util.List<java.net.InetAddress> getActiveIPAddressList(java.lang.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
java.util.List<java.net.InetAddress> getIPAddressList(java.lang.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(java.lang.String addr, java.lang.String rule) throws FilterParseException
isValid
- Parameters:
addr
- aString
object.rule
- aString
object.- Returns:
- a boolean.
- Throws:
FilterParseException
- if any.
-
isRuleMatching
boolean isRuleMatching(java.lang.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(java.lang.String rule) throws FilterParseException
validateRule
- Parameters:
rule
- aString
object.- Throws:
FilterParseException
- if any.
-
-