@Test public void testDownPassiveStatus() throws InterruptedException, UnknownHostException { Event e = createPassiveStatusEvent("Router", "192.168.1.1", "ICMP", "Down"); m_eventMgr.sendNow(e); PollStatus ps = m_psk.getStatus("Router", "192.168.1.1", "ICMP"); assertTrue(ps.isDown()); MockMonitoredService svc = new MockMonitoredService(1, "Router", InetAddressUtils.addr("192.168.1.1"), "ICMP" ); ServiceMonitor m = new PassiveServiceMonitor(); m.initialize((Map<String,Object>)null); m.initialize(svc); PollStatus ps2 = m.poll(svc, null); m.release(svc); m.release(); assertEquals(ps, ps2); }
public PollStatus getStatus(String nodeLabel, String ipAddr, String svcName) { PollStatus status = (m_statusTable == null ? PollStatus.unknown() : m_statusTable.get(new PassiveStatusKey(nodeLabel, ipAddr, svcName))); return (status == null ? PollStatus.up() : status); }
PassiveStatusKeeper extends AbstractServiceDaemon implements EventListener { public PollStatus getStatus(String nodeLabel, String ipAddr, String svcName) { PollStatus status = (m_statusTable == null ? PollStatus.unknown() : m_statusTable.get(new PassiveStatusKey(nodeLabel, ipAddr, svcName))); return (status == null ? PollStatus.up() : status); } }
PassiveStatusKeeper extends AbstractServiceDaemon implements EventListener { public PollStatus getStatus(String nodeLabel, String ipAddr, String svcName) { PollStatus status = (m_statusTable == null ? PollStatus.unknown() : m_statusTable.get(new PassiveStatusKey(nodeLabel, ipAddr, svcName))); return (status == null ? PollStatus.up() : status); } PassiveStatusKeeper();  PassiveStatusKeeper(EventIpcManager eventMgr); }
PassiveStatusKeeper extends AbstractServiceDaemon implements EventListener { public PollStatus getStatus(String nodeLabel, String ipAddr, String svcName) { PollStatus status = (m_statusTable == null ? PollStatus.unknown() : m_statusTable.get(new PassiveStatusKey(nodeLabel, ipAddr, svcName))); return (status == null ? PollStatus.up() : status); } PassiveStatusKeeper();  PassiveStatusKeeper(EventIpcManager eventMgr); synchronized static void setInstance(PassiveStatusKeeper psk); synchronized static PassiveStatusKeeper getInstance(); void setStatus(String nodeLabel, String ipAddr, String svcName, PollStatus pollStatus); void setStatus(PassiveStatusKey key, PollStatus pollStatus); PollStatus getStatus(String nodeLabel, String ipAddr, String svcName); void onEvent(Event e); EventIpcManager getEventManager(); void setEventManager(EventIpcManager eventMgr); DataSource getDbConnectoinFactory(); void setDataSource(DataSource dataSource); }
PassiveStatusKeeper extends AbstractServiceDaemon implements EventListener { public PollStatus getStatus(String nodeLabel, String ipAddr, String svcName) { PollStatus status = (m_statusTable == null ? PollStatus.unknown() : m_statusTable.get(new PassiveStatusKey(nodeLabel, ipAddr, svcName))); return (status == null ? PollStatus.up() : status); } PassiveStatusKeeper();  PassiveStatusKeeper(EventIpcManager eventMgr); synchronized static void setInstance(PassiveStatusKeeper psk); synchronized static PassiveStatusKeeper getInstance(); void setStatus(String nodeLabel, String ipAddr, String svcName, PollStatus pollStatus); void setStatus(PassiveStatusKey key, PollStatus pollStatus); PollStatus getStatus(String nodeLabel, String ipAddr, String svcName); void onEvent(Event e); EventIpcManager getEventManager(); void setEventManager(EventIpcManager eventMgr); DataSource getDbConnectoinFactory(); void setDataSource(DataSource dataSource);  }