|
||||||||||
| 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
JdbcFilterDao class.
| Constructor Summary | |
|---|---|
JdbcFilterDao()
|
|
| Method Summary | |
|---|---|
void |
afterPropertiesSet()
afterPropertiesSet |
DatabaseSchemaConfigFactory |
getDatabaseSchemaConfigFactory()
getDatabaseSchemaConfigFactory |
DataSource |
getDataSource()
getDataSource |
protected String |
getInterfaceWithServiceStatement(String rule)
getInterfaceWithServiceStatement |
List<String> |
getIPList(String rule)
getIPList |
Map<String,Set<String>> |
getIPServiceMap(String rule)
getIPServiceMap |
protected String |
getIPServiceMappingStatement(String rule)
getIPServiceMappingStatement |
NodeDao |
getNodeDao()
getNodeDao |
SortedMap<Integer,String> |
getNodeMap(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. |
protected String |
getNodeMappingStatement(String rule)
getNodeMappingStatement |
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)
isValid |
void |
setDatabaseSchemaConfigFactory(DatabaseSchemaConfigFactory factory)
setDatabaseSchemaConfigFactory |
void |
setDataSource(DataSource dataSource)
setDataSource |
void |
setNodeDao(NodeDao nodeDao)
setNodeDao |
void |
validateRule(String rule)
validateRule |
void |
walkMatchingNodes(String rule,
EntityVisitor visitor)
walkMatchingNodes |
| 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)
setDataSource
dataSource - a DataSource object.public DataSource getDataSource()
getDataSource
DataSource object.public void setDatabaseSchemaConfigFactory(DatabaseSchemaConfigFactory factory)
setDatabaseSchemaConfigFactory
factory - a DatabaseSchemaConfigFactory object.public DatabaseSchemaConfigFactory getDatabaseSchemaConfigFactory()
getDatabaseSchemaConfigFactory
DatabaseSchemaConfigFactory object.public void afterPropertiesSet()
afterPropertiesSet
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanpublic void setNodeDao(NodeDao nodeDao)
setNodeDao
nodeDao - a NodeDao object.public NodeDao getNodeDao()
getNodeDao
NodeDao object.
public void walkMatchingNodes(String rule,
EntityVisitor visitor)
walkMatchingNodes
walkMatchingNodes in interface FilterDaorule - a String object.visitor - a EntityVisitor object.
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
getIPServiceMap in interface FilterDaorule - a String object.
Map object.
FilterParseException - if any.
public List<String> getIPList(String rule)
throws FilterParseException
getIPList
This method returns a list of all ip addresses that match the rule that is passed in.
getIPList in interface FilterDaorule - a String object.
List object.
FilterParseException - if a rule is syntactically incorrect or failed in
executing the SQL statement
public boolean isValid(String addr,
String rule)
throws FilterParseException
isValid
This method verifies if an ip address adheres to a given rule.
isValid in interface FilterDaoaddr - a String object.rule - a String object.
FilterParseException - if a rule is syntactically incorrect or failed in
executing the SQL statement.
public boolean isRuleMatching(String rule)
throws FilterParseException
isRuleMatching in interface FilterDaorule - rule to match on
FilterParseException - if any.
public void validateRule(String rule)
throws FilterParseException
validateRule
validateRule in interface FilterDaorule - a String object.
FilterParseException - if any.
protected String getNodeMappingStatement(String rule)
throws FilterParseException
getNodeMappingStatement
rule - a String object.
String object.
FilterParseException - if any.
protected String getIPServiceMappingStatement(String rule)
throws FilterParseException
getIPServiceMappingStatement
rule - a String object.
String object.
FilterParseException - if any.
protected String getInterfaceWithServiceStatement(String rule)
throws FilterParseException
getInterfaceWithServiceStatement
rule - a String object.
String object.
FilterParseException - if any.
protected String getSQLStatement(String rule)
throws FilterParseException
rule - a String object.
FilterParseException - if any.
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 againstrule - a String object.
String object.
FilterParseException - if any.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||