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 static Map<Integer,String> serviceId2NameMap
          A mapping of service identifiers (integers) to service names (strings).
protected static 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
static Node[] convertOnmsNodeCollectionToNodeArray(Collection<OnmsNode> ourNodes)
          convertOnmsNodeCollectionToNodeArray
protected  void createServiceIdNameMaps()
           
 Interface[] getActiveInterfacesOnNode(int nodeId)
          getActiveInterfacesOnNode
 DataLinkInterface[] getAllDataLinks()
          getAllDataLinks
 Interface[] getAllInterfaces()
          getAllInterfaces
 Interface[] getAllInterfaces(boolean includeSnmp)
           
 Interface[] getAllInterfacesOnNode(int nodeId)
          getAllInterfacesOnNode
 Interface[] getAllManagedIpInterfaces(boolean includeSNMP)
          getAllManagedIpInterfaces
 Node[] getAllNodes()
          Returns all non-deleted nodes.
 Node[] getAllNodes(int serviceId)
          getAllNodes
 Service[] getAllServices()
          getAllServices
 Interface[] getAllSnmpInterfacesOnNode(int nodeId)
          Returns all snmp interfaces on a node
 AtInterface getAtInterface(int nodeId, String ipAddr)
           
static AtInterface getAtInterface(int nodeID, String ipaddr, javax.servlet.ServletContext servletContext)
          getAtInterface
static AtInterface[] getAtInterfacesFromPhysaddr(String AtPhysAddr)
          getAtInterfacesFromPhysaddr
protected  DataLinkInterface[] getDataLinks(int nodeId)
          getDataLinks
 DataLinkInterface[] getDataLinks(int nodeId, int ifIndex)
          getDataLinks
protected  DataLinkInterface[] getDataLinksFromNodeParent(int parentNodeId)
          getDataLinksFromNodeParent
 DataLinkInterface[] getDataLinksFromNodeParent(int nodeId, int ifIndex)
          getDataLinksFromNodeParent
 DataLinkInterface[] getDataLinksOnInterface(int nodeID, int ifindex)
          getDataLinksOnInterface
 DataLinkInterface[] getDataLinksOnNode(int nodeID)
          getDataLinksOnNode
 String getHostname(String ipAddress)
          Resolve an IP address to a DNS hostname via the database.
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
protected static String getIpAddress(int nodeid)
          getIpAddress
protected static String getIpAddress(int nodeid, int ifindex)
          getIpAddress
 String getIpPrimaryAddress(int nodeId)
          Translate a node id into a human-readable ipaddress.
 IpRouteInterface[] getIpRoute(int nodeId)
           
static IpRouteInterface[] getIpRoute(int nodeID, int ifindex)
          getIpRoute
static IpRouteInterface[] getIpRoute(int nodeID, javax.servlet.ServletContext servletContext)
          getIpRoute
static Set<Integer> getLinkedNodeIdOnNode(int nodeID)
          getLinkedNodeIdOnNode
static Set<Integer> getLinkedNodeIdOnNode(int nodeID, Connection conn)
          getLinkedNodeIdOnNode
