@Test public void testGetAllLsaHeaders() throws Exception { ospfLsdb.initializeDb(); routerLsa.setLsType(1); assertThat(ospfLsdb.addLsa(routerLsa, false, new OspfInterfaceImpl()), is(true)); networkLsa.setLsType(2); assertThat(ospfLsdb.addLsa(networkLsa, false, new OspfInterfaceImpl()), is(true)); summaryLsa.setLsType(3); assertThat(ospfLsdb.addLsa(summaryLsa, false, new OspfInterfaceImpl()), is(true)); asbrSummaryLsa.setLsType(4); assertThat(ospfLsdb.addLsa(asbrSummaryLsa, false, new OspfInterfaceImpl()), is(true)); externalLsa.setLsType(5); assertThat(ospfLsdb.addLsa(externalLsa, false, new OspfInterfaceImpl()), is(true)); ospfLsdb.initializeDb(); assertThat(ospfLsdb.getAllLsaHeaders(true, true).size(), is(5)); }
public List getAllLsaHeaders(boolean excludeMaxAgeLsa, boolean isOpaqueCapable) { List summList = new CopyOnWriteArrayList(); addLsaToHeaderList(summList, excludeMaxAgeLsa, routerLsas); addLsaToHeaderList(summList, excludeMaxAgeLsa, networkLsas); addLsaToHeaderList(summList, excludeMaxAgeLsa, summaryLsas); addLsaToHeaderList(summList, excludeMaxAgeLsa, asbrSummaryLSAs); addLsaToHeaderList(summList, excludeMaxAgeLsa, externalLsas); if (isOpaqueCapable) { addLsaToHeaderList(summList, excludeMaxAgeLsa, opaque9Lsas); addLsaToHeaderList(summList, excludeMaxAgeLsa, opaque10Lsas); addLsaToHeaderList(summList, excludeMaxAgeLsa, opaque11Lsas); } return summList; }
OspfLsdbImpl implements OspfLsdb { public List getAllLsaHeaders(boolean excludeMaxAgeLsa, boolean isOpaqueCapable) { List summList = new CopyOnWriteArrayList(); addLsaToHeaderList(summList, excludeMaxAgeLsa, routerLsas); addLsaToHeaderList(summList, excludeMaxAgeLsa, networkLsas); addLsaToHeaderList(summList, excludeMaxAgeLsa, summaryLsas); addLsaToHeaderList(summList, excludeMaxAgeLsa, asbrSummaryLSAs); addLsaToHeaderList(summList, excludeMaxAgeLsa, externalLsas); if (isOpaqueCapable) { addLsaToHeaderList(summList, excludeMaxAgeLsa, opaque9Lsas); addLsaToHeaderList(summList, excludeMaxAgeLsa, opaque10Lsas); addLsaToHeaderList(summList, excludeMaxAgeLsa, opaque11Lsas); } return summList; } }
OspfLsdbImpl implements OspfLsdb { public List getAllLsaHeaders(boolean excludeMaxAgeLsa, boolean isOpaqueCapable) { List summList = new CopyOnWriteArrayList(); addLsaToHeaderList(summList, excludeMaxAgeLsa, routerLsas); addLsaToHeaderList(summList, excludeMaxAgeLsa, networkLsas); addLsaToHeaderList(summList, excludeMaxAgeLsa, summaryLsas); addLsaToHeaderList(summList, excludeMaxAgeLsa, asbrSummaryLSAs); addLsaToHeaderList(summList, excludeMaxAgeLsa, externalLsas); if (isOpaqueCapable) { addLsaToHeaderList(summList, excludeMaxAgeLsa, opaque9Lsas); addLsaToHeaderList(summList, excludeMaxAgeLsa, opaque10Lsas); addLsaToHeaderList(summList, excludeMaxAgeLsa, opaque11Lsas); } return summList; } OspfLsdbImpl(OspfArea ospfArea); }
OspfLsdbImpl implements OspfLsdb { public List getAllLsaHeaders(boolean excludeMaxAgeLsa, boolean isOpaqueCapable) { List summList = new CopyOnWriteArrayList(); addLsaToHeaderList(summList, excludeMaxAgeLsa, routerLsas); addLsaToHeaderList(summList, excludeMaxAgeLsa, networkLsas); addLsaToHeaderList(summList, excludeMaxAgeLsa, summaryLsas); addLsaToHeaderList(summList, excludeMaxAgeLsa, asbrSummaryLSAs); addLsaToHeaderList(summList, excludeMaxAgeLsa, externalLsas); if (isOpaqueCapable) { addLsaToHeaderList(summList, excludeMaxAgeLsa, opaque9Lsas); addLsaToHeaderList(summList, excludeMaxAgeLsa, opaque10Lsas); addLsaToHeaderList(summList, excludeMaxAgeLsa, opaque11Lsas); } return summList; } OspfLsdbImpl(OspfArea ospfArea); @Override boolean equals(Object o); @Override int hashCode(); void initializeDb(); List getAllLsaHeaders(boolean excludeMaxAgeLsa, boolean isOpaqueCapable); String getLsaKey(LsaHeader lsaHeader); LsaWrapper lsaLookup(LsaHeader lsaHeader); LsaWrapper findLsa(int lsType, String lsaKey); boolean addLsa(LsaHeader newLsa, boolean isSelfOriginated, OspfInterface ospfInterface); void addLsaToMaxAgeBin(String key, Object wrapper); void removeLsaFromBin(Object lsaWrapper); String isNewerOrSameLsa(LsaHeader lsa1, LsaHeader lsa2); long getLsSequenceNumber(OspfLsaType lsaType); void deleteLsa(LsaHeader lsaHeader); void setRouterLsaSeqNo(long routerLsaSeqNo); void setNetworkLsaSeqNo(long networkLsaSeqNo); }
OspfLsdbImpl implements OspfLsdb { public List getAllLsaHeaders(boolean excludeMaxAgeLsa, boolean isOpaqueCapable) { List summList = new CopyOnWriteArrayList(); addLsaToHeaderList(summList, excludeMaxAgeLsa, routerLsas); addLsaToHeaderList(summList, excludeMaxAgeLsa, networkLsas); addLsaToHeaderList(summList, excludeMaxAgeLsa, summaryLsas); addLsaToHeaderList(summList, excludeMaxAgeLsa, asbrSummaryLSAs); addLsaToHeaderList(summList, excludeMaxAgeLsa, externalLsas); if (isOpaqueCapable) { addLsaToHeaderList(summList, excludeMaxAgeLsa, opaque9Lsas); addLsaToHeaderList(summList, excludeMaxAgeLsa, opaque10Lsas); addLsaToHeaderList(summList, excludeMaxAgeLsa, opaque11Lsas); } return summList; } OspfLsdbImpl(OspfArea ospfArea); @Override boolean equals(Object o); @Override int hashCode(); void initializeDb(); List getAllLsaHeaders(boolean excludeMaxAgeLsa, boolean isOpaqueCapable); String getLsaKey(LsaHeader lsaHeader); LsaWrapper lsaLookup(LsaHeader lsaHeader); LsaWrapper findLsa(int lsType, String lsaKey); boolean addLsa(LsaHeader newLsa, boolean isSelfOriginated, OspfInterface ospfInterface); void addLsaToMaxAgeBin(String key, Object wrapper); void removeLsaFromBin(Object lsaWrapper); String isNewerOrSameLsa(LsaHeader lsa1, LsaHeader lsa2); long getLsSequenceNumber(OspfLsaType lsaType); void deleteLsa(LsaHeader lsaHeader); void setRouterLsaSeqNo(long routerLsaSeqNo); void setNetworkLsaSeqNo(long networkLsaSeqNo);  }