@Test public void testDeleteLsa() throws Exception { opaqueLsaHeader1 = new OpaqueLsaHeader(); opaqueLsaHeader1.setLsType(1); ospfLsdb.deleteLsa(opaqueLsaHeader1); opaqueLsaHeader1 = new OpaqueLsaHeader(); opaqueLsaHeader1.setLsType(2); ospfLsdb.deleteLsa(opaqueLsaHeader1); opaqueLsaHeader1 = new OpaqueLsaHeader(); opaqueLsaHeader1.setLsType(3); ospfLsdb.deleteLsa(opaqueLsaHeader1); opaqueLsaHeader1 = new OpaqueLsaHeader(); opaqueLsaHeader1.setLsType(4); ospfLsdb.deleteLsa(opaqueLsaHeader1); opaqueLsaHeader1 = new OpaqueLsaHeader(); opaqueLsaHeader1.setLsType(5); ospfLsdb.deleteLsa(opaqueLsaHeader1); opaqueLsaHeader1 = new OpaqueLsaHeader(); opaqueLsaHeader1.setLsType(9); ospfLsdb.deleteLsa(opaqueLsaHeader1); opaqueLsaHeader1 = new OpaqueLsaHeader(); opaqueLsaHeader1.setLsType(10); ospfLsdb.deleteLsa(opaqueLsaHeader1); opaqueLsaHeader1 = new OpaqueLsaHeader(); opaqueLsaHeader1.setLsType(11); ospfLsdb.deleteLsa(opaqueLsaHeader1); assertThat(ospfLsdb, is(notNullValue())); }
public void deleteLsa(LsaHeader lsaHeader) { String lsaKey = getLsaKey(lsaHeader); switch (lsaHeader.lsType()) { case OspfParameters.LINK_LOCAL_OPAQUE_LSA: opaque9Lsas.remove(lsaKey); break; case OspfParameters.AREA_LOCAL_OPAQUE_LSA: opaque10Lsas.remove(lsaKey); break; case OspfParameters.AS_OPAQUE_LSA: opaque11Lsas.remove(lsaKey); break; case OspfParameters.ROUTER: routerLsas.remove(lsaKey); break; case OspfParameters.NETWORK: networkLsas.remove(lsaKey); break; case OspfParameters.ASBR_SUMMARY: asbrSummaryLSAs.remove(lsaKey); break; case OspfParameters.SUMMARY: summaryLsas.remove(lsaKey); break; case OspfParameters.EXTERNAL_LSA: externalLsas.remove(lsaKey); break; default: log.debug("Unknown LSA type to delete..!!!"); break; } }
OspfLsdbImpl implements OspfLsdb { public void deleteLsa(LsaHeader lsaHeader) { String lsaKey = getLsaKey(lsaHeader); switch (lsaHeader.lsType()) { case OspfParameters.LINK_LOCAL_OPAQUE_LSA: opaque9Lsas.remove(lsaKey); break; case OspfParameters.AREA_LOCAL_OPAQUE_LSA: opaque10Lsas.remove(lsaKey); break; case OspfParameters.AS_OPAQUE_LSA: opaque11Lsas.remove(lsaKey); break; case OspfParameters.ROUTER: routerLsas.remove(lsaKey); break; case OspfParameters.NETWORK: networkLsas.remove(lsaKey); break; case OspfParameters.ASBR_SUMMARY: asbrSummaryLSAs.remove(lsaKey); break; case OspfParameters.SUMMARY: summaryLsas.remove(lsaKey); break; case OspfParameters.EXTERNAL_LSA: externalLsas.remove(lsaKey); break; default: log.debug("Unknown LSA type to delete..!!!"); break; } } }
OspfLsdbImpl implements OspfLsdb { public void deleteLsa(LsaHeader lsaHeader) { String lsaKey = getLsaKey(lsaHeader); switch (lsaHeader.lsType()) { case OspfParameters.LINK_LOCAL_OPAQUE_LSA: opaque9Lsas.remove(lsaKey); break; case OspfParameters.AREA_LOCAL_OPAQUE_LSA: opaque10Lsas.remove(lsaKey); break; case OspfParameters.AS_OPAQUE_LSA: opaque11Lsas.remove(lsaKey); break; case OspfParameters.ROUTER: routerLsas.remove(lsaKey); break; case OspfParameters.NETWORK: networkLsas.remove(lsaKey); break; case OspfParameters.ASBR_SUMMARY: asbrSummaryLSAs.remove(lsaKey); break; case OspfParameters.SUMMARY: summaryLsas.remove(lsaKey); break; case OspfParameters.EXTERNAL_LSA: externalLsas.remove(lsaKey); break; default: log.debug("Unknown LSA type to delete..!!!"); break; } } OspfLsdbImpl(OspfArea ospfArea); }
OspfLsdbImpl implements OspfLsdb { public void deleteLsa(LsaHeader lsaHeader) { String lsaKey = getLsaKey(lsaHeader); switch (lsaHeader.lsType()) { case OspfParameters.LINK_LOCAL_OPAQUE_LSA: opaque9Lsas.remove(lsaKey); break; case OspfParameters.AREA_LOCAL_OPAQUE_LSA: opaque10Lsas.remove(lsaKey); break; case OspfParameters.AS_OPAQUE_LSA: opaque11Lsas.remove(lsaKey); break; case OspfParameters.ROUTER: routerLsas.remove(lsaKey); break; case OspfParameters.NETWORK: networkLsas.remove(lsaKey); break; case OspfParameters.ASBR_SUMMARY: asbrSummaryLSAs.remove(lsaKey); break; case OspfParameters.SUMMARY: summaryLsas.remove(lsaKey); break; case OspfParameters.EXTERNAL_LSA: externalLsas.remove(lsaKey); break; default: log.debug("Unknown LSA type to delete..!!!"); break; } } 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 void deleteLsa(LsaHeader lsaHeader) { String lsaKey = getLsaKey(lsaHeader); switch (lsaHeader.lsType()) { case OspfParameters.LINK_LOCAL_OPAQUE_LSA: opaque9Lsas.remove(lsaKey); break; case OspfParameters.AREA_LOCAL_OPAQUE_LSA: opaque10Lsas.remove(lsaKey); break; case OspfParameters.AS_OPAQUE_LSA: opaque11Lsas.remove(lsaKey); break; case OspfParameters.ROUTER: routerLsas.remove(lsaKey); break; case OspfParameters.NETWORK: networkLsas.remove(lsaKey); break; case OspfParameters.ASBR_SUMMARY: asbrSummaryLSAs.remove(lsaKey); break; case OspfParameters.SUMMARY: summaryLsas.remove(lsaKey); break; case OspfParameters.EXTERNAL_LSA: externalLsas.remove(lsaKey); break; default: log.debug("Unknown LSA type to delete..!!!"); break; } } 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);  }