@Test public void testIsTimeInOutageWeekly() throws Exception { long start = System.currentTimeMillis(); assertTrue(m_manager.isTimeInOutage(getTime("21-FEB-2005 14:00:00"), "one")); assertFalse(m_manager.isTimeInOutage(getTime("21-FEB-2005 14:00:00"), "two")); assertTrue(m_manager.isTimeInOutage(getTime("21-FEB-2005 14:00:00"), "three")); assertTrue(m_manager.isTimeInOutage(getTime("15-FEB-2005 14:00:00"), "one")); assertFalse(m_manager.isTimeInOutage(getTime("15-FEB-2005 14:00:00"), "two")); assertFalse(m_manager.isTimeInOutage(getTime("15-FEB-2005 14:00:00"), "three")); assertFalse(m_manager.isTimeInOutage(getTime("15-FEB-2005 23:37:00"), "one")); assertTrue(m_manager.isTimeInOutage(getTime("15-FEB-2005 23:37:00"), "two")); assertFalse(m_manager.isTimeInOutage(getTime("15-FEB-2005 23:37:00"), "three")); assertFalse(m_manager.isTimeInOutage(getTime("21-FEB-2005 16:00:00"), "one")); assertFalse(m_manager.isTimeInOutage(getTime("21-FEB-2005 16:00:00"), "two")); assertFalse(m_manager.isTimeInOutage(getTime("21-FEB-2005 16:00:00"), "three")); long end = System.currentTimeMillis(); System.out.println("Test took " + (end-start) + " ms"); }
public boolean isTimeInOutage(final Calendar cal, final String outName) { final Outage out = getOutage(outName); if (out == null) return false; return isTimeInOutage(cal, out); }
PollOutagesConfigManager extends AbstractJaxbConfigDao<Outages, Outages> implements PollOutagesConfig { public boolean isTimeInOutage(final Calendar cal, final String outName) { final Outage out = getOutage(outName); if (out == null) return false; return isTimeInOutage(cal, out); } }
PollOutagesConfigManager extends AbstractJaxbConfigDao<Outages, Outages> implements PollOutagesConfig { public boolean isTimeInOutage(final Calendar cal, final String outName) { final Outage out = getOutage(outName); if (out == null) return false; return isTimeInOutage(cal, out); } PollOutagesConfigManager(); }
PollOutagesConfigManager extends AbstractJaxbConfigDao<Outages, Outages> implements PollOutagesConfig { public boolean isTimeInOutage(final Calendar cal, final String outName) { final Outage out = getOutage(outName); if (out == null) return false; return isTimeInOutage(cal, out); } PollOutagesConfigManager(); Lock getReadLock(); Lock getWriteLock(); @Override void afterPropertiesSet(); Outages translateConfig(final Outages outages); Outage[] getOutages(); Outage getOutage(final String name); String getOutageType(final String name); Time[] getOutageTimes(final String name); Interface[] getInterfaces(final String name); boolean isInterfaceInOutage(final String linterface, final String outName); boolean isInterfaceInOutage(final String linterface, final Outage out); boolean isTimeInOutage(final Calendar cal, final String outName); boolean isTimeInOutage(final long time, final String outName); boolean isTimeInOutage(final Calendar cal, final Outage outage); boolean isCurTimeInOutage(final String outName); boolean isCurTimeInOutage(final Outage out); void addOutage(final Outage newOutage); void removeOutage(final String outageName); void removeOutage(final Outage outageToRemove); void replaceOutage(final Outage oldOutage, final Outage newOutage); Node[] getNodeIds(final String name); boolean isNodeIdInOutage(final long lnodeid, final String outName); Calendar getEndOfOutage(final String outName); static Calendar getEndOfOutage(final Outage out); boolean isNodeIdInOutage(final long lnodeid, final Outage out); }
PollOutagesConfigManager extends AbstractJaxbConfigDao<Outages, Outages> implements PollOutagesConfig { public boolean isTimeInOutage(final Calendar cal, final String outName) { final Outage out = getOutage(outName); if (out == null) return false; return isTimeInOutage(cal, out); } PollOutagesConfigManager(); Lock getReadLock(); Lock getWriteLock(); @Override void afterPropertiesSet(); Outages translateConfig(final Outages outages); Outage[] getOutages(); Outage getOutage(final String name); String getOutageType(final String name); Time[] getOutageTimes(final String name); Interface[] getInterfaces(final String name); boolean isInterfaceInOutage(final String linterface, final String outName); boolean isInterfaceInOutage(final String linterface, final Outage out); boolean isTimeInOutage(final Calendar cal, final String outName); boolean isTimeInOutage(final long time, final String outName); boolean isTimeInOutage(final Calendar cal, final Outage outage); boolean isCurTimeInOutage(final String outName); boolean isCurTimeInOutage(final Outage out); void addOutage(final Outage newOutage); void removeOutage(final String outageName); void removeOutage(final Outage outageToRemove); void replaceOutage(final Outage oldOutage, final Outage newOutage); Node[] getNodeIds(final String name); boolean isNodeIdInOutage(final long lnodeid, final String outName); Calendar getEndOfOutage(final String outName); static Calendar getEndOfOutage(final Outage out); boolean isNodeIdInOutage(final long lnodeid, final Outage out);  }