Exemple #1
0
 public LldpElement(
     OnmsNode node, String chassisId, String sysName, LldpChassisIdSubType chassisIdSubType) {
   setNode(node);
   setLldpChassisId(chassisId);
   setLldpSysname(sysName);
   setLldpChassisIdSubType(chassisIdSubType);
 }
  @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();
  }