|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opennms.netmgt.dao.support.JdbcFilterDao
public class JdbcFilterDao
| Constructor Summary | |
|---|---|
JdbcFilterDao()
|
|
| Method Summary | |
|---|---|
void |
afterPropertiesSet()
|
DatabaseSchemaConfigFactory |
getDatabaseSchemaConfigFactory()
|
DataSource |
getDataSource()
|
protected String |
getInterfaceWithServiceStatement(String rule)
|
List<String> |
getIPList(String rule)
This method returns a list of all ip addresses that match the rule that is passed in. |
Map<String,Set<String>> |
getIPServiceMap(String rule)
|
protected String |
getIPServiceMappingStatement(String rule)
|
NodeDao |
getNodeDao()
|
SortedMap<Integer,String> |
getNodeMap(String rule)
This method returns a map of all nodeids and nodelabels that match the rule that is passed in, sorted by nodeid. |
protected String |
getNodeMappingStatement(String rule)
|
protected String |
getSQLStatement(String rule)
This method parses a rule and returns the SQL select statement equivalent of the rule. |
protected String |
getSQLStatement(String rule,
long nodeId,
String ipaddr,
String service)
This method should be called if you want to put constraints on the node, interface or service that is returned in the rule. |
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)
This method verifies if an ip address adheres to a given rule. |
void |
setDatabaseSchemaConfigFactory(DatabaseSchemaConfigFactory factory)
|
void |
setDataSource(DataSource dataSource)
|
void |
setNodeDao(NodeDao nodeDao)
|
void |
validateRule(String rule)
|
void |
walkMatchingNodes(String rule,
EntityVisitor visitor)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JdbcFilterDao()
| Method Detail |
|---|
public void setDataSource(DataSource dataSource)
public DataSource getDataSource()
public void setDatabaseSchemaConfigFactory(DatabaseSchemaConfigFactory factory)
public DatabaseSchemaConfigFactory getDatabaseSchemaConfigFactory()
public void afterPropertiesSet()
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanpublic void setNodeDao(NodeDao nodeDao)
public NodeDao getNodeDao()
public void walkMatchingNodes(String rule,
EntityVisitor visitor)
walkMatchingNodes in interface FilterDao
public SortedMap<Integer,String> getNodeMap(String rule)
throws FilterParseException
getNodeMap in interface FilterDaorule - an expression rule to be parsed and executed.
FilterParseException - if a rule is syntactically incorrect or failed in
executing the SQL statement
public Map<String,Set<String>> getIPServiceMap(String rule)
throws FilterParseException
getIPServiceMap in interface FilterDaoFilterParseException
public List<String> getIPList(String rule)
throws FilterParseException
getIPList in interface FilterDaorule - an expression rule to be parsed and executed.
FilterParseException - if a rule is syntactically incorrect or failed in
executing the SQL statement
public boolean isValid(String addr,
String rule)
throws FilterParseException
isValid in interface FilterDaoaddr - 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 boolean isRuleMatching(String rule)
throws FilterParseException
FilterDao
isRuleMatching in interface FilterDaorule - rule to match on
FilterParseException
public void validateRule(String rule)
throws FilterParseException
validateRule in interface FilterDaoFilterParseException
protected String getNodeMappingStatement(String rule)
throws FilterParseException
FilterParseException
protected String getIPServiceMappingStatement(String rule)
throws FilterParseException
FilterParseException
protected String getInterfaceWithServiceStatement(String rule)
throws FilterParseException
FilterParseException
protected String getSQLStatement(String rule)
throws FilterParseException
FilterParseException
protected String getSQLStatement(String rule,
long nodeId,
String ipaddr,
String service)
throws FilterParseException
nodeId - a node id to constrain againstipaddr - an ipaddress to constrain againstservice - a service name to constrain against
FilterParseException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||