Package org.opennms.netmgt.config.tester
Class ConfigTesterFilterDao
- java.lang.Object
-
- org.opennms.netmgt.config.tester.ConfigTesterFilterDao
-
-
Constructor Summary
Constructors Constructor Description ConfigTesterFilterDao()
Instantiates a new configuration tester filter DAO.
-
Method Summary
All Methods Instance Methods Concrete 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
public java.util.SortedMap<java.lang.Integer,java.lang.String> getNodeMap(java.lang.String rule) throws FilterParseException
Description copied from interface:FilterDao
This method returns a map of all node IDs and node labels that match the rule that is passed in, sorted by node ID.- Specified by:
getNodeMap
in interfaceFilterDao
- 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
-
getIPAddressServiceMap
public java.util.Map<java.net.InetAddress,java.util.Set<java.lang.String>> getIPAddressServiceMap(java.lang.String rule) throws FilterParseException
Description copied from interface:FilterDao
getIPServiceMap
- Specified by:
getIPAddressServiceMap
in interfaceFilterDao
- Parameters:
rule
- aString
object.- Returns:
- a
Map
object. - Throws:
FilterParseException
- if any.
-
getNodeIPAddressServiceMap
public 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
Description copied from interface:FilterDao
Retrieve a mapping of IP-services scoped by node that match the given rule.- Specified by:
getNodeIPAddressServiceMap
in interfaceFilterDao
- Parameters:
rule
- filter rule to evaluate- Returns:
- map of IP-services
- Throws:
FilterParseException
- if the rule is invalid
-
flushActiveIpAddressListCache
public void flushActiveIpAddressListCache()
- Specified by:
flushActiveIpAddressListCache
in interfaceFilterDao
-
getActiveIPAddressList
public java.util.List<java.net.InetAddress> getActiveIPAddressList(java.lang.String rule) throws FilterParseException
Description copied from interface:FilterDao
Get the (non-deleted) IP addresses that match the specified rule.- Specified by:
getActiveIPAddressList
in interfaceFilterDao
- 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
public java.util.List<java.net.InetAddress> getIPAddressList(java.lang.String rule) throws FilterParseException
Description copied from interface:FilterDao
Get the IP addresses (including deleted) that match the specified rule.- Specified by:
getIPAddressList
in interfaceFilterDao
- 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
public boolean isValid(java.lang.String addr, java.lang.String rule) throws FilterParseException
Description copied from interface:FilterDao
isValid
- Specified by:
isValid
in interfaceFilterDao
- Parameters:
addr
- aString
object.rule
- aString
object.- Returns:
- a boolean.
- Throws:
FilterParseException
- if any.
-
isRuleMatching
public boolean isRuleMatching(java.lang.String rule) throws FilterParseException
Description copied from interface:FilterDao
Does this rule match anything in the database? In particular, does it return at least one record from the database?- Specified by:
isRuleMatching
in interfaceFilterDao
- Parameters:
rule
- rule to match on- Returns:
- true if there is at least one match, false otherwise
- Throws:
FilterParseException
- if any.
-
validateRule
public void validateRule(java.lang.String rule) throws FilterParseException
Description copied from interface:FilterDao
validateRule
- Specified by:
validateRule
in interfaceFilterDao
- Parameters:
rule
- aString
object.- Throws:
FilterParseException
- if any.
-
-