@Test public void testAddLocalLink() throws Exception { Ip4Address linkData = Ip4Address.valueOf("1.1.1.1"); Ip4Address linkSrc = Ip4Address.valueOf("2.2.2.2"); Ip4Address linkDest = Ip4Address.valueOf("3.3.3.3"); boolean opaqueEnabled = true; boolean linkSrcIdNotRouterId = true; topologyForDeviceAndLink.addLocalLink("10.10.10.10", linkData, linkSrc, linkDest, opaqueEnabled, linkSrcIdNotRouterId); assertThat(topologyForDeviceAndLink, is(notNullValue())); }
public void addLocalLink(String advertisingRouter, Ip4Address linkData, Ip4Address linkSrc, Ip4Address linkDest, boolean opaqueEnabled, boolean linkSrcIdNotRouterId) { String linkKey = "link:"; LinkInformation linkInformation = new LinkInformationImpl(); linkInformation.setLinkId(advertisingRouter); linkInformation.setLinkSourceId(linkSrc); linkInformation.setLinkDestinationId(linkDest); linkInformation.setAlreadyCreated(false); linkInformation.setLinkSrcIdNotRouterId(linkSrcIdNotRouterId); linkInformation.setInterfaceIp(linkData); if (linkDest != null) { linkInformation.setLinkSrcIdNotRouterId(false); } linkKey = linkKey + "-" + linkSrc + "-" + linkDest; setLinkInformationMap(linkKey, linkInformation); }
TopologyForDeviceAndLinkImpl implements TopologyForDeviceAndLink { public void addLocalLink(String advertisingRouter, Ip4Address linkData, Ip4Address linkSrc, Ip4Address linkDest, boolean opaqueEnabled, boolean linkSrcIdNotRouterId) { String linkKey = "link:"; LinkInformation linkInformation = new LinkInformationImpl(); linkInformation.setLinkId(advertisingRouter); linkInformation.setLinkSourceId(linkSrc); linkInformation.setLinkDestinationId(linkDest); linkInformation.setAlreadyCreated(false); linkInformation.setLinkSrcIdNotRouterId(linkSrcIdNotRouterId); linkInformation.setInterfaceIp(linkData); if (linkDest != null) { linkInformation.setLinkSrcIdNotRouterId(false); } linkKey = linkKey + "-" + linkSrc + "-" + linkDest; setLinkInformationMap(linkKey, linkInformation); } }
TopologyForDeviceAndLinkImpl implements TopologyForDeviceAndLink { public void addLocalLink(String advertisingRouter, Ip4Address linkData, Ip4Address linkSrc, Ip4Address linkDest, boolean opaqueEnabled, boolean linkSrcIdNotRouterId) { String linkKey = "link:"; LinkInformation linkInformation = new LinkInformationImpl(); linkInformation.setLinkId(advertisingRouter); linkInformation.setLinkSourceId(linkSrc); linkInformation.setLinkDestinationId(linkDest); linkInformation.setAlreadyCreated(false); linkInformation.setLinkSrcIdNotRouterId(linkSrcIdNotRouterId); linkInformation.setInterfaceIp(linkData); if (linkDest != null) { linkInformation.setLinkSrcIdNotRouterId(false); } linkKey = linkKey + "-" + linkSrc + "-" + linkDest; setLinkInformationMap(linkKey, linkInformation); }  }
TopologyForDeviceAndLinkImpl implements TopologyForDeviceAndLink { public void addLocalLink(String advertisingRouter, Ip4Address linkData, Ip4Address linkSrc, Ip4Address linkDest, boolean opaqueEnabled, boolean linkSrcIdNotRouterId) { String linkKey = "link:"; LinkInformation linkInformation = new LinkInformationImpl(); linkInformation.setLinkId(advertisingRouter); linkInformation.setLinkSourceId(linkSrc); linkInformation.setLinkDestinationId(linkDest); linkInformation.setAlreadyCreated(false); linkInformation.setLinkSrcIdNotRouterId(linkSrcIdNotRouterId); linkInformation.setInterfaceIp(linkData); if (linkDest != null) { linkInformation.setLinkSrcIdNotRouterId(false); } linkKey = linkKey + "-" + linkSrc + "-" + linkDest; setLinkInformationMap(linkKey, linkInformation); }  Map<String, DeviceInformation> deviceInformationMap(); void setDeviceInformationMap(String key, DeviceInformation deviceInformationMap); Map<String, DeviceInformation> deviceInformationMapForPointToPoint(); void setDeviceInformationMapForPointToPoint(String key, DeviceInformation deviceInformationMap); Map<String, DeviceInformation> deviceInformationMapToDelete(); void setDeviceInformationMapToDelete(String key, DeviceInformation deviceInformationMapToDelete); void removeDeviceInformationMapFromDeleteMap(String key); DeviceInformation deviceInformation(String key); void removeDeviceInformationMap(String key); Map<String, LinkInformation> linkInformationMap(); void setLinkInformationMap(String key, LinkInformation linkInformationMap); Map<String, LinkInformation> linkInformationMapForPointToPoint(); void setLinkInformationMapForPointToPoint(String key, LinkInformation linkInformationMap); void removeLinkInformationMap(String key); OspfLinkTed getOspfLinkTedHashMap(String key); void addLocalDevice(OspfLsa ospfLsa, OspfInterface ospfInterface, OspfArea ospfArea); void addLocalLink(String advertisingRouter, Ip4Address linkData, Ip4Address linkSrc, Ip4Address linkDest,
                             boolean opaqueEnabled, boolean linkSrcIdNotRouterId); void addLocalLinkForPointToPoint(String advertisingRouter, Ip4Address linkData, Ip4Address linkSrc,
                                            Ip4Address linkDest, boolean opaqueEnabled, boolean linkSrcIdNotRouterId); void removeLinks(Ip4Address routerId); void removeDevice(Ip4Address routerId); void updateLinkInformation(OspfLsa ospfLsa, OspfArea ospfArea); List<String> getDeleteRouterInformation(OspfLsa ospfLsa, OspfArea ospfArea); }
