org.opennms.web.element
Class NetworkElementFactory

java.lang.Object
  extended by org.opennms.web.element.NetworkElementFactory
All Implemented Interfaces:
NetworkElementFactoryInterface, org.springframework.beans.factory.InitializingBean

@Transactional(readOnly=true)
public class NetworkElementFactory
extends Object
implements org.springframework.beans.factory.InitializingBean, NetworkElementFactoryInterface

The source for all network element business objects (nodes, interfaces, services). Encapsulates all lookup functionality for the network element business objects in one place. To use this factory to lookup network elements, you must first initialize the Vault with the database connection manager * and JDBC URL it will use. Call the init method to initialize the factory. After that, you can call any lookup methods.

Author:
Larry Karnowski , OpenNMS

Nested Class Summary
static class NetworkElementFactory.InterfaceComparator
           
 
Field Summary
protected  Map<Integer,String> serviceId2NameMap
          A mapping of service identifiers (integers) to service names (strings).
protected  Map<String,Integer> serviceName2IdMap
          A mapping of service names (strings) to service identifiers (integers).
 
Constructor Summary
NetworkElementFactory()
           
 
Method Summary
 void afterPropertiesSet()
           
protected static void augmentInterfacesWithSnmpData(Interface[] intfs, Connection conn)
          augmentInterfacesWithSnmpData
protected  void createServiceIdNameMaps()
           
 Interface[] getActiveInterfacesOnNode(int nodeId)
          getActiveInterfacesOnNode
 Interface[] getAllInterfaces()
          getAllInterfaces
 Interface[] getAllInterfaces(boolean includeSnmp)
           
 Interface[] getAllInterfacesOnNode(int nodeId)
          getAllInterfacesOnNode
 Interface[] getAllManagedIpInterfaces(boolean includeSNMP)
          getAllManagedIpInterfaces
 List<OnmsNode> getAllNodes()
          Returns all non-deleted nodes.
 List<OnmsNode> getAllNodes(int serviceId)
          getAllNodes
 Service[] getAllServices()
          getAllServices
 Interface[] getAllSnmpInterfacesOnNode(int nodeId)
          Returns all SNMP interfaces on a node
 AtInterface getAtInterface(int nodeId, String ipAddr)
           
 AtInterface getAtInterface(int nodeID, String ipaddr, javax.servlet.ServletContext servletContext)
          getAtInterface
 AtInterface getAtInterfaceForOnmsNode(OnmsNode onmsNode, String ipAddr)
           
 List<LinkInterface> getDataLinksOnInterface(int id)
          getDataLinksOnInterface
 List<LinkInterface> getDataLinksOnInterface(int nodeId, int ifIndex)
          getDataLinksOnInterface
 List<LinkInterface> getDataLinksOnInterface(int nodeId, String ipAddress)
          getDataLinksOnInterface
 List<LinkInterface> getDataLinksOnNode(int nodeId)
          getDataLinksOnNode
 String getHostname(String ipAddress)
          Resolve an IP address to a DNS hostname via the database.
 Integer getIfIndex(int ipinterfaceid)
           
 Integer getIfIndex(int nodeID, String ipaddr)
           
static NetworkElementFactoryInterface getInstance(org.springframework.context.ApplicationContext appContext)
           
