/** * <p>getIpAddress</p> * * @return a {@link java.lang.String} object. */ @XmlTransient @Transient @JsonIgnore public InetAddress getIpAddress() { return m_ipInterface.getIpAddress(); }
/** * <p>getInetAddress</p> * * @return a {@link java.net.InetAddress} object. */ @Override public final InetAddress getInetAddress() { return getIpInterface().getIpAddress(); }
/** * <p>getInetAddress</p> * * @return a {@link java.net.InetAddress} object. */ @Override public final InetAddress getInetAddress() { return getIpInterface().getIpAddress(); }
@Override protected OnmsIpInterface query() { OnmsIpInterface dbIface = m_ipInterfaceDao.findByNodeIdAndIpAddress(nodeId, str(scannedIface.getIpAddress())); LOG.debug("Updating interface attributes for DB interface {} for node {} with ip {}", dbIface, nodeId, str(scannedIface.getIpAddress())); return dbIface; }
@Transient @JsonIgnore public OnmsIpInterface getInterfaceWithAddress(final InetAddress addr) { if (addr == null) return null; for(final OnmsIpInterface iface : getIpInterfaces()) { if (addr.equals(iface.getIpAddress())) { return iface; } } return null; }
private String getDefaultIp(Vertex vertex, Optional<OnmsNode> node) { if (hasValidIpAddress(vertex)) { return vertex.getIpAddress(); } if (node.isPresent() && node.get().getPrimaryInterface() != null) { return InetAddressUtils.str(node.get().getPrimaryInterface().getIpAddress()); } if (node.isPresent()) { return InetAddressUtils.str(node.get().getIpInterfaces().iterator().next().getIpAddress()); } throw new IllegalStateException("The vertex does not have a ip address or a node assigned."); }
public AvailabilityIpInterface(final OnmsIpInterface iface, final double availability) { m_id = iface.getId(); m_address = str(iface.getIpAddress()); m_availability = availability; }
public AvailabilityIpInterface(final OnmsIpInterface iface, final double availability) { m_id = iface.getId(); m_address = str(iface.getIpAddress()); m_availability = availability; }
public static IpInterfaceTopologyEntity create(OnmsIpInterface ipInterface) { return new IpInterfaceTopologyEntity( ipInterface.getId(), ipInterface.getIpAddress(), ipInterface.getIsManaged(), ipInterface.getIsSnmpPrimary(), Optional.ofNullable(ipInterface.getNode()).map(OnmsNode::getId).orElse(null), Optional.ofNullable(ipInterface.getSnmpInterface()).map(OnmsSnmpInterface::getId).orElse(null)); }
private void onAgentFound(final ContainerTask<?> currentPhase, final OnmsIpInterface primaryIface) { // Make AgentScan a NeedContainer class and have that call run currentPhase.add(createAgentScan(primaryIface.getIpAddress(), "SNMP")); setAgentFound(true); }
/** * <p>createNodeGainedInterfaceEvent</p> * * @param iface a {@link org.opennms.netmgt.model.OnmsIpInterface} object. * @return a {@link org.opennms.netmgt.xml.event.Event} object. */ protected Event createNodeGainedInterfaceEvent(OnmsIpInterface iface) { return EventUtils.createNodeGainedInterfaceEvent(m_eventSource, iface.getNode().getId(), iface.getIpAddress()); }
private void setPathDependency(final OnmsNode node, final OnmsNode parent) { if (node == null) return; OnmsIpInterface critIface = null; if (parent != null) { critIface = parent.getCriticalInterface(); } LOG.info("Setting criticalInterface of node: {} to: {}", node, critIface); node.setPathElement(critIface == null ? null : new PathElement(str(critIface.getIpAddress()), "ICMP")); }
private void setPathDependency(final OnmsNode node, final OnmsNode parent) { if (node == null) return; OnmsIpInterface critIface = null; if (parent != null) { critIface = parent.getCriticalInterface(); } LOG.info("Setting criticalInterface of node: {} to: {}", node, critIface); node.setPathElement(critIface == null ? null : new PathElement(str(critIface.getIpAddress()), "ICMP")); }
private void onAgentFound(final ContainerTask<?> currentPhase, final OnmsIpInterface primaryIface) { // Make AgentScan a NeedContainer class and have that call run currentPhase.add(createAgentScan(primaryIface.getIpAddress(), "SNMP")); setAgentFound(true); }
/** * @return OnmsResource for the <code>distributedStatus</code> resource on the interface or * null if the <code>distributedStatus</code> resource cannot be found for the given IP interface. */ @Override public OnmsResource getResourceForIpInterface(OnmsIpInterface ipInterface, OnmsLocationMonitor locMon) { Assert.notNull(ipInterface, "ipInterface argument must not be null"); Assert.notNull(locMon, "locMon argument must not be null"); Assert.notNull(ipInterface.getNode(), "getNode() on ipInterface must not return null"); final String ipAddress = InetAddressUtils.str(ipInterface.getIpAddress()); final OnmsResource nodeResource = getResourceForNode(ipInterface.getNode()); return getChildResource(nodeResource, DistributedStatusResourceType.TYPE_NAME, DistributedStatusResourceType.getResourceName(locMon.getId(), ipAddress)); }
/** {@inheritDoc} */ public void visitMonitoredService(OnmsMonitoredService monSvc) { OnmsIpInterface iface = monSvc.getIpInterface(); OnmsNode node = iface.getNode(); m_events.add(EventUtils.createNodeGainedServiceEvent("ModelImporter", monSvc.getNodeId().intValue(), iface.getIpAddress(), monSvc.getServiceType().getName(), node.getLabel(), node.getLabelSource(), node.getSysName(), node.getSysDescription())); } }
void updateIpInterface(final BatchTask currentPhase, final OnmsIpInterface iface) { getProvisionService().updateIpInterfaceAttributes(getNodeId(), iface); if (iface.isManaged()) { currentPhase.add(new IpInterfaceScan(getNodeId(), iface.getIpAddress(), getForeignSource(), getLocation(), getProvisionService())); } }
void updateIpInterface(final BatchTask currentPhase, final OnmsIpInterface iface) { getProvisionService().updateIpInterfaceAttributes(getNodeId(), iface); if (iface.isManaged()) { currentPhase.add(new IpInterfaceScan(getNodeId(), iface.getIpAddress(), getForeignSource(), getLocation(), getProvisionService())); } }
private CollectionAgent createAgent(OnmsIpInterface ipIf, OnmsNode node, String location) { final CollectionAgentDTO agent = new CollectionAgentDTO(); agent.setAddress(ipIf.getIpAddress()); agent.setForeignId(node.getForeignId()); agent.setForeignSource(node.getForeignSource()); agent.setNodeId(node.getId()); agent.setNodeLabel(node.getLabel()); agent.setLocationName(location); agent.setStorageResourcePath(DefaultCollectionAgentService.createStorageResourcePath(agent)); agent.setStoreByForeignSource(storeByForeignSource); return agent; }
private CollectionAgent createAgent(OnmsIpInterface ipIf, OnmsNode node, String location) { final CollectionAgentDTO agent = new CollectionAgentDTO(); agent.setAddress(ipIf.getIpAddress()); agent.setForeignId(node.getForeignId()); agent.setForeignSource(node.getForeignSource()); agent.setNodeId(node.getId()); agent.setNodeLabel(node.getLabel()); agent.setLocationName(location); agent.setStorageResourcePath(DefaultCollectionAgentService.createStorageResourcePath(agent)); agent.setStoreByForeignSource(storeByForeignSource); return agent; }