LinkDiscoveryManager implements IOFMessageListener,
IOFSwitchListener, IStorageSourceListener, ILinkDiscoveryService,
IFloodlightModule, IInfoProvider { protected void deleteLink(Link link, String reason) { if (link == null) return; List<Link> linkList = new ArrayList<Link>(); linkList.add(link); deleteLinks(linkList, reason); }  @Override OFPacketOut generateLLDPMessage(IOFSwitch iofSwitch, OFPort port,
			boolean isStandard, boolean isReverse); int getLldpFrequency(); int getLldpTimeout(); @Override Map<NodePortTuple, Set<Link>> getPortLinks(); @Override Set<NodePortTuple> getSuppressLLDPsInfo(); @Override void AddToSuppressLLDPs(DatapathId sw, OFPort port); @Override void RemoveFromSuppressLLDPs(DatapathId sw, OFPort port); boolean isShuttingDown(); @Override boolean isTunnelPort(DatapathId sw, OFPort port); @Override ILinkDiscovery.LinkType getLinkType(Link lt, LinkInfo info); @Override Set<OFPort> getQuarantinedPorts(DatapathId sw); @Override Map<DatapathId, Set<Link>> getSwitchLinks(); @Override void addMACToIgnoreList(MacAddress mac, int ignoreBits); @Override boolean isAutoPortFastFeature(); @Override void setAutoPortFastFeature(boolean autoPortFastFeature); @Override void addListener(ILinkDiscoveryListener listener); @Override Map<Link, LinkInfo> getLinks(); @Override LinkInfo getLinkInfo(Link link); @Override String getName(); @Override Command receive(IOFSwitch sw, OFMessage msg,
			FloodlightContext cntx); @Override boolean isCallbackOrderingPrereq(OFType type, String name); @Override boolean isCallbackOrderingPostreq(OFType type, String name); @Override void switchPortChanged(DatapathId switchId,
			OFPortDesc port,
			PortChangeType type); @Override void switchAdded(DatapathId switchId); @Override void switchRemoved(DatapathId sw); @Override void switchActivated(DatapathId switchId); @Override void switchChanged(DatapathId switchId); void setStorageSource(IStorageSourceService storageSourceService); IStorageSourceService getStorageSource(); @Override void rowsModified(String tableName, Set<Object> rowKeys); @Override void rowsDeleted(String tableName, Set<Object> rowKeys); Long readLinkValidTime(Link lt); @Override Collection<Class<? extends IFloodlightService>> getModuleServices(); @Override Map<Class<? extends IFloodlightService>, IFloodlightService> getServiceImpls(); @Override Collection<Class<? extends IFloodlightService>> getModuleDependencies(); @Override void init(FloodlightModuleContext context); @Override void startUp(FloodlightModuleContext context); @Override Map<String, Object> getInfo(String type); static final String MODULE_NAME; }
@Test public void testDeleteLink() throws Exception { LinkDiscoveryManager linkDiscovery = getLinkDiscoveryManager(); Link lt = new Link(DatapathId.of(1L), OFPort.of(2), DatapathId.of(2L), OFPort.of(1), U64.ZERO); LinkInfo info = new LinkInfo(new Date(), new Date(), null); linkDiscovery.addOrUpdateLink(lt, info); linkDiscovery.deleteLinks(Collections.singletonList(lt), "Test"); assertNull(linkDiscovery.switchLinks.get(lt.getSrc())); assertNull(linkDiscovery.switchLinks.get(lt.getDst())); assertNull(linkDiscovery.portLinks.get(lt.getSrc())); assertNull(linkDiscovery.portLinks.get(lt.getDst())); assertTrue(linkDiscovery.links.isEmpty()); }