use of org.springframework.transaction.annotation.Transactional in project opennms by OpenNMS.
the class EnhancedLinkdServiceImpl method store.
@Override
@Transactional
public void store(int nodeId, OspfElement element) {
if (element == null)
return;
final OnmsNode node = m_nodeDao.get(nodeId);
if (node == null)
return;
OspfElement dbelement = node.getOspfElement();
if (dbelement != null) {
dbelement.merge(element);
node.setOspfElement(dbelement);
} else {
element.setNode(node);
element.setOspfNodeLastPollTime(element.getOspfNodeCreateTime());
node.setOspfElement(element);
}
m_nodeDao.saveOrUpdate(node);
m_nodeDao.flush();
}
use of org.springframework.transaction.annotation.Transactional in project opennms by OpenNMS.
the class EnhancedLinkdServiceImpl method store.
@Override
@Transactional
public void store(int nodeId, IsIsElement element) {
if (element == null)
return;
final OnmsNode node = m_nodeDao.get(nodeId);
if (node == null)
return;
IsIsElement dbelement = node.getIsisElement();
if (dbelement != null) {
dbelement.merge(element);
node.setIsisElement(dbelement);
} else {
element.setNode(node);
element.setIsisNodeLastPollTime(element.getIsisNodeCreateTime());
node.setIsisElement(element);
}
m_nodeDao.saveOrUpdate(node);
m_nodeDao.flush();
}
use of org.springframework.transaction.annotation.Transactional in project opennms by OpenNMS.
the class EnhancedLinkdServiceImpl method store.
@Override
@Transactional
public void store(int nodeId, CdpElement element) {
if (element == null)
return;
final OnmsNode node = m_nodeDao.get(nodeId);
if (node == null)
return;
CdpElement dbelement = node.getCdpElement();
if (dbelement != null) {
dbelement.merge(element);
node.setCdpElement(dbelement);
} else {
element.setNode(node);
element.setCdpNodeLastPollTime(element.getCdpNodeCreateTime());
node.setCdpElement(element);
}
m_nodeDao.saveOrUpdate(node);
m_nodeDao.flush();
}
use of org.springframework.transaction.annotation.Transactional in project opennms by OpenNMS.
the class EnhancedLinkdServiceImpl method store.
@Override
@Transactional
public void store(int nodeId, LldpElement element) {
if (element == null)
return;
final OnmsNode node = m_nodeDao.get(nodeId);
if (node == null)
return;
LldpElement dbelement = node.getLldpElement();
if (dbelement != null) {
dbelement.merge(element);
node.setLldpElement(dbelement);
} else {
element.setNode(node);
element.setLldpNodeLastPollTime(element.getLldpNodeCreateTime());
node.setLldpElement(element);
}
m_nodeDao.saveOrUpdate(node);
m_nodeDao.flush();
}
use of org.springframework.transaction.annotation.Transactional in project opennms by OpenNMS.
the class AccessPointDaoTest method testFindByPhysAddr.
@Test
@Transactional
public void testFindByPhysAddr() {
addNewAccessPoint("ap1", AP1_MAC, "default-package");
addNewAccessPoint("ap2", AP2_MAC, "not-default-package");
OnmsAccessPoint ap1 = m_accessPointDao.get(AP1_MAC);
assertEquals("default-package", ap1.getPollingPackage());
OnmsAccessPoint ap2 = m_accessPointDao.get(AP2_MAC);
assertEquals("not-default-package", ap2.getPollingPackage());
}
Aggregations