private void scheduleNode(final int nodeId, final boolean existing) { OnmsNode node = m_nodeDao.getHierarchy(nodeId); node.visit(new AbstractEntityVisitor() { @Override public void visitMonitoredService(OnmsMonitoredService monSvc) { scheduleInterface(monSvc.getIpInterface(), monSvc.getServiceName(), existing); } }); }
/** {@inheritDoc} */ @Transactional @Override public void updateNode(final OnmsNode node, String rescanExisting) { updateLocation(node); final OnmsNode dbNode = m_nodeDao.getHierarchy(node.getId()); // on an update, leave categories alone, let the NodeScan handle applying requisitioned categories node.setCategories(dbNode.getCategories()); final EventAccumulator accumulator = new EventAccumulator(m_eventForwarder); dbNode.mergeNode(node, accumulator, false); updateNodeHostname(dbNode); m_nodeDao.update(dbNode); m_nodeDao.flush(); accumulator.flush(); final EntityVisitor eventAccumlator = new UpdateEventVisitor(m_eventForwarder, rescanExisting); dbNode.visit(eventAccumlator); }
/** {@inheritDoc} */ @Transactional @Override public void updateNode(final OnmsNode node, String rescanExisting) { updateLocation(node); final OnmsNode dbNode = m_nodeDao.getHierarchy(node.getId()); // on an update, leave categories alone, let the NodeScan handle applying requisitioned categories node.setCategories(dbNode.getCategories()); final EventAccumulator accumulator = new EventAccumulator(m_eventForwarder); dbNode.mergeNode(node, accumulator, false); updateNodeHostname(dbNode); m_nodeDao.update(dbNode); m_nodeDao.flush(); accumulator.flush(); final EntityVisitor eventAccumlator = new UpdateEventVisitor(m_eventForwarder, rescanExisting); dbNode.visit(eventAccumlator); }