TopologyForDeviceAndLinkImpl implements TopologyForDeviceAndLink { public void addLocalLink(String advertisingRouter, Ip4Address linkData, Ip4Address linkSrc, Ip4Address linkDest, boolean opaqueEnabled, boolean linkSrcIdNotRouterId) { String linkKey = "link:"; LinkInformation linkInformation = new LinkInformationImpl(); linkInformation.setLinkId(advertisingRouter); linkInformation.setLinkSourceId(linkSrc); linkInformation.setLinkDestinationId(linkDest); linkInformation.setAlreadyCreated(false); linkInformation.setLinkSrcIdNotRouterId(linkSrcIdNotRouterId); linkInformation.setInterfaceIp(linkData); if (linkDest != null) { linkInformation.setLinkSrcIdNotRouterId(false); } linkKey = linkKey + "-" + linkSrc + "-" + linkDest; setLinkInformationMap(linkKey, linkInformation); }  Map<String, DeviceInformation> deviceInformationMap(); void setDeviceInformationMap(String key, DeviceInformation deviceInformationMap); Map<String, DeviceInformation> deviceInformationMapForPointToPoint(); void setDeviceInformationMapForPointToPoint(String key, DeviceInformation deviceInformationMap); Map<String, DeviceInformation> deviceInformationMapToDelete(); void setDeviceInformationMapToDelete(String key, DeviceInformation deviceInformationMapToDelete); void removeDeviceInformationMapFromDeleteMap(String key); DeviceInformation deviceInformation(String key); void removeDeviceInformationMap(String key); Map<String, LinkInformation> linkInformationMap(); void setLinkInformationMap(String key, LinkInformation linkInformationMap); Map<String, LinkInformation> linkInformationMapForPointToPoint(); void setLinkInformationMapForPointToPoint(String key, LinkInformation linkInformationMap); void removeLinkInformationMap(String key); OspfLinkTed getOspfLinkTedHashMap(String key); void addLocalDevice(OspfLsa ospfLsa, OspfInterface ospfInterface, OspfArea ospfArea); void addLocalLink(String advertisingRouter, Ip4Address linkData, Ip4Address linkSrc, Ip4Address linkDest,
                             boolean opaqueEnabled, boolean linkSrcIdNotRouterId); void addLocalLinkForPointToPoint(String advertisingRouter, Ip4Address linkData, Ip4Address linkSrc,
                                            Ip4Address linkDest, boolean opaqueEnabled, boolean linkSrcIdNotRouterId); void removeLinks(Ip4Address routerId); void removeDevice(Ip4Address routerId); void updateLinkInformation(OspfLsa ospfLsa, OspfArea ospfArea); List<String> getDeleteRouterInformation(OspfLsa ospfLsa, OspfArea ospfArea);  }