Пример #1
0
  @Override
  public void loadOne(BaseVo baseVo) {
    NasConfig vo = (NasConfig) baseVo;
    Nas nas = new Nas();
    nas.setId(vo.getId());
    nas.setAlias(vo.getAlias());
    nas.setSendemail(vo.getSendemail());
    nas.setSendmobiles(vo.getSendmobiles());
    nas.setSendphone(vo.getSendphone());
    nas.setBid(vo.getNetid());
    nas.setMon_flag(vo.getMon_flag());
    nas.setIpAddress(vo.getIpAddress());
    nas.setCategory(121);
    nas.setStatus(0);
    nas.setType("Nas状态监视");

    Node node = PollingEngine.getInstance().getNasByID(nas.getId());
    if (node != null) {
      PollingEngine.getInstance().getNasList().remove(node);
    }
    PollingEngine.getInstance().addNas(nas);
  }
Пример #2
0
 public void clearRubbish(List baseVoList) {
   List nodeList = PollingEngine.getInstance().getNasList(); // 得到内存中的list
   for (int index = 0; index < nodeList.size(); index++) {
     if (nodeList.get(index) instanceof Nas) {
       Nas node = (Nas) nodeList.get(index);
       if (baseVoList == null) {
         nodeList.remove(node);
       } else {
         boolean flag = false;
         for (int j = 0; j < baseVoList.size(); j++) {
           NasConfig hostNode = (NasConfig) baseVoList.get(j);
           if (node.getId() == hostNode.getId()) {
             flag = true;
           }
         }
         if (!flag) {
           nodeList.remove(node);
         }
       }
     }
   }
 }