static NetworkElementFactoryInterface getInstance(javax.servlet.ServletContext servletContext)
           
 Interface getInterface(int ipInterfaceId)
          getInterface
 Interface getInterface(int nodeId, String ipAddress)
          getInterface
 Interface getInterface(int nodeId, String ipAddress, int ifIndex)
          getInterface
 Interface[] getInterfacesWithIfAlias(int nodeId, String ifAlias)
           
 Interface[] getInterfacesWithIpAddress(String ipAddress)
          getInterfacesWithIpAddress
 String getIpPrimaryAddress(int nodeId)
          Find the IP address of the primary SNMP interface.
 IpRouteInterface[] getIpRoute(int nodeID)
          getIpRoute
 Set<Integer> getLinkedNodeIdOnNode(int nodeID)
          getLinkedNodeIdOnNode
 Set<Integer> getLinkedNodeIdOnNode(int nodeID, Connection conn)
          getLinkedNodeIdOnNode
 Set<Integer> getLinkedNodeIdOnNodes(Set<Integer> nodeIds, Connection conn)
          getLinkedNodeIdOnNodes
 OnmsNode getNode(int nodeId)
           
 List<Integer> getNodeIdsWithIpLike(String iplike)
          Returns all non-deleted nodes with an IP address like the rule given.
 String getNodeLabel(int nodeId)
           
 List<OnmsNode> getNodesFromPhysaddr(String AtPhysAddr)
          getNodesFromPhysaddr
 List<OnmsNode> getNodesLike(String nodeLabel)
          Returns all non-deleted nodes that have the given nodeLabel substring somewhere in their nodeLabel.
 List<OnmsNode> getNodesLike(String nodeLabel, int serviceId)
          getNodesLike
 List<OnmsNode> getNodesLikeAndIpLike(String nodeLabel, String iplike, int serviceId)
          getNodesLikeAndIpLike
 List<OnmsNode> getNodesWithCategories(String[] categories, boolean onlyNodesWithDownAggregateStatus)
          getNodesWithCategories
 List<OnmsNode> getNodesWithCategories(String[] categories1, String[] categories2, boolean onlyNodesWithDownAggregateStatus)
          getNodesWithCategories
 List<OnmsNode> getNodesWithCategories(org.springframework.transaction.support.TransactionTemplate transTemplate, String[] categories1, boolean onlyNodesWithDownAggregateStatus)
          getNodesWithCategories
 List<OnmsNode> getNodesWithCategories(org.springframework.transaction.support.TransactionTemplate transTemplate, String[] categories1, String[] categories2, boolean onlyNodesWithDownAggregateStatus)
          getNodesWithCategories
 List<OnmsNode> getNodesWithIfAlias(String ifAlias)
          Returns all non-deleted nodes that contain the given string in an ifAlias
 List<OnmsNode> getNodesWithIpLike(String iplike)
           
 List<OnmsNode> getNodesWithIpLike(String iplike, int serviceId)
          getNodesWithIpLike
 List<OnmsNode> getNodesWithPhysAddr(String macAddr)
          Returns all non-deleted nodes that have the given mac.
 List<OnmsNode> getNodesWithPhysAddrAtInterface(String macAddr)
          Returns all non-deleted nodes with a MAC address like the rule given from AtInterface.
 List<OnmsNode> getNodesWithPhysAddrFromSnmpInterface(String macAddr)
          Returns all non-deleted nodes with a MAC address like the rule given from SnmpInterface.
 List<OnmsNode> getNodesWithService(int serviceId)
          Returns all non-deleted nodes that have the given service.
 Service getService(int ifServiceId)
          Return the service specified by the node identifier, IP address, and service identifier.
 Service getService(int nodeId, String ipAddress, int serviceId)
          Return the service specified by the node identifier, IP address, and service identifier.
 int getServiceIdFromName(String serviceName)
          getServiceIdFromName
 Map<Integer,String> getServiceIdToNameMap()
          getServiceIdToNameMap
 String getServiceNameFromId(int serviceId)
          getServiceNameFromId
 Map<String,Integer> getServiceNameToIdMap()
          getServiceNameToIdMap
 Service[] getServicesOnInterface(int nodeId, String ipAddress)
          getServicesOnInterface
 Service[] getServicesOnInterface(int nodeId, String ipAddress, boolean includeDeletions)
          getServicesOnInterface
 Service[] getServicesOnNode(int nodeId)
          Get the list of all services on a given node.
 Service[] getServicesOnNode(int nodeId, int serviceId)
          Get the list of all instances of a specific service on a given node.
 Interface getSnmpInterface(int nodeId, int ifIndex)
          Get interface from snmpinterface table.
 StpInterface[] getStpInterface(int nodeID)
          getStpInterface
 StpInterface[] getStpInterface(int nodeID, int ifindex)
          getStpInterface
 StpNode[] getStpNode(int nodeID)
          getStpNode
 Vlan[] getVlansOnNode(int nodeID)
          getVlansOnNode
 boolean isBridgeNode(int nodeID)
          isBridgeNode
 boolean isParentNode(int nodeId)
          isParentNode
 boolean isRouteInfoNode(int nodeID)
          isRouteInfoNode
