sunish vk | 30637eb | 2016-02-16 15:19:32 +0530 | [diff] [blame] | 1 | /* |
Brian O'Connor | 5ab426f | 2016-04-09 01:19:45 -0700 | [diff] [blame] | 2 | * Copyright 2016-present Open Networking Laboratory |
sunish vk | 30637eb | 2016-02-16 15:19:32 +0530 | [diff] [blame] | 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | package org.onosproject.ospf.controller; |
| 17 | |
| 18 | import org.onlab.packet.Ip4Address; |
| 19 | |
| 20 | import java.util.List; |
| 21 | import java.util.Map; |
| 22 | |
| 23 | /** |
| 24 | * Represents IP topology for OSPF device and link details. |
| 25 | */ |
| 26 | public interface TopologyForDeviceAndLink { |
| 27 | |
| 28 | /** |
| 29 | * Gets the device information. |
| 30 | * |
| 31 | * @return device information |
| 32 | */ |
| 33 | Map<String, DeviceInformation> deviceInformationMap(); |
| 34 | |
| 35 | /** |
| 36 | * Sets the device information. |
| 37 | * |
| 38 | * @param key key used to store in map |
| 39 | * @param deviceInformationMap device information instance |
| 40 | */ |
| 41 | void setDeviceInformationMap(String key, DeviceInformation deviceInformationMap); |
| 42 | |
| 43 | /** |
| 44 | * Gets the link information. |
| 45 | * |
| 46 | * @return link information |
| 47 | */ |
| 48 | Map<String, LinkInformation> linkInformationMap(); |
| 49 | |
| 50 | /** |
| 51 | * Sets link information. |
| 52 | * |
sunishvk | f7c5655 | 2016-07-18 16:02:39 +0530 | [diff] [blame] | 53 | * @param key key used to store in map |
sunish vk | 30637eb | 2016-02-16 15:19:32 +0530 | [diff] [blame] | 54 | * @param linkInformationMap link information instance |
| 55 | */ |
| 56 | void setLinkInformationMap(String key, LinkInformation linkInformationMap); |
| 57 | |
| 58 | /** |
| 59 | * Removes link information. |
| 60 | * |
| 61 | * @param key key used to remove from map |
| 62 | */ |
| 63 | void removeLinkInformationMap(String key); |
| 64 | |
| 65 | /** |
| 66 | * Adds device information. |
| 67 | * |
| 68 | * @param ospfLsa LSA instance |
| 69 | * @param ospfInterface interface instance |
| 70 | * @param ospfArea area instance |
| 71 | */ |
| 72 | void addLocalDevice(OspfLsa ospfLsa, OspfInterface ospfInterface, OspfArea ospfArea); |
| 73 | |
| 74 | /** |
| 75 | * Removes device information. |
| 76 | * |
| 77 | * @param key key used to remove from map |
| 78 | */ |
| 79 | void removeDeviceInformationMap(String key); |
| 80 | |
| 81 | /** |
sunishvk | f7c5655 | 2016-07-18 16:02:39 +0530 | [diff] [blame] | 82 | * Removes links from link information map. |
sunish vk | 30637eb | 2016-02-16 15:19:32 +0530 | [diff] [blame] | 83 | * |
| 84 | * @param routerId router's IP address |
| 85 | */ |
| 86 | void removeLinks(Ip4Address routerId); |
| 87 | |
| 88 | /** |
| 89 | * Gets OSPF link TED details. |
| 90 | * |
| 91 | * @param key key used to retrieve from map |
| 92 | * @return links TED information |
| 93 | */ |
| 94 | OspfLinkTed getOspfLinkTedHashMap(String key); |
| 95 | |
| 96 | /** |
| 97 | * Gets all the router information to be deleted. |
| 98 | * |
| 99 | * @param ospfLsa LSA instance |
| 100 | * @param ospfArea area instance |
| 101 | * @return list of router information which needs to delete from device list |
| 102 | */ |
| 103 | List<String> getDeleteRouterInformation(OspfLsa ospfLsa, OspfArea ospfArea); |
| 104 | |
| 105 | /** |
| 106 | * Updates the device and link information. |
| 107 | * |
| 108 | * @param ospfLsa LSA instance |
| 109 | * @param ospfArea area instance |
| 110 | */ |
| 111 | void updateLinkInformation(OspfLsa ospfLsa, OspfArea ospfArea); |
sunishvk | f7c5655 | 2016-07-18 16:02:39 +0530 | [diff] [blame] | 112 | |
| 113 | /** |
| 114 | * Gets device information as map. |
| 115 | * |
| 116 | * @return deviceInformationMap to delete from core |
| 117 | */ |
| 118 | Map<String, DeviceInformation> deviceInformationMapToDelete(); |
| 119 | |
| 120 | /** |
| 121 | * Sets device information as map. |
| 122 | * |
| 123 | * @param key key to store in device info map |
| 124 | * @param deviceInformationMapToDelete device information instance |
| 125 | */ |
| 126 | void setDeviceInformationMapToDelete(String key, DeviceInformation deviceInformationMapToDelete); |
| 127 | |
| 128 | /** |
| 129 | * Removes device information from deviceInformationMapToDelete. |
| 130 | * |
| 131 | * @param key key to remove device information |
| 132 | */ |
| 133 | void removeDeviceInformationMapFromDeleteMap(String key); |
| 134 | |
| 135 | /** |
| 136 | * Gets device information as map for Point-To-Point. |
| 137 | * |
| 138 | * @return deviceInformationMap |
| 139 | */ |
| 140 | Map<String, DeviceInformation> deviceInformationMapForPointToPoint(); |
| 141 | |
| 142 | /** |
| 143 | * Sets device information as map for Point-To-Point. |
| 144 | * |
| 145 | * @param key key to store in device info |
| 146 | * @param deviceInformationMap device information instance |
| 147 | */ |
| 148 | void setDeviceInformationMapForPointToPoint(String key, DeviceInformation deviceInformationMap); |
| 149 | |
| 150 | /** |
| 151 | * Gets link information as map for Point-To-Point. |
| 152 | * |
| 153 | * @return linkInformationMap |
| 154 | */ |
| 155 | Map<String, LinkInformation> linkInformationMapForPointToPoint(); |
| 156 | |
| 157 | /** |
| 158 | * Sets link information as map for Point-To-Point. |
| 159 | * |
| 160 | * @param key key to store link info |
| 161 | * @param linkInformationMap link information instance |
| 162 | */ |
| 163 | void setLinkInformationMapForPointToPoint(String key, LinkInformation linkInformationMap); |
sunish vk | 30637eb | 2016-02-16 15:19:32 +0530 | [diff] [blame] | 164 | } |