private void addNewServices(List<Event> events) { Collection<OnmsMonitoredService> newServices = getNewServices(); log().debug(getNode().getLabel()+" has "+newServices.size()+" new services."); for (OnmsMonitoredService svc : newServices) { svc.setIpInterface(m_iface); m_iface.getMonitoredServices().add(svc); svc.visit(new AddEventVisitor(events)); } }
svc.setIpInterface(this); getMonitoredServices().add(svc); svc.visit(new AddEventVisitor(eventForwarder));
/** * This method is necessary for CXF to be able to introspect * the type of {@link OnmsNode} parameters. */ public void setNode(OnmsNode node) { OnmsMonitoredService service = getMonitoredService(); if (service == null) { service = new OnmsMonitoredService(); setMonitoredService(service); } OnmsIpInterface intf = service.getIpInterface(); if (intf == null) { intf = new OnmsIpInterface(); service.setIpInterface(intf); } intf.setNode(node); }
private void updateParent(final OnmsMonitoredService svc) { if (svc.getIpInterface() != null && svc.getIpInterface().getId() != null) { final OnmsIpInterface iface = getIpInterfaceDao().get(svc.getIpInterface().getId()); if (iface != null && iface != svc.getIpInterface()) { LOG.debug("merging interface {} into interface {}", svc.getIpInterface(), iface); iface.mergeInterface(svc.getIpInterface(), new NullEventForwarder(), false); svc.setIpInterface(iface); } if (!svc.getIpInterface().getMonitoredServices().contains(svc)) { svc.getIpInterface().addMonitoredService(svc); } } }
private void updateParent(final OnmsMonitoredService svc) { if (svc.getIpInterface() != null && svc.getIpInterface().getId() != null) { final OnmsIpInterface iface = getIpInterfaceDao().get(svc.getIpInterface().getId()); if (iface != null && iface != svc.getIpInterface()) { LOG.debug("merging interface {} into interface {}", svc.getIpInterface(), iface); iface.mergeInterface(svc.getIpInterface(), new NullEventForwarder(), false); svc.setIpInterface(iface); } if (!svc.getIpInterface().getMonitoredServices().contains(svc)) { svc.getIpInterface().addMonitoredService(svc); } } }