protected static Interface[] rs2Interfaces(ResultSet rs)
          This method returns the data from the result set as an vector of ipinterface objects.
protected static Service[] rs2Services(ResultSet rs)
          rs2Services
protected static Interface[] rs2SnmpInterfaces(ResultSet rs)
          This method returns the data from the result set as an vector of interface objects for non-ip interfaces.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serviceName2IdMap

protected Map<String,Integer> serviceName2IdMap
A mapping of service names (strings) to service identifiers (integers).


serviceId2NameMap

protected Map<Integer,String> serviceId2NameMap
A mapping of service identifiers (integers) to service names (strings).

Constructor Detail

NetworkElementFactory

public NetworkElementFactory()
Method Detail

getInstance

public static NetworkElementFactoryInterface getInstance(javax.servlet.ServletContext servletContext)

getInstance

public static NetworkElementFactoryInterface getInstance(org.springframework.context.ApplicationContext appContext)

getNodeLabel

public String getNodeLabel(int nodeId)
Specified by:
getNodeLabel in interface NetworkElementFactoryInterface

getIpPrimaryAddress

public String getIpPrimaryAddress(int nodeId)
Description copied from interface: NetworkElementFactoryInterface
Find the IP address of the primary SNMP interface.

Specified by:
getIpPrimaryAddress in interface NetworkElementFactoryInterface
Parameters:
nodeId - an int.
Returns:
An IPv4 or IPv6 address in string format or null if the node has no primary SNMP interface

getNode

public OnmsNode getNode(int nodeId)
Specified by:
getNode in interface NetworkElementFactoryInterface

getAllNodes

public List<OnmsNode> getAllNodes()
Description copied from interface: NetworkElementFactoryInterface
Returns all non-deleted nodes.

Specified by:
getAllNodes in interface NetworkElementFactoryInterface
Returns:
an array of OnmsNode objects.

getNodesLike

public List<OnmsNode> getNodesLike(String nodeLabel)
Description copied from interface: NetworkElementFactoryInterface
Returns all non-deleted nodes that have the given nodeLabel substring somewhere in their nodeLabel.

Specified by:
getNodesLike in interface NetworkElementFactoryInterface
Parameters:
nodeLabel - a String object.
Returns:
an array of OnmsNode objects.

getNodesWithIpLike

public List<OnmsNode> getNodesWithIpLike(String iplike)
Specified by:
getNodesWithIpLike in interface NetworkElementFactoryInterface

getNodesWithService

public List<OnmsNode> getNodesWithService(int serviceId)
Description copied from interface: NetworkElementFactoryInterface
Returns all non-deleted nodes that have the given service.

Specified by:
getNodesWithService in interface NetworkElementFactoryInterface
Parameters:
serviceId - a int.
Returns:
an array of OnmsNode objects.

getNodesWithPhysAddr

public List<OnmsNode> getNodesWithPhysAddr(String macAddr)
Description copied from interface: NetworkElementFactoryInterface
Returns all non-deleted nodes that have the given mac.

Specified by:
getNodesWithPhysAddr in interface NetworkElementFactoryInterface
Parameters:
macAddr - a String object.
Returns:
an array of OnmsNode objects.

getNodesWithPhysAddrAtInterface

public List<OnmsNode> getNodesWithPhysAddrAtInterface(String macAddr)
Description copied from interface: NetworkElementFactoryInterface
Returns all non-deleted nodes with a MAC address like the rule given from AtInterface.

Specified by:
getNodesWithPhysAddrAtInterface in interface NetworkElementFactoryInterface
Parameters:
macAddr - a String object.
Returns:
an array of OnmsNode objects.

getNodesWithPhysAddrFromSnmpInterface

public List<OnmsNode> getNodesWithPhysAddrFromSnmpInterface(String macAddr)
Description copied from interface: NetworkElementFactoryInterface
Returns all non-deleted nodes with a MAC address like the rule given from SnmpInterface.

