/** * <p>getIpInterfaceByIpAddress</p> * * @param ipAddress a {@link java.lang.String} object. * @return a {@link org.opennms.netmgt.model.OnmsIpInterface} object. */ public OnmsIpInterface getIpInterfaceByIpAddress(String ipAddress) { return getIpInterfaceByIpAddress(InetAddressUtils.getInetAddress(ipAddress)); }
private OnmsIpInterface getIpInterface(int nodeId, String ipAddress) { OnmsNode node = m_nodeDao.load(nodeId); return node.getIpInterfaceByIpAddress(ipAddress); }
@Override public List<OnmsNode> findByForeignSourceAndIpAddress(final String foreignSource, final String ipAddress) { final List<OnmsNode> nodes = new ArrayList<OnmsNode>(); for (final OnmsNode node : findAll()) { if (Objects.equals(foreignSource, node.getForeignSource())) { final OnmsIpInterface iface = node.getIpInterfaceByIpAddress(ipAddress); if (iface != null) nodes.add(node); continue; } } return nodes; }
@Override public List<OnmsNode> findByForeignSourceAndIpAddress(final String foreignSource, final String ipAddress) { final List<OnmsNode> nodes = new ArrayList<OnmsNode>(); for (final OnmsNode node : findAll()) { if (Objects.equals(foreignSource, node.getForeignSource())) { final OnmsIpInterface iface = node.getIpInterfaceByIpAddress(ipAddress); if (iface != null) nodes.add(node); continue; } } return nodes; }
final OnmsIpInterface iface = node.getIpInterfaceByIpAddress(ipAddr);
final OnmsIpInterface iface = node.getIpInterfaceByIpAddress(ipAddr);
OnmsIpInterface ipIf = node.getIpInterfaceByIpAddress(ipAddr); if (ipIf == null) { ipIf = new OnmsIpInterface(ipAddr, node);
OnmsIpInterface ipIf = node.getIpInterfaceByIpAddress(ipAddr); if (ipIf == null) { ipIf = new OnmsIpInterface(ipAddr, node);
OnmsIpInterface ipIf = node.getIpInterfaceByIpAddress(ipAddr); if (ipIf == null) { ipIf = new OnmsIpInterface(ipAddr, node);
OnmsIpInterface ipIf = node.getIpInterfaceByIpAddress(ipAddr); if (ipIf == null) { ipIf = new OnmsIpInterface(ipAddr, node);
assertEquals(PrimaryType.NOT_ELIGIBLE, node1.getIpInterfaceByIpAddress("172.16.0.1").getIsSnmpPrimary()); assertEquals(PrimaryType.NOT_ELIGIBLE, node1.getIpInterfaceByIpAddress("172.17.0.1").getIsSnmpPrimary()); assertEquals(PrimaryType.PRIMARY, node1.getIpInterfaceByIpAddress("192.168.0.10").getIsSnmpPrimary()); assertEquals("custom-location", node1.getLocation().getLocationName()); assertEquals(PrimaryType.PRIMARY, node2.getIpInterfaceByIpAddress("172.16.0.1").getIsSnmpPrimary()); assertEquals(PrimaryType.SECONDARY, node2.getIpInterfaceByIpAddress("172.17.0.1").getIsSnmpPrimary()); assertEquals(PrimaryType.NOT_ELIGIBLE, node2.getIpInterfaceByIpAddress("192.168.0.20").getIsSnmpPrimary()); assertEquals("Default", node2.getLocation().getLocationName());