Search in sources :

Example 1 with UpdateEventVisitor

use of org.opennms.netmgt.model.events.UpdateEventVisitor in project opennms by OpenNMS.

the class DefaultProvisionService method updateNode.

/**
 * {@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);
}
Also used : OnmsNode(org.opennms.netmgt.model.OnmsNode) AbstractEntityVisitor(org.opennms.netmgt.model.AbstractEntityVisitor) EntityVisitor(org.opennms.netmgt.model.EntityVisitor) UpdateEventVisitor(org.opennms.netmgt.model.events.UpdateEventVisitor) Transactional(org.springframework.transaction.annotation.Transactional)

Aggregations

AbstractEntityVisitor (org.opennms.netmgt.model.AbstractEntityVisitor)1 EntityVisitor (org.opennms.netmgt.model.EntityVisitor)1 OnmsNode (org.opennms.netmgt.model.OnmsNode)1 UpdateEventVisitor (org.opennms.netmgt.model.events.UpdateEventVisitor)1 Transactional (org.springframework.transaction.annotation.Transactional)1