@Test
  @Transactional
  public void testGetByCompositeId() {
    final OnmsMonitoredService monSvc =
        m_monitoredServiceDao.get(
            m_databasePopulator.getNode1().getId(), addr("192.168.1.1"), "SNMP");
    assertNotNull(monSvc);

    final OnmsMonitoredService monSvc2 =
        m_monitoredServiceDao.get(
            m_databasePopulator.getNode1().getId(),
            addr("192.168.1.1"),
            monSvc.getIfIndex(),
            monSvc.getServiceId());
    assertNotNull(monSvc2);
  }
示例#2
0
  Service(OnmsMonitoredService monSvc) {
    setId(monSvc.getId());
    setNodeId(monSvc.getNodeId());

    setIpAddress(InetAddressUtils.str(monSvc.getIpAddress()));
    setServiceId(monSvc.getServiceId());
    setServiceName(monSvc.getServiceName());
    if (monSvc.getLastGood() != null) {
      setLastGood(monSvc.getLastGood().toString());
    }
    if (monSvc.getLastFail() != null) {
      setLastFail(monSvc.getLastFail().toString());
    }
    setNotify(monSvc.getNotify());
    if (monSvc.getStatus() != null) {
      setStatus(monSvc.getStatus().charAt(0));
    }
  }