static Set<Integer> getLinkedNodeIdOnNodes(Set<Integer> nodeIds, Connection conn)
          getLinkedNodeIdOnNodes
 Node 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)
           
 Node[] getNodesFromPhysaddr(String AtPhysAddr)
          getNodesFromPhysaddr
 Node[] getNodesLike(String nodeLabel)
          Returns all non-deleted nodes that have the given nodeLabel substring somewhere in their nodeLabel.
 Node[] getNodesLike(String nodeLabel, int serviceId)
          getNodesLike
 Node[] getNodesLikeAndIpLike(String nodeLabel, String iplike, int serviceId)
          getNodesLikeAndIpLike
 Node[] getNodesWithCategories(String[] categories, boolean onlyNodesWithDownAggregateStatus)
          getNodesWithCategories
 Node[] getNodesWithCategories(String[] categories1, String[] categories2, boolean onlyNodesWithDownAggregateStatus)
          getNodesWithCategories
 Node[] getNodesWithCategories(org.springframework.transaction.support.TransactionTemplate transTemplate, String[] categories1, boolean onlyNodesWithDownAggregateStatus)
          getNodesWithCategories
 Node[] getNodesWithCategories(org.springframework.transaction.support.TransactionTemplate transTemplate, String[] categories1, String[] categories2, boolean onlyNodesWithDownAggregateStatus)
          getNodesWithCategories
 Node[] getNodesWithIfAlias(String ifAlias)
          Returns all non-deleted nodes that contain the given string in an ifAlias
 Node[] getNodesWithIpLike(String iplike)
           
 Node[] getNodesWithIpLike(String iplike, int serviceId)
          getNodesWithIpLike
 Node[] getNodesWithPhysAddr(String macAddr)
          Returns all non-deleted nodes that have the given mac.
 Node[] getNodesWithPhysAddrAtInterface(String macAddr)
          Returns all non-deleted nodes with a MAC address like the rule given from AtInterface.
 Node[] getNodesWithPhysAddrFromSnmpInterface(String macAddr)
          Returns all non-deleted nodes with a MAC address like the rule given from SnmpInterface.
 Node[] 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.
static StpInterface[] getStpInterface(int nodeID)
          getStpInterface
static StpInterface[] getStpInterface(int nodeID, int ifindex)
          getStpInterface
static StpNode[] getStpNode(int nodeID)
          getStpNode
static Vlan[] getVlansOnNode(int nodeID)
          getVlansOnNode
protected static DataLinkInterface[] invertDataLinkInterface(DataLinkInterface[] nodes)
          invertDataLinkInterface
static boolean isBridgeNode(int nodeID)
          isBridgeNode
 boolean isParentNode(int nodeId)
          isParentNode
static boolean isRouteInfoNode(int nodeID)
          isRouteInfoNode
 boolean nodeHasIfAliases(int nodeId)
          Returns true if node has any snmpIfAliases
protected static AtInterface[] rs2AtInterface(ResultSet rs)
          This method returns the data from the result set as an array of AtInterface objects.
protected static DataLinkInterface[] rs2DataLink(ResultSet rs)
          This method returns the data from the result set as an array of DataLinkInterface objects.
protected static Interface[] rs2Interfaces(ResultSet rs)
          This method returns the data from the result set as an vector of ipinterface objects.
protected static IpRouteInterface[] rs2IpRouteInterface(ResultSet rs)
          This method returns the data from the result set as an array of IpRouteInterface objects.
protected static Node[] rs2Nodes(ResultSet rs)
          This method returns the data from the result set as an array of Node 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.
protected static StpInterface[] rs2StpInterface(ResultSet rs)
          This method returns the data from the result set as an array of StpInterface objects.
protected static StpNode[] rs2StpNode(ResultSet rs)
          This method returns the data from the result set as an array of StpNode objects.
protected static Vlan[] rs2Vlan(ResultSet rs)
          This method returns the data from the result set as an array of StpNode objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serviceName2IdMap

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


serviceId2NameMap

protected static 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
Translate a node id into a human-readable ipaddress. Note these values are not cached.

Specified by:
getIpPrimaryAddress in interface NetworkElementFactoryInterface
Parameters:
nodeId - a int.
Returns:
A human-readable node name or null if the node id given does not specify a real node.

getNode

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

getAllNodes

public Node[] getAllNodes()
Description copied from interface: NetworkElementFactoryInterface
Returns all non-deleted nodes.

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

getNodesLike

public Node[] 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 Node objects.

getNodesWithIpLike

public Node[] getNodesWithIpLike(String iplike)
Specified by:
getNodesWithIpLike in interface NetworkElementFactoryInterface

getNodesWithService

public Node[] 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 Node objects.

getNodesWithPhysAddr

public Node[] 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 Node objects.

getNodesWithPhysAddrAtInterface

public Node[] 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 Node objects.

getNodesWithPhysAddrFromSnmpInterface

