@Test public void testRefreshLsa() throws Exception { defaultIsisLsdbAge.age2Bin(1); defaultIsisLsdbAge.startDbAging(); defaultIsisLsdbAge.refreshLsa(); assertThat(defaultIsisLsdbAge, is(notNullValue())); defaultIsisLsdbAge.age2Bin(1400); defaultIsisLsdbAge.startDbAging(); defaultIsisLsdbAge.refreshLsa(); assertThat(defaultIsisLsdbAge, is(notNullValue())); }
public void refreshLsa() { int binNumber; if (ageCounter < IsisConstants.LSPREFRESH) { binNumber = ageCounter + IsisConstants.LSPREFRESH; } else { binNumber = ageCounter - IsisConstants.LSPREFRESH; } if (binNumber >= IsisConstants.LSPMAXAGE) { binNumber = binNumber - IsisConstants.LSPMAXAGE; } IsisLspBin lspBin = ageBins.get(binNumber); if (lspBin == null) { return; } Map lspBinMap = lspBin.listOfLsp(); for (Object key : lspBinMap.keySet()) { LspWrapper lsp = (LspWrapper) lspBinMap.get((String) key); try { if (lsp.isSelfOriginated()) { log.debug("Lsp picked for refreshLsp. binNumber: {}, LSA Type: {}, LSA Key: {}", binNumber, lsp.lspType(), key); lsp.setLspProcessing(IsisConstants.REFRESHLSP); lsaQueue.put(lsp); lspBin.removeIsisLsp((String) key, lsp); } } catch (InterruptedException e) { log.debug("Error::LSDBAge::refreshLsp::{}", e.getMessage()); } } }
DefaultIsisLsdbAge implements IsisLsdbAge { public void refreshLsa() { int binNumber; if (ageCounter < IsisConstants.LSPREFRESH) { binNumber = ageCounter + IsisConstants.LSPREFRESH; } else { binNumber = ageCounter - IsisConstants.LSPREFRESH; } if (binNumber >= IsisConstants.LSPMAXAGE) { binNumber = binNumber - IsisConstants.LSPMAXAGE; } IsisLspBin lspBin = ageBins.get(binNumber); if (lspBin == null) { return; } Map lspBinMap = lspBin.listOfLsp(); for (Object key : lspBinMap.keySet()) { LspWrapper lsp = (LspWrapper) lspBinMap.get((String) key); try { if (lsp.isSelfOriginated()) { log.debug("Lsp picked for refreshLsp. binNumber: {}, LSA Type: {}, LSA Key: {}", binNumber, lsp.lspType(), key); lsp.setLspProcessing(IsisConstants.REFRESHLSP); lsaQueue.put(lsp); lspBin.removeIsisLsp((String) key, lsp); } } catch (InterruptedException e) { log.debug("Error::LSDBAge::refreshLsp::{}", e.getMessage()); } } } }
DefaultIsisLsdbAge implements IsisLsdbAge { public void refreshLsa() { int binNumber; if (ageCounter < IsisConstants.LSPREFRESH) { binNumber = ageCounter + IsisConstants.LSPREFRESH; } else { binNumber = ageCounter - IsisConstants.LSPREFRESH; } if (binNumber >= IsisConstants.LSPMAXAGE) { binNumber = binNumber - IsisConstants.LSPMAXAGE; } IsisLspBin lspBin = ageBins.get(binNumber); if (lspBin == null) { return; } Map lspBinMap = lspBin.listOfLsp(); for (Object key : lspBinMap.keySet()) { LspWrapper lsp = (LspWrapper) lspBinMap.get((String) key); try { if (lsp.isSelfOriginated()) { log.debug("Lsp picked for refreshLsp. binNumber: {}, LSA Type: {}, LSA Key: {}", binNumber, lsp.lspType(), key); lsp.setLspProcessing(IsisConstants.REFRESHLSP); lsaQueue.put(lsp); lspBin.removeIsisLsp((String) key, lsp); } } catch (InterruptedException e) { log.debug("Error::LSDBAge::refreshLsp::{}", e.getMessage()); } } } DefaultIsisLsdbAge(); }
DefaultIsisLsdbAge implements IsisLsdbAge { public void refreshLsa() { int binNumber; if (ageCounter < IsisConstants.LSPREFRESH) { binNumber = ageCounter + IsisConstants.LSPREFRESH; } else { binNumber = ageCounter - IsisConstants.LSPREFRESH; } if (binNumber >= IsisConstants.LSPMAXAGE) { binNumber = binNumber - IsisConstants.LSPMAXAGE; } IsisLspBin lspBin = ageBins.get(binNumber); if (lspBin == null) { return; } Map lspBinMap = lspBin.listOfLsp(); for (Object key : lspBinMap.keySet()) { LspWrapper lsp = (LspWrapper) lspBinMap.get((String) key); try { if (lsp.isSelfOriginated()) { log.debug("Lsp picked for refreshLsp. binNumber: {}, LSA Type: {}, LSA Key: {}", binNumber, lsp.lspType(), key); lsp.setLspProcessing(IsisConstants.REFRESHLSP); lsaQueue.put(lsp); lspBin.removeIsisLsp((String) key, lsp); } } catch (InterruptedException e) { log.debug("Error::LSDBAge::refreshLsp::{}", 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 refreshLsa() { int binNumber; if (ageCounter < IsisConstants.LSPREFRESH) { binNumber = ageCounter + IsisConstants.LSPREFRESH; } else { binNumber = ageCounter - IsisConstants.LSPREFRESH; } if (binNumber >= IsisConstants.LSPMAXAGE) { binNumber = binNumber - IsisConstants.LSPMAXAGE; } IsisLspBin lspBin = ageBins.get(binNumber); if (lspBin == null) { return; } Map lspBinMap = lspBin.listOfLsp(); for (Object key : lspBinMap.keySet()) { LspWrapper lsp = (LspWrapper) lspBinMap.get((String) key); try { if (lsp.isSelfOriginated()) { log.debug("Lsp picked for refreshLsp. binNumber: {}, LSA Type: {}, LSA Key: {}", binNumber, lsp.lspType(), key); lsp.setLspProcessing(IsisConstants.REFRESHLSP); lsaQueue.put(lsp); lspBin.removeIsisLsp((String) key, lsp); } } catch (InterruptedException e) { log.debug("Error::LSDBAge::refreshLsp::{}", 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();  }