Specified by:
getNodesWithPhysAddrFromSnmpInterface in interface NetworkElementFactoryInterface
Parameters:
macAddr - a String object.
Returns:
an array of OnmsNode objects.

getNodesWithIfAlias

public List<OnmsNode> getNodesWithIfAlias(String ifAlias)
Description copied from interface: NetworkElementFactoryInterface
Returns all non-deleted nodes that contain the given string in an ifAlias

Specified by:
getNodesWithIfAlias in interface NetworkElementFactoryInterface
Parameters:
ifAlias - a String object.
Returns:
nodes the nodes with a matching ifAlias on one or more interfaces

getHostname

public String getHostname(String ipAddress)
Description copied from interface: NetworkElementFactoryInterface
Resolve an IP address to a DNS hostname via the database. If no hostname can be found, the given IP address is returned.

Specified by:
getHostname in interface NetworkElementFactoryInterface
Parameters:
ipAddress - a String object.
Returns:
a String object.

getIfIndex

public Integer getIfIndex(int ipinterfaceid)
Specified by:
getIfIndex in interface NetworkElementFactoryInterface

getIfIndex

public Integer getIfIndex(int nodeID,
                          String ipaddr)
Specified by:
getIfIndex in interface NetworkElementFactoryInterface

getInterface

public Interface getInterface(int ipInterfaceId)
Description copied from interface: NetworkElementFactoryInterface

getInterface

Specified by:
getInterface in interface NetworkElementFactoryInterface
Parameters:
ipInterfaceId - a int.
Returns:
a Interface object.

getInterface

public Interface getInterface(int nodeId,
                              String ipAddress)
Description copied from interface: NetworkElementFactoryInterface

getInterface

Specified by:
getInterface in interface NetworkElementFactoryInterface
Parameters:
nodeId - a int.
ipAddress - a String object.
Returns:
a Interface object.

getInterface

public Interface getInterface(int nodeId,
                              String ipAddress,
                              int ifIndex)
Description copied from interface: NetworkElementFactoryInterface

getInterface

Specified by:
getInterface in interface NetworkElementFactoryInterface
Parameters:
nodeId - a int.
ipAddress - a String object.
Returns:
a Interface object.

getSnmpInterface

public Interface getSnmpInterface(int nodeId,
                                  int ifIndex)
Description copied from interface: NetworkElementFactoryInterface
Get interface from snmpinterface table. Intended for use with non-ip interfaces.

Specified by:
getSnmpInterface in interface NetworkElementFactoryInterface
Parameters:
nodeId - a int.
ifIndex - a int.
Returns:
Interface

getInterfacesWithIpAddress

public Interface[] getInterfacesWithIpAddress(String ipAddress)
Description copied from interface: NetworkElementFactoryInterface

getInterfacesWithIpAddress

Specified by:
getInterfacesWithIpAddress in interface NetworkElementFactoryInterface
Parameters:
ipAddress - a String object.
Returns:
an array of Interface objects.

getInterfacesWithIfAlias

public Interface[] getInterfacesWithIfAlias(int nodeId,
                                            String ifAlias)
Specified by:
getInterfacesWithIfAlias in interface NetworkElementFactoryInterface

getAllInterfacesOnNode

public Interface[] getAllInterfacesOnNode(int nodeId)
Description copied from interface: NetworkElementFactoryInterface

getAllInterfacesOnNode

Specified by:
getAllInterfacesOnNode in interface NetworkElementFactoryInterface
Parameters:
nodeId - a int.
Returns:
an array of Interface objects.

getAllSnmpInterfacesOnNode

public Interface[] getAllSnmpInterfacesOnNode(int nodeId)
Description copied from interface: NetworkElementFactoryInterface
Returns all SNMP interfaces on a node

Specified by:
getAllSnmpInterfacesOnNode in interface NetworkElementFactoryInterface
Parameters:
nodeId - a int.
Returns:
Interface[]

getActiveInterfacesOnNode

public Interface[] getActiveInterfacesOnNode(int nodeId)
Description copied from interface: NetworkElementFactoryInterface