public Node[] 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 Node objects.

getNodesWithIfAlias

public Node[] 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.

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

nodeHasIfAliases

public boolean nodeHasIfAliases(int nodeId)
Description copied from interface: NetworkElementFactoryInterface
Returns true if node has any snmpIfAliases

Specified by:
nodeHasIfAliases in interface NetworkElementFactoryInterface
Parameters:
nodeId - a int.
Returns:
boolean true if node has any snmpIfAliases

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.

rs2Nodes

protected static Node[] rs2Nodes(ResultSet rs)
                          throws SQLException
This method returns the data from the result set as an array of Node objects.

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

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 Node[] 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 Node objects.

getNodesLike

public Node[] 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 Node objects.

getNodesWithIpLike

public Node[] 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 Node objects.

getAllNodes

public Node[] getAllNodes(int serviceId)
Description copied from interface: NetworkElementFactoryInterface

getAllNodes

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

getAtInterfacesFromPhysaddr

public static AtInterface[] getAtInterfacesFromPhysaddr(String AtPhysAddr)
                                                 throws SQLException

getAtInterfacesFromPhysaddr

Parameters:
AtPhysAddr - a String object.
Returns:
an array of AtInterface objects.
Throws:
SQLException - if any.

getNodesFromPhysaddr

public Node[] getNodesFromPhysaddr(String AtPhysAddr)
Description copied from interface: NetworkElementFactoryInterface

getNodesFromPhysaddr

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

getAtInterface

public static 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 static IpRouteInterface[] getIpRoute(int nodeID,
                                            javax.servlet.ServletContext servletContext)
                                     throws SQLException

getIpRoute

Parameters:
nodeID - a int.
Returns:
an array of IpRouteInterface objects.
Throws:
SQLException - if any.

getIpRoute

public IpRouteInterface[] getIpRoute(int nodeId)
Specified by:
getIpRoute in interface NetworkElementFactoryInterface

getIpRoute

public static IpRouteInterface[] getIpRoute(int nodeID,
                                            int ifindex)
                                     throws SQLException

getIpRoute

Parameters:
nodeID - a int.
ifindex - 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 static boolean isBridgeNode(int nodeID)
                            throws SQLException

isBridgeNode

Parameters:
nodeID - a int.
Returns:
a boolean.
Throws:
SQLException - if any.

isRouteInfoNode

public static boolean isRouteInfoNode(int nodeID)
                               throws SQLException

isRouteInfoNode

Parameters:
nodeID - a int.
Returns:
a boolean.
Throws:
SQLException - if any.

getDataLinksOnNode

public DataLinkInterface[] getDataLinksOnNode(int nodeID)
Description copied from interface: NetworkElementFactoryInterface

getDataLinksOnNode

Specified by:
getDataLinksOnNode in interface NetworkElementFactoryInterface
Parameters:
nodeID - a int.
Returns:
an array of DataLinkInterface objects.

getLinkedNodeIdOnNode

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

getLinkedNodeIdOnNode

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

getLinkedNodeIdOnNode

public static 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 static 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.

getDataLinks

protected DataLinkInterface[] getDataLinks(int nodeId)

getDataLinks

Parameters:
nodeID - a int.
Returns:
an array of DataLinkInterface objects.

getDataLinksFromNodeParent

protected DataLinkInterface[] getDataLinksFromNodeParent(int parentNodeId)

getDataLinksFromNodeParent

Parameters:
nodeID - a int.
Returns:
an array of DataLinkInterface objects.

getDataLinksOnInterface

public DataLinkInterface[] 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 DataLinkInterface objects.

getDataLinks

public DataLinkInterface[] getDataLinks(int nodeId,
                                        int ifIndex)
Description copied from interface: NetworkElementFactoryInterface

getDataLinks

Specified by:
getDataLinks in interface NetworkElementFactoryInterface
Returns:
an array of DataLinkInterface objects.

getDataLinksFromNodeParent

