|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opennms.netmgt.filter.Filter
This class is the main entry point for filtering the rules expressions. By creating a Filter object the application can parse a rules expression and get back the list of applicable ip addresses or verify if an ip address adhers to a certain rule.
Field Summary | |
private Start |
m_parseTree
This is the parse tree produced by the parser |
Constructor Summary | |
Filter()
The default constructor. |
|
Filter(java.lang.String rule)
Constructs a new filter with the pre-defined rule as the comparision method. |
Method Summary | |
java.lang.String |
getInterfaceWithServiceStatement()
|
java.util.List |
getIPList(java.lang.String rule)
This method returns a list of all ip addresses that match the rule that is passed in. |
java.util.Map |
getIPServiceMap(java.lang.String rule)
|
java.lang.String |
getIPServiceMappingStatement()
|
java.lang.String |
getSQLStatement()
This method parses a rule and returns the SQL select statement equivalent of the rule. |
java.lang.String |
getSQLStatement(long nodeId,
java.lang.String ipaddr,
java.lang.String service)
|
boolean |
isValid(java.lang.String addr,
java.lang.String rule)
This method verifies if an ip address adhers to a given rule. |
void |
parseRule(java.lang.String rule)
This method is used to parse and valiate a rule into its graph tree. |
void |
validateRule(java.lang.String rule)
This method is used to validate that a rule is syntactically correct. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private Start m_parseTree
Constructor Detail |
public Filter()
public Filter(java.lang.String rule) throws FilterParseException
rule
- The filter rule.
FilterParseException,
- if a rule is syntactically incorrect or failed in
executing the SQL statement.
FilterParseException
Method Detail |
public void parseRule(java.lang.String rule) throws FilterParseException
rule
- The rule to parse.
FilterParseException
- Thrown if the rule cannot be parsed.public boolean isValid(java.lang.String addr, java.lang.String rule) throws FilterParseException
addr
- an octet string ip to be validated against a rule.rule
- an expression rule to be parsed and executed.
FilterParseException
- if a rule is syntactically incorrect or failed in
executing the SQL statement.public java.util.Map getIPServiceMap(java.lang.String rule)
public java.util.List getIPList(java.lang.String rule) throws FilterParseException
rule
- an expression rule to be parsed and executed.
FilterParseException
- if a rule is syntactically incorrect or failed in
executing the SQL statementpublic java.lang.String getSQLStatement()
public java.lang.String getSQLStatement(long nodeId, java.lang.String ipaddr, java.lang.String service)
public java.lang.String getIPServiceMappingStatement()
public java.lang.String getInterfaceWithServiceStatement()
public void validateRule(java.lang.String rule) throws FilterParseException
rule
- The expression rule to validate
FilterParseException
|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |