@Test public void testMaxAgeLsa() throws Exception { defaultIsisLsdbAge.age2Bin(1); defaultIsisLsdbAge.startDbAging(); defaultIsisLsdbAge.maxAgeLsa(); assertThat(defaultIsisLsdbAge, is(notNullValue())); defaultIsisLsdbAge.age2Bin(1400); defaultIsisLsdbAge.startDbAging(); defaultIsisLsdbAge.maxAgeLsa(); assertThat(defaultIsisLsdbAge, is(notNullValue())); }
public void maxAgeLsa() { if (ageCounter == 0) { return; } IsisLspBin lspBin = ageBins.get(ageCounter - 1); if (lspBin == null) { return; } Map lspBinMap = lspBin.listOfLsp(); for (Object key : lspBinMap.keySet()) { LspWrapper lspWrapper = (LspWrapper) lspBinMap.get((String) key); if (lspWrapper.currentAge() == IsisConstants.LSPMAXAGE) { lspWrapper.setLspProcessing(IsisConstants.MAXAGELSP); log.debug("Lsp picked for maxage removal. Age Counter: {}, AgeCounterRollover: {}, " + "AgeCounterRollover WhenAddedToDb: {}, LSA Type: {}, LSA Key: {}", ageCounter, ageCounterRollOver, lspWrapper.currentAge(), lspWrapper.lsPdu().isisPduType(), key); try { lsaQueue.put(lspWrapper); lspBin.removeIsisLsp((String) key, lspWrapper); } catch (InterruptedException e) { log.debug("Error::LSDBAge::maxAgeLsp::{}", e.getMessage()); } } } }
DefaultIsisLsdbAge implements IsisLsdbAge { public void maxAgeLsa() { if (ageCounter == 0) { return; } IsisLspBin lspBin = ageBins.get(ageCounter - 1); if (lspBin == null) { return; } Map lspBinMap = lspBin.listOfLsp(); for (Object key : lspBinMap.keySet()) { LspWrapper lspWrapper = (LspWrapper) lspBinMap.get((String) key); if (lspWrapper.currentAge() == IsisConstants.LSPMAXAGE) { lspWrapper.setLspProcessing(IsisConstants.MAXAGELSP); log.debug("Lsp picked for maxage removal. Age Counter: {}, AgeCounterRollover: {}, " + "AgeCounterRollover WhenAddedToDb: {}, LSA Type: {}, LSA Key: {}", ageCounter, ageCounterRollOver, lspWrapper.currentAge(), lspWrapper.lsPdu().isisPduType(), key); try { lsaQueue.put(lspWrapper); lspBin.removeIsisLsp((String) key, lspWrapper); } catch (InterruptedException e) { log.debug("Error::LSDBAge::maxAgeLsp::{}", e.getMessage()); } } } } }
DefaultIsisLsdbAge implements IsisLsdbAge { public void maxAgeLsa() { if (ageCounter == 0) { return; } IsisLspBin lspBin = ageBins.get(ageCounter - 1); if (lspBin == null) { return; } Map lspBinMap = lspBin.listOfLsp(); for (Object key : lspBinMap.keySet()) { LspWrapper lspWrapper = (LspWrapper) lspBinMap.get((String) key); if (lspWrapper.currentAge() == IsisConstants.LSPMAXAGE) { lspWrapper.setLspProcessing(IsisConstants.MAXAGELSP); log.debug("Lsp picked for maxage removal. Age Counter: {}, AgeCounterRollover: {}, " + "AgeCounterRollover WhenAddedToDb: {}, LSA Type: {}, LSA Key: {}", ageCounter, ageCounterRollOver, lspWrapper.currentAge(), lspWrapper.lsPdu().isisPduType(), key); try { lsaQueue.put(lspWrapper); lspBin.removeIsisLsp((String) key, lspWrapper); } catch (InterruptedException e) { log.debug("Error::LSDBAge::maxAgeLsp::{}", e.getMessage()); } } } } DefaultIsisLsdbAge(); }
DefaultIsisLsdbAge implements IsisLsdbAge { public void maxAgeLsa() { if (ageCounter == 0) { return; } IsisLspBin lspBin = ageBins.get(ageCounter - 1); if (lspBin == null) { return; } Map lspBinMap = lspBin.listOfLsp(); for (Object key : lspBinMap.keySet()) { LspWrapper lspWrapper = (LspWrapper) lspBinMap.get((String) key); if (lspWrapper.currentAge() == IsisConstants.LSPMAXAGE) { lspWrapper.setLspProcessing(IsisConstants.MAXAGELSP); log.debug("Lsp picked for maxage removal. Age Counter: {}, AgeCounterRollover: {}, " + "AgeCounterRollover WhenAddedToDb: {}, LSA Type: {}, LSA Key: {}", ageCounter, ageCounterRollOver, lspWrapper.currentAge(), lspWrapper.lsPdu().isisPduType(), key); try { lsaQueue.put(lspWrapper); lspBin.removeIsisLsp((String) key, lspWrapper); } catch (InterruptedException e) { log.debug("Error::LSDBAge::maxAgeLsp::{}", e.getMessage()); } } } } DefaultIsisLsdbAge(); int ageCounter(); int ageCounterRollOver(); void addLspBin(int binNumber, IsisLspBin lspBin); IsisLspBin getLspBin(int binKey); void removeLspFromBin(LspWrapper lspWrapper); int age2Bin(int age); void startDbAging(); void ageLsp(); void maxAgeLsa(); void refreshLsa(); }
DefaultIsisLsdbAge implements IsisLsdbAge { public void maxAgeLsa() { if (ageCounter == 0) { return; } IsisLspBin lspBin = ageBins.get(ageCounter - 1); if (lspBin == null) { return; } Map lspBinMap = lspBin.listOfLsp(); for (Object key : lspBinMap.keySet()) { LspWrapper lspWrapper = (LspWrapper) lspBinMap.get((String) key); if (lspWrapper.currentAge() == IsisConstants.LSPMAXAGE) { lspWrapper.setLspProcessing(IsisConstants.MAXAGELSP); log.debug("Lsp picked for maxage removal. Age Counter: {}, AgeCounterRollover: {}, " + "AgeCounterRollover WhenAddedToDb: {}, LSA Type: {}, LSA Key: {}", ageCounter, ageCounterRollOver, lspWrapper.currentAge(), lspWrapper.lsPdu().isisPduType(), key); try { lsaQueue.put(lspWrapper); lspBin.removeIsisLsp((String) key, lspWrapper); } catch (InterruptedException e) { log.debug("Error::LSDBAge::maxAgeLsp::{}", e.getMessage()); } } } } DefaultIsisLsdbAge(); int ageCounter(); int ageCounterRollOver(); void addLspBin(int binNumber, IsisLspBin lspBin); IsisLspBin getLspBin(int binKey); void removeLspFromBin(LspWrapper lspWrapper); int age2Bin(int age); void startDbAging(); void ageLsp(); void maxAgeLsa(); void refreshLsa();  }