public DataLinkInterface[] getDataLinksFromNodeParent(int nodeId,
                                                      int ifIndex)
Description copied from interface: NetworkElementFactoryInterface

getDataLinksFromNodeParent

Specified by:
getDataLinksFromNodeParent in interface NetworkElementFactoryInterface
Returns:
an array of DataLinkInterface objects.

getAllDataLinks

public DataLinkInterface[] getAllDataLinks()
Description copied from interface: NetworkElementFactoryInterface

getAllDataLinks

Specified by:
getAllDataLinks in interface NetworkElementFactoryInterface
Returns:
an array of DataLinkInterface objects.

getVlansOnNode

public static Vlan[] getVlansOnNode(int nodeID)
                             throws SQLException

getVlansOnNode

Parameters:
nodeID - a int.
Returns:
an array of Vlan objects.
Throws:
SQLException - if any.

getStpInterface

public static StpInterface[] getStpInterface(int nodeID)
                                      throws SQLException

getStpInterface

Parameters:
nodeID - a int.
Returns:
an array of StpInterface objects.
Throws:
SQLException - if any.

getStpInterface

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

getStpInterface

Parameters:
nodeID - a int.
ifindex - a int.
Returns:
an array of StpInterface objects.
Throws:
SQLException - if any.

getStpNode

public static StpNode[] getStpNode(int nodeID)
                            throws SQLException

getStpNode

Parameters:
nodeID - a int.
Returns:
an array of StpNode objects.
Throws:
SQLException - if any.

rs2AtInterface

protected static AtInterface[] rs2AtInterface(ResultSet rs)
                                       throws SQLException
This method returns the data from the result set as an array of AtInterface objects.

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

rs2IpRouteInterface

protected static IpRouteInterface[] rs2IpRouteInterface(ResultSet rs)
                                                 throws SQLException
This method returns the data from the result set as an array of IpRouteInterface objects.

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

rs2StpInterface

protected static StpInterface[] rs2StpInterface(ResultSet rs)
                                         throws SQLException
This method returns the data from the result set as an array of StpInterface objects.

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

rs2StpNode

protected static StpNode[] rs2StpNode(ResultSet rs)
                               throws SQLException
This method returns the data from the result set as an array of StpNode objects.

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

rs2Vlan

protected static Vlan[] rs2Vlan(ResultSet rs)
                         throws SQLException
This method returns the data from the result set as an array of StpNode objects.

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

rs2DataLink

protected static DataLinkInterface[] rs2DataLink(ResultSet rs)
                                          throws SQLException
This method returns the data from the result set as an array of DataLinkInterface objects.

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

invertDataLinkInterface

protected static DataLinkInterface[] invertDataLinkInterface(DataLinkInterface[] nodes)

invertDataLinkInterface

Parameters:
nodes - an array of DataLinkInterface objects.
Returns:
an array of DataLinkInterface objects.

getIpAddress

protected static String getIpAddress(int nodeid)
                              throws SQLException

getIpAddress

Parameters:
nodeid - a int.
Returns:
a String object.
Throws:
SQLException - if any.

getIpAddress

protected static String getIpAddress(int nodeid,
                                     int ifindex)
                              throws SQLException

getIpAddress

Parameters:
nodeid - a int.
ifindex - a int.
Returns:
a String object.
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 Node[] 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 Node objects.

getNodesWithCategories

public Node[] getNodesWithCategories(String[] categories,
                                     boolean onlyNodesWithDownAggregateStatus)
Description copied from interface: NetworkElementFactoryInterface

getNodesWithCategories

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

getNodesWithCategories

public Node[] 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 Node objects.

getNodesWithCategories

public Node[] 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 Node objects.

convertOnmsNodeCollectionToNodeArray

public static Node[] convertOnmsNodeCollectionToNodeArray(Collection<OnmsNode> ourNodes)

convertOnmsNodeCollectionToNodeArray

Parameters:
ourNodes - a Collection object.
Returns:
an array of Node objects.

afterPropertiesSet

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


Copyright © 2011. All Rights Reserved.