@Test @Transactional @JUnitTemporaryDatabase public void testGetDataLinksOnInterface() { List<LinkInterface> dlis = NetworkElementFactory.getInstance(m_appContext).getDataLinksOnInterface(m_dbPopulator.getNode1().getId(), 1); assertEquals(4, dlis.size()); List<LinkInterface> dlis2 = NetworkElementFactory.getInstance(m_appContext).getDataLinksOnInterface(m_dbPopulator.getNode1().getId(), 9); assertEquals(0, dlis2.size()); }
@Override public List<LinkInterface> getDataLinksOnInterface(int nodeId, String ipAddress){ Interface iface = getInterface(nodeId, ipAddress); if (iface != null && Integer.valueOf(iface.getIfIndex()) != null && iface.getIfIndex() > 0) { return getDataLinksOnInterface(nodeId, iface.getIfIndex()); } return new ArrayList<LinkInterface>(); }
NetworkElementFactory implements InitializingBean, NetworkElementFactoryInterface { @Override public List<LinkInterface> getDataLinksOnInterface(int nodeId, String ipAddress){ Interface iface = getInterface(nodeId, ipAddress); if (iface != null && Integer.valueOf(iface.getIfIndex()) != null && iface.getIfIndex() > 0) { return getDataLinksOnInterface(nodeId, iface.getIfIndex()); } return new ArrayList<LinkInterface>(); } }
NetworkElementFactory implements InitializingBean, NetworkElementFactoryInterface { @Override public List<LinkInterface> getDataLinksOnInterface(int nodeId, String ipAddress){ Interface iface = getInterface(nodeId, ipAddress); if (iface != null && Integer.valueOf(iface.getIfIndex()) != null && iface.getIfIndex() > 0) { return getDataLinksOnInterface(nodeId, iface.getIfIndex()); } return new ArrayList<LinkInterface>(); }  }
NetworkElementFactory implements InitializingBean, NetworkElementFactoryInterface { @Override public List<LinkInterface> getDataLinksOnInterface(int nodeId, String ipAddress){ Interface iface = getInterface(nodeId, ipAddress); if (iface != null && Integer.valueOf(iface.getIfIndex()) != null && iface.getIfIndex() > 0) { return getDataLinksOnInterface(nodeId, iface.getIfIndex()); } return new ArrayList<LinkInterface>(); }  static NetworkElementFactoryInterface getInstance(ServletContext servletContext); static NetworkElementFactoryInterface getInstance(ApplicationContext appContext); @Override String getNodeLabel(int nodeId); @Override String getIpPrimaryAddress(int nodeId); @Override OnmsNode getNode(int nodeId); @Override OnmsNode getNode(String  lookupCriteria); @Override List<OnmsNode> getAllNodes(); @Override List<OnmsNode> getNodesLike(String nodeLabel); @Override List<OnmsNode> getNodesWithIpLike(String iplike); @Override List<OnmsNode> getNodesWithService(int serviceId); @Override List<OnmsNode> getNodesWithPhysAddr(String macAddr); @Override List<OnmsNode> getNodesWithPhysAddrAtInterface(String macAddr); @Override List<OnmsNode> getNodesWithPhysAddrFromSnmpInterface(String macAddr); @Override List<OnmsNode> getNodesWithIfAlias(String ifAlias); @Override String getHostname(String ipAddress); @Override Integer getIfIndex(int ipinterfaceid); @Override Integer getIfIndex(int nodeID, String ipaddr); @Override Interface getInterface(int ipInterfaceId); @Override Interface getInterface(int nodeId, String ipAddress); @Override Interface getInterface(int nodeId, String ipAddress, int ifIndex); @Override Interface getSnmpInterface(int nodeId, int ifIndex); @Override Interface[] getInterfacesWithIpAddress(String ipAddress); @Override Interface[] getInterfacesWithIfAlias(int nodeId, String ifAlias); @Override Interface[] getAllInterfacesOnNode(int nodeId); @Override Interface[] getAllSnmpInterfacesOnNode(int nodeId); @Override Interface[] getActiveInterfacesOnNode(int nodeId); @Override Interface[] getAllInterfaces(); @Override Interface[] getAllInterfaces(boolean includeSnmp); @Override Interface[] getAllManagedIpInterfaces(boolean includeSNMP); @Override Service getService(int nodeId, String ipAddress, int serviceId); @Override Service getService(int ifServiceId); @Override Service[] getAllServices(); @Override Service[] getServicesOnInterface(int nodeId, String ipAddress); @Override Service[] getServicesOnInterface(int nodeId, String ipAddress, boolean includeDeletions); @Override Service[] getServicesOnNode(int nodeId); @Override Service[] getServicesOnNode(int nodeId, int serviceId); @Override String getServiceNameFromId(int serviceId); @Override int getServiceIdFromName(String serviceName); @Override Map<Integer, String> getServiceIdToNameMap(); @Override Map<String, Integer> getServiceNameToIdMap(); @Override List<OnmsNode> getNodesLikeAndIpLike(String nodeLabel, String iplike, int serviceId); @Override List<OnmsNode> getNodesLike(String nodeLabel, int serviceId); @Override List<OnmsNode> getNodesWithIpLike(String iplike, int serviceId); @Override List<OnmsNode> getAllNodes(int serviceId); @Override List<OnmsNode> getNodesFromPhysaddr(String AtPhysAddr); @Override AtInterface getAtInterface(int nodeId, String ipAddr); @Override IpRouteInterface[] getIpRoute(int nodeID); @Override boolean isParentNode(int nodeId); @Override boolean isBridgeNode(int nodeID); @Override boolean isRouteInfoNode(int nodeID); @Override Set<Integer> getLinkedNodeIdOnNode(int nodeID); @Override List<LinkInterface> getDataLinksOnNode(int nodeId); @Override List<LinkInterface> getDataLinksOnInterface(int nodeId, String ipAddress); @Override List<LinkInterface> getDataLinksOnInterface(int id); @Override List<LinkInterface> getDataLinksOnInterface(int nodeId, int ifIndex); @Override Vlan[] getVlansOnNode(int nodeID); @Override StpInterface[] getStpInterface(int nodeID); @Override StpInterface[] getStpInterface(int nodeID, int ifindex); @Override StpNode[] getStpNode(int nodeID); @Override List<Integer> getNodeIdsWithIpLike(String iplike); List<OnmsNode> getNodesWithCategories(TransactionTemplate transTemplate, final String[] categories1, final boolean onlyNodesWithDownAggregateStatus); @Override List<OnmsNode> getNodesWithCategories(String[] categories, boolean onlyNodesWithDownAggregateStatus); @Override List<OnmsNode> getNodesWithCategories(TransactionTemplate transTemplate, final String[] categories1, final String[] categories2, final boolean onlyNodesWithDownAggregateStatus); @Override List<OnmsNode> getNodesWithCategories(String[] categories1, String[] categories2, boolean onlyNodesWithDownAggregateStatus); @Override void afterPropertiesSet(); }
NetworkElementFactory implements InitializingBean, NetworkElementFactoryInterface { @Override public List<LinkInterface> getDataLinksOnInterface(int nodeId, String ipAddress){ Interface iface = getInterface(nodeId, ipAddress); if (iface != null && Integer.valueOf(iface.getIfIndex()) != null && iface.getIfIndex() > 0) { return getDataLinksOnInterface(nodeId, iface.getIfIndex()); } return new ArrayList<LinkInterface>(); }  static NetworkElementFactoryInterface getInstance(ServletContext servletContext); static NetworkElementFactoryInterface getInstance(ApplicationContext appContext); @Override String getNodeLabel(int nodeId); @Override String getIpPrimaryAddress(int nodeId); @Override OnmsNode getNode(int nodeId); @Override OnmsNode getNode(String  lookupCriteria); @Override List<OnmsNode> getAllNodes(); @Override List<OnmsNode> getNodesLike(String nodeLabel); @Override List<OnmsNode> getNodesWithIpLike(String iplike); @Override List<OnmsNode> getNodesWithService(int serviceId); @Override List<OnmsNode> getNodesWithPhysAddr(String macAddr); @Override List<OnmsNode> getNodesWithPhysAddrAtInterface(String macAddr); @Override List<OnmsNode> getNodesWithPhysAddrFromSnmpInterface(String macAddr); @Override List<OnmsNode> getNodesWithIfAlias(String ifAlias); @Override String getHostname(String ipAddress); @Override Integer getIfIndex(int ipinterfaceid); @Override Integer getIfIndex(int nodeID, String ipaddr); @Override Interface getInterface(int ipInterfaceId); @Override Interface getInterface(int nodeId, String ipAddress); @Override Interface getInterface(int nodeId, String ipAddress, int ifIndex); @Override Interface getSnmpInterface(int nodeId, int ifIndex); @Override Interface[] getInterfacesWithIpAddress(String ipAddress); @Override Interface[] getInterfacesWithIfAlias(int nodeId, String ifAlias); @Override Interface[] getAllInterfacesOnNode(int nodeId); @Override Interface[] getAllSnmpInterfacesOnNode(int nodeId); @Override Interface[] getActiveInterfacesOnNode(int nodeId); @Override Interface[] getAllInterfaces(); @Override Interface[] getAllInterfaces(boolean includeSnmp); @Override Interface[] getAllManagedIpInterfaces(boolean includeSNMP); @Override Service getService(int nodeId, String ipAddress, int serviceId); @Override Service getService(int ifServiceId); @Override Service[] getAllServices(); @Override Service[] getServicesOnInterface(int nodeId, String ipAddress); @Override Service[] getServicesOnInterface(int nodeId, String ipAddress, boolean includeDeletions); @Override Service[] getServicesOnNode(int nodeId); @Override Service[] getServicesOnNode(int nodeId, int serviceId); @Override String getServiceNameFromId(int serviceId); @Override int getServiceIdFromName(String serviceName); @Override Map<Integer, String> getServiceIdToNameMap(); @Override Map<String, Integer> getServiceNameToIdMap(); @Override List<OnmsNode> getNodesLikeAndIpLike(String nodeLabel, String iplike, int serviceId); @Override List<OnmsNode> getNodesLike(String nodeLabel, int serviceId); @Override List<OnmsNode> getNodesWithIpLike(String iplike, int serviceId); @Override List<OnmsNode> getAllNodes(int serviceId); @Override List<OnmsNode> getNodesFromPhysaddr(String AtPhysAddr); @Override AtInterface getAtInterface(int nodeId, String ipAddr); @Override IpRouteInterface[] getIpRoute(int nodeID); @Override boolean isParentNode(int nodeId); @Override boolean isBridgeNode(int nodeID); @Override boolean isRouteInfoNode(int nodeID); @Override Set<Integer> getLinkedNodeIdOnNode(int nodeID); @Override List<LinkInterface> getDataLinksOnNode(int nodeId); @Override List<LinkInterface> getDataLinksOnInterface(int nodeId, String ipAddress); @Override List<LinkInterface> getDataLinksOnInterface(int id); @Override List<LinkInterface> getDataLinksOnInterface(int nodeId, int ifIndex); @Override Vlan[] getVlansOnNode(int nodeID); @Override StpInterface[] getStpInterface(int nodeID); @Override StpInterface[] getStpInterface(int nodeID, int ifindex); @Override StpNode[] getStpNode(int nodeID); @Override List<Integer> getNodeIdsWithIpLike(String iplike); List<OnmsNode> getNodesWithCategories(TransactionTemplate transTemplate, final String[] categories1, final boolean onlyNodesWithDownAggregateStatus); @Override List<OnmsNode> getNodesWithCategories(String[] categories, boolean onlyNodesWithDownAggregateStatus); @Override List<OnmsNode> getNodesWithCategories(TransactionTemplate transTemplate, final String[] categories1, final String[] categories2, final boolean onlyNodesWithDownAggregateStatus); @Override List<OnmsNode> getNodesWithCategories(String[] categories1, String[] categories2, boolean onlyNodesWithDownAggregateStatus); @Override void afterPropertiesSet();  }