getActiveInterfacesOnNode

Specified by:
getActiveInterfacesOnNode in interface NetworkElementFactoryInterface
Parameters:
nodeId - a int.
Returns:
an array of Interface objects.

getAllInterfaces

public Interface[] getAllInterfaces()
Description copied from interface: NetworkElementFactoryInterface

getAllInterfaces

Specified by:
getAllInterfaces in interface NetworkElementFactoryInterface
Returns:
an array of Interface objects.

getAllInterfaces

public Interface[] getAllInterfaces(boolean includeSnmp)
Specified by:
getAllInterfaces in interface NetworkElementFactoryInterface

getAllManagedIpInterfaces

public Interface[] getAllManagedIpInterfaces(boolean includeSNMP)
Description copied from interface: NetworkElementFactoryInterface

getAllManagedIpInterfaces

Specified by:
getAllManagedIpInterfaces in interface NetworkElementFactoryInterface
Parameters:
includeSNMP - a boolean.
Returns:
an array of Interface objects.

getService

public Service getService(int nodeId,
                          String ipAddress,
                          int serviceId)
Description copied from interface: NetworkElementFactoryInterface
Return the service specified by the node identifier, IP address, and service identifier.

Note that if there are both an active service and historically deleted services with this (nodeid, ipAddress, serviceId) key, then the active service will be returned. If there are only deleted services, then the first deleted service will be returned.

Specified by:
getService in interface NetworkElementFactoryInterface
Parameters:
nodeId - a int.
ipAddress - a String object.
serviceId - a int.
Returns:
a Service object.

getService

public Service getService(int ifServiceId)
Description copied from interface: NetworkElementFactoryInterface
Return the service specified by the node identifier, IP address, and service identifier.

Note that if there are both an active service and historically deleted services with this (nodeid, ipAddress, serviceId) key, then the active service will be returned. If there are only deleted services, then the first deleted service will be returned.

Specified by:
getService in interface NetworkElementFactoryInterface
Parameters:
ifServiceId - a int.
Returns:
a Service object.

getAllServices

public Service[] getAllServices()
Description copied from interface: NetworkElementFactoryInterface

getAllServices

Specified by:
getAllServices in interface NetworkElementFactoryInterface
Returns:
an array of Service objects.

getServicesOnInterface

public Service[] getServicesOnInterface(int nodeId,
                                        String ipAddress)
Description copied from interface: NetworkElementFactoryInterface

getServicesOnInterface

Specified by:
getServicesOnInterface in interface NetworkElementFactoryInterface
Parameters:
nodeId - a int.
ipAddress - a String object.
Returns:
an array of Service objects.

getServicesOnInterface

public Service[] getServicesOnInterface(int nodeId,
                                        String ipAddress,
                                        boolean includeDeletions)
Description copied from interface: NetworkElementFactoryInterface

getServicesOnInterface

Specified by:
getServicesOnInterface in interface NetworkElementFactoryInterface
Parameters:
nodeId - a int.
ipAddress - a String object.
includeDeletions - a boolean.
Returns:
an array of Service objects.

getServicesOnNode

public Service[] getServicesOnNode(int nodeId)
Description copied from interface: NetworkElementFactoryInterface
Get the list of all services on a given node.

Specified by:
getServicesOnNode in interface NetworkElementFactoryInterface
Parameters:
nodeId - a int.
Returns:
an array of Service objects.

getServicesOnNode

public Service[] getServicesOnNode(int nodeId,
                                   int serviceId)
Description copied from interface: NetworkElementFactoryInterface
Get the list of all instances of a specific service on a given node.

Specified by:
getServicesOnNode in interface NetworkElementFactoryInterface
Parameters:
nodeId - a int.
serviceId - a int.
Returns:
an array of Service objects.

getAtInterfaceForOnmsNode

public AtInterface getAtInterfaceForOnmsNode(OnmsNode onmsNode,
                                             String ipAddr)

rs2Interfaces

protected static Interface[] rs2Interfaces(ResultSet rs)
                                    throws SQLException
This method returns the data from the result set as an vector of ipinterface objects.

Parameters:
rs - a ResultSet object.
Returns:
an array of Interface objects.
Throws:
SQLException - if any.

rs2SnmpInterfaces

protected static Interface[] rs2SnmpInterfaces(ResultSet rs)
                                        throws SQLException
This method returns the data from the result set as an vector of interface objects for non-ip interfaces.

Parameters:
rs - a ResultSet object.
Returns:
Interface[]
Throws:
SQLException - if any.

augmentInterfacesWithSnmpData

protected static void augmentInterfacesWithSnmpData(Interface[] intfs,
                                                    Connection conn)
                                             throws SQLException

augmentInterfacesWithSnmpData

Parameters:
intfs - an array of Interface objects.
conn - a Connection object.
Throws:
SQLException - if any.

rs2Services

protected static Service[] rs2Services(ResultSet rs)
                                throws SQLException

rs2Services

Parameters:
rs - a ResultSet object.
Returns:
an array of Service objects.
Throws:
SQLException - if any.

getServiceNameFromId

public String getServiceNameFromId(int serviceId)
Description copied from interface: NetworkElementFactoryInterface

getServiceNameFromId

Specified by:
getServiceNameFromId in interface NetworkElementFactoryInterface
Parameters:
serviceId - a int.
Returns:
a String object.

getServiceIdFromName

public int getServiceIdFromName(String serviceName)
Description copied from interface: NetworkElementFactoryInterface

getServiceIdFromName

Specified by:
getServiceIdFromName in interface NetworkElementFactoryInterface
Parameters:
serviceName - a String object.
Returns:
a int.

getServiceIdToNameMap

public Map<Integer,String> getServiceIdToNameMap()
Description copied from interface: NetworkElementFactoryInterface

getServiceIdToNameMap

Specified by:
getServiceIdToNameMap in interface NetworkElementFactoryInterface
Returns:
a java$util$Map object.

getServiceNameToIdMap

public Map<String,Integer> getServiceNameToIdMap()
Description copied from interface: NetworkElementFactoryInterface

getServiceNameToIdMap

Specified by:
getServiceNameToIdMap in interface NetworkElementFactoryInterface
Returns:
a java$util$Map object.

createServiceIdNameMaps

protected void createServiceIdNameMaps()

getNodesLikeAndIpLike

public List<OnmsNode> getNodesLikeAndIpLike(String nodeLabel,
                                            String iplike,
                                            int serviceId)
Description copied from interface: NetworkElementFactoryInterface

getNodesLikeAndIpLike

Specified by:
getNodesLikeAndIpLike in interface NetworkElementFactoryInterface
Parameters:
nodeLabel - a String object.
iplike - a String object.
serviceId - a int.
Returns:
an array of OnmsNode objects.

getNodesLike

public List<OnmsNode> getNodesLike(String nodeLabel,
                                   int serviceId)
Description copied from interface: NetworkElementFactoryInterface

getNodesLike

Specified by:
getNodesLike in interface NetworkElementFactoryInterface
Parameters:
nodeLabel - a String object.
serviceId - a int.
Returns:
an array of OnmsNode objects.

getNodesWithIpLike

public List<OnmsNode> getNodesWithIpLike(String iplike,
                                         int serviceId)
Description copied from interface: NetworkElementFactoryInterface

getNodesWithIpLike

Specified by:
getNodesWithIpLike in interface NetworkElementFactoryInterface
Parameters:
iplike - a String object.
serviceId - a int.
Returns:
an array of OnmsNode objects.

getAllNodes

public List<OnmsNode> getAllNodes(int serviceId)
Description copied from interface: NetworkElementFactoryInterface

getAllNodes

Specified by:
getAllNodes in interface NetworkElementFactoryInterface
Parameters:
serviceId - a int.
Returns:
an array of OnmsNode objects.

getNodesFromPhysaddr

public List<OnmsNode> getNodesFromPhysaddr(String AtPhysAddr)
Description copied from interface: NetworkElementFactoryInterface

getNodesFromPhysaddr

Specified by:
getNodesFromPhysaddr in interface NetworkElementFactoryInterface
Parameters:
AtPhysAddr - a String object.
Returns:
an array of OnmsNode objects.

getAtInterface

public AtInterface getAtInterface(int nodeID,
                                  String ipaddr,
                                  javax.servlet.ServletContext servletContext)
                           throws SQLException

getAtInterface

Parameters:
nodeID - a int.
ipaddr - a String object.
Returns:
a AtInterface object.
Throws:
SQLException - if any.

getAtInterface

public AtInterface getAtInterface(int nodeId,
                                  String ipAddr)
Specified by:
getAtInterface in interface NetworkElementFactoryInterface

getIpRoute

public IpRouteInterface[] getIpRoute(int nodeID)

getIpRoute

Specified by:
getIpRoute in interface NetworkElementFactoryInterface
Parameters:
nodeID - a int.
Returns:
an array of IpRouteInterface objects.
Throws:
SQLException - if any.

isParentNode

public boolean isParentNode(int nodeId)
Description copied from interface: NetworkElementFactoryInterface

isParentNode

Specified by:
isParentNode in interface NetworkElementFactoryInterface
Returns:
a boolean.

isBridgeNode

public boolean isBridgeNode(int nodeID)
                     throws SQLException

isBridgeNode

Specified by:
isBridgeNode in interface NetworkElementFactoryInterface
Parameters:
nodeID - a int.
Returns:
a boolean.
Throws:
SQLException - if any.

isRouteInfoNode

public boolean isRouteInfoNode(int nodeID)
                        throws SQLException

isRouteInfoNode

Specified by:
isRouteInfoNode in interface NetworkElementFactoryInterface
Parameters:
nodeID - a int.
Returns:
a boolean.
Throws:
SQLException - if any.

getLinkedNodeIdOnNode

public Set<Integer> getLinkedNodeIdOnNode(int nodeID)
                                   throws SQLException

getLinkedNodeIdOnNode

Specified by:
getLinkedNodeIdOnNode in interface NetworkElementFactoryInterface
Parameters:
nodeID - a int.
Returns:
a Set object.
Throws:
SQLException - if any.

getLinkedNodeIdOnNode

public Set<Integer> getLinkedNodeIdOnNode(int nodeID,
                                          Connection conn)
                                   throws SQLException

getLinkedNodeIdOnNode

Parameters:
nodeID - a int.
conn - a Connection object.
Returns:
a Set object.
Throws:
SQLException - if any.

getLinkedNodeIdOnNodes

public Set<Integer> getLinkedNodeIdOnNodes(Set<Integer> nodeIds,
                                           Connection conn)
                                    throws SQLException

getLinkedNodeIdOnNodes

Parameters:
nodeIds - a Set object.
conn - a Connection object.
Returns:
a Set object.
Throws:
SQLException - if any.

getDataLinksOnNode

public List<LinkInterface> getDataLinksOnNode(int nodeId)
Description copied from interface: NetworkElementFactoryInterface

getDataLinksOnNode

Specified by:
getDataLinksOnNode in interface NetworkElementFactoryInterface
Parameters:
nodeId - a int.
Returns:
an list of LinkInterface objects.

getDataLinksOnInterface

public List<LinkInterface> getDataLinksOnInterface(int nodeId,
                                                   String ipAddress)
Description copied from interface: NetworkElementFactoryInterface

getDataLinksOnInterface

Specified by:
getDataLinksOnInterface in interface NetworkElementFactoryInterface
Parameters:
nodeId - a int.
ipAddress - a String.
Returns:
an array of LinkInterface objects.

getDataLinksOnInterface

public List<LinkInterface> getDataLinksOnInterface(int id)
Description copied from interface: NetworkElementFactoryInterface

getDataLinksOnInterface

Specified by:
getDataLinksOnInterface in interface NetworkElementFactoryInterface
Returns:
an array of LinkInterface objects.

getDataLinksOnInterface

public List<LinkInterface> getDataLinksOnInterface(int nodeId,
                                                   int ifIndex)
Description copied from interface: NetworkElementFactoryInterface

getDataLinksOnInterface

Specified by:
getDataLinksOnInterface in interface NetworkElementFactoryInterface
Parameters:
nodeId - a int.
ifIndex - a int.
Returns:
an array of LinkInterface objects.

getVlansOnNode

public Vlan[] getVlansOnNode(int nodeID)
                      throws SQLException

getVlansOnNode

Specified by:
getVlansOnNode in interface NetworkElementFactoryInterface
Parameters:
nodeID - a int.
Returns:
an array of Vlan objects.
Throws:
SQLException - if any.

getStpInterface

public StpInterface[] getStpInterface(int nodeID)
                               throws SQLException

getStpInterface

Specified by:
getStpInterface in interface NetworkElementFactoryInterface
Parameters:
nodeID - a int.
Returns:
an array of StpInterface objects.
Throws:
SQLException - if any.

getStpInterface

public StpInterface[] getStpInterface(int nodeID,
                                      int ifindex)
                               throws SQLException

getStpInterface

Specified by:
getStpInterface in interface NetworkElementFactoryInterface
Parameters:
nodeID - a int.
ifindex - a int.
Returns:
an array of StpInterface objects.
Throws:
SQLException - if any.

getStpNode

public StpNode[] getStpNode(int nodeID)
                     throws SQLException

getStpNode

Specified by:
getStpNode in interface NetworkElementFactoryInterface
Parameters:
nodeID - a int.
Returns:
an array of StpNode objects.
Throws:
SQLException - if any.

getNodeIdsWithIpLike

public List<Integer> getNodeIdsWithIpLike(String iplike)
Description copied from interface: NetworkElementFactoryInterface
Returns all non-deleted nodes with an IP address like the rule given.

Specified by:
getNodeIdsWithIpLike in interface NetworkElementFactoryInterface
Parameters:
iplike - a String object.
Returns:
a List object.

getNodesWithCategories

public List<OnmsNode> getNodesWithCategories(org.springframework.transaction.support.TransactionTemplate transTemplate,
                                             String[] categories1,
                                             boolean onlyNodesWithDownAggregateStatus)
Description copied from interface: NetworkElementFactoryInterface

getNodesWithCategories

Specified by:
getNodesWithCategories in interface NetworkElementFactoryInterface
Parameters:
transTemplate - a TransactionTemplate object.
categories1 - an array of String objects.
onlyNodesWithDownAggregateStatus - a boolean.
Returns:
an array of OnmsNode objects.

getNodesWithCategories

public List<OnmsNode> getNodesWithCategories(String[] categories,
                                             boolean onlyNodesWithDownAggregateStatus)
Description copied from interface: NetworkElementFactoryInterface

getNodesWithCategories

Specified by:
getNodesWithCategories in interface NetworkElementFactoryInterface
onlyNodesWithDownAggregateStatus - a boolean.
Returns:
an array of OnmsNode objects.

getNodesWithCategories

public List<OnmsNode> getNodesWithCategories(org.springframework.transaction.support.TransactionTemplate transTemplate,
                                             String[] categories1,
                                             String[] categories2,
                                             boolean onlyNodesWithDownAggregateStatus)
Description copied from interface: NetworkElementFactoryInterface

getNodesWithCategories

Specified by:
getNodesWithCategories in interface NetworkElementFactoryInterface
Parameters:
transTemplate - a TransactionTemplate object.
categories1 - an array of String objects.
categories2 - an array of String objects.
onlyNodesWithDownAggregateStatus - a boolean.
Returns:
an array of OnmsNode objects.

getNodesWithCategories

public List<OnmsNode> getNodesWithCategories(String[] categories1,
                                             String[] categories2,
                                             boolean onlyNodesWithDownAggregateStatus)
Description copied from interface: NetworkElementFactoryInterface

getNodesWithCategories

Specified by:
getNodesWithCategories in interface NetworkElementFactoryInterface
Parameters:
categories1 - an array of String objects.
categories2 - an array of String objects.
onlyNodesWithDownAggregateStatus - a boolean.
Returns:
an array of OnmsNode objects.

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
Exception


Copyright © 2011. All Rights Reserved.