|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.opennms.bb.common.filter.BBFilter
This class is the main entry point for filtering the rules expressions. By creating a BBFilter 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 DBConnection |
dbConn
This is the connection to the database. |
private SQLConstruct |
sqlStatement
This is the sql statement that is generated from an expression |
static String |
VALID_RULE
This is the constant string indicating if a rule is valid |
Constructor Summary | |
BBFilter()
Default constructor, initializes the database connection variable. |
Method Summary | |
List |
getIPList(String aRule)
This method returns a list of all ip addresses that match the rule that is passed in. |
private String |
getRuleSQL(String aRule)
This method parses a rule and returns the SQL select statement equivalent of the rule. |
String |
getSQLStatement()
This method returns the SQL statement in string form, useful for examining how the expression is parsed and for displaying the statement in GUIs. |
boolean |
isValid(String anIP,
String aRule)
This method verifies if an ip address adhers to a given rule. |
static String |
validateRule(String aRule)
This method is used to validate that a rule is syntactically correct. |
Methods inherited from class java.lang.Object |
|
Field Detail |
public static final String VALID_RULE
private DBConnection dbConn
private SQLConstruct sqlStatement
Constructor Detail |
public BBFilter() throws DBOpenFailureException
DBOpenFailureException,
- on unsuccessful attempt to connect
to the database.Method Detail |
public boolean isValid(String anIP, String aRule) throws FailedParseException
String
- anIP, an octet string ip to be validated against a rule.String
- aRule, an expression rule to be parsed and executed.FailedParseException,
- if a rule is syntactically incorrect or
failed in executing the SQL statement.public List getIPList(String aRule) throws FailedParseException
String
- aRule, an expression rule to be parsed and executed.FailedParseException,
- if a rule is syntactically incorrect or
failed in executing the SQL statement.public String getSQLStatement()
private String getRuleSQL(String aRule) throws FailedParseException
String
- aRule, the rule to be parsedFailedParseException,
- if the rule is syntactically invalidpublic static String validateRule(String aRule)
String
- aRule, the expression rule to validate
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |