@Test public void testCheckAges() throws Exception { lsaWrapper = EasyMock.createMock(LsaWrapperImpl.class); lsdbAge.addLsaToMaxAgeBin("lsa1", lsaWrapper); lsaWrapper = EasyMock.createMock(LsaWrapperImpl.class); lsdbAge.addLsaToMaxAgeBin("lsa2", lsaWrapper); lsdbAge.startDbAging(); lsdbAge.checkAges(); assertThat(lsdbAge, is(notNullValue())); }
public void checkAges() { for (int age = OspfParameters.CHECKAGE; age < OspfParameters.MAXAGE; age += OspfParameters.CHECKAGE) { LsaBin lsaBin = ageBins.get(age2Bin(age)); if (lsaBin == null) { continue; } Map lsaBinMap = lsaBin.listOfLsa(); for (Object key : lsaBinMap.keySet()) { LsaWrapper lsa = (LsaWrapper) lsaBinMap.get((String) key); lsa.setLsaProcessing(OspfParameters.VERIFYCHECKSUM); try { lsaQueue.put(lsa); } catch (InterruptedException e) { log.debug("Error::LSDBAge::checkAges::{}", e.getMessage()); } } } }
LsdbAgeImpl implements LsdbAge { public void checkAges() { for (int age = OspfParameters.CHECKAGE; age < OspfParameters.MAXAGE; age += OspfParameters.CHECKAGE) { LsaBin lsaBin = ageBins.get(age2Bin(age)); if (lsaBin == null) { continue; } Map lsaBinMap = lsaBin.listOfLsa(); for (Object key : lsaBinMap.keySet()) { LsaWrapper lsa = (LsaWrapper) lsaBinMap.get((String) key); lsa.setLsaProcessing(OspfParameters.VERIFYCHECKSUM); try { lsaQueue.put(lsa); } catch (InterruptedException e) { log.debug("Error::LSDBAge::checkAges::{}", e.getMessage()); } } } } }
LsdbAgeImpl implements LsdbAge { public void checkAges() { for (int age = OspfParameters.CHECKAGE; age < OspfParameters.MAXAGE; age += OspfParameters.CHECKAGE) { LsaBin lsaBin = ageBins.get(age2Bin(age)); if (lsaBin == null) { continue; } Map lsaBinMap = lsaBin.listOfLsa(); for (Object key : lsaBinMap.keySet()) { LsaWrapper lsa = (LsaWrapper) lsaBinMap.get((String) key); lsa.setLsaProcessing(OspfParameters.VERIFYCHECKSUM); try { lsaQueue.put(lsa); } catch (InterruptedException e) { log.debug("Error::LSDBAge::checkAges::{}", e.getMessage()); } } } } LsdbAgeImpl(OspfArea ospfArea); }
LsdbAgeImpl implements LsdbAge { public void checkAges() { for (int age = OspfParameters.CHECKAGE; age < OspfParameters.MAXAGE; age += OspfParameters.CHECKAGE) { LsaBin lsaBin = ageBins.get(age2Bin(age)); if (lsaBin == null) { continue; } Map lsaBinMap = lsaBin.listOfLsa(); for (Object key : lsaBinMap.keySet()) { LsaWrapper lsa = (LsaWrapper) lsaBinMap.get((String) key); lsa.setLsaProcessing(OspfParameters.VERIFYCHECKSUM); try { lsaQueue.put(lsa); } catch (InterruptedException e) { log.debug("Error::LSDBAge::checkAges::{}", e.getMessage()); } } } } LsdbAgeImpl(OspfArea ospfArea); @Override boolean equals(Object o); @Override int hashCode(); void addLsaBin(Integer binKey, LsaBin lsaBin); LsaBin getLsaBin(Integer binKey); void addLsaToMaxAgeBin(String key, LsaWrapper wrapper); void removeLsaFromBin(LsaWrapper lsaWrapper); void startDbAging(); void ageLsaAndFlood(); void maxAgeLsa(); void refreshLsa(); void checkAges(); Channel getChannel(); void setChannel(Channel channel); int getAgeCounter(); int getAgeCounterRollOver(); LsaBin getMaxAgeBin(); int age2Bin(int x); }
LsdbAgeImpl implements LsdbAge { public void checkAges() { for (int age = OspfParameters.CHECKAGE; age < OspfParameters.MAXAGE; age += OspfParameters.CHECKAGE) { LsaBin lsaBin = ageBins.get(age2Bin(age)); if (lsaBin == null) { continue; } Map lsaBinMap = lsaBin.listOfLsa(); for (Object key : lsaBinMap.keySet()) { LsaWrapper lsa = (LsaWrapper) lsaBinMap.get((String) key); lsa.setLsaProcessing(OspfParameters.VERIFYCHECKSUM); try { lsaQueue.put(lsa); } catch (InterruptedException e) { log.debug("Error::LSDBAge::checkAges::{}", e.getMessage()); } } } } LsdbAgeImpl(OspfArea ospfArea); @Override boolean equals(Object o); @Override int hashCode(); void addLsaBin(Integer binKey, LsaBin lsaBin); LsaBin getLsaBin(Integer binKey); void addLsaToMaxAgeBin(String key, LsaWrapper wrapper); void removeLsaFromBin(LsaWrapper lsaWrapper); void startDbAging(); void ageLsaAndFlood(); void maxAgeLsa(); void refreshLsa(); void checkAges(); Channel getChannel(); void setChannel(Channel channel); int getAgeCounter(); int getAgeCounterRollOver(); LsaBin getMaxAgeBin(); int age2Bin(int x);  }