Satish K | f6d87cb | 2015-11-30 19:59:22 +0530 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2015-present Open Networking Foundation |
Satish K | f6d87cb | 2015-11-30 19:59:22 +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.iptopology.api.link; |
| 17 | |
| 18 | import java.util.Set; |
| 19 | |
| 20 | import org.onosproject.event.ListenerService; |
| 21 | import org.onosproject.iptopology.api.IpLink; |
| 22 | import org.onosproject.iptopology.api.TerminationPoint; |
| 23 | import org.onosproject.net.DeviceId; |
| 24 | |
| 25 | /** |
| 26 | * Service for interacting with the inventory of infrastructure links. |
| 27 | */ |
| 28 | public interface IpLinkService |
| 29 | extends ListenerService<IpLinkEvent, IpLinkListener> { |
| 30 | |
| 31 | /** |
| 32 | * Returns the count of all known ip links. |
| 33 | * |
| 34 | * @return number of ip links |
| 35 | */ |
| 36 | int getIpLinkCount(); |
| 37 | |
| 38 | /** |
| 39 | * Returns a collection of all ip links. |
| 40 | * |
| 41 | * @return all ip links |
| 42 | */ |
| 43 | Iterable<IpLink> getIpLinks(); |
| 44 | |
| 45 | |
| 46 | /** |
| 47 | * Returns set of all ip links leading to and from the |
| 48 | * specified ip device. |
| 49 | * |
| 50 | * @param deviceId device identifier |
| 51 | * @return set of ip device links |
| 52 | */ |
| 53 | Set<IpLink> getIpDeviceLinks(DeviceId deviceId); |
| 54 | |
| 55 | /** |
| 56 | * Returns set of all ip links leading from the specified ip device. |
| 57 | * |
| 58 | * @param deviceId device identifier |
| 59 | * @return set of ip device egress links |
| 60 | */ |
| 61 | Set<IpLink> getIpDeviceEgressLinks(DeviceId deviceId); |
| 62 | |
| 63 | /** |
| 64 | * Returns set of all ip links leading to the specified ip device. |
| 65 | * |
| 66 | * @param deviceId device identifier |
| 67 | * @return set of ip device ingress links |
| 68 | */ |
| 69 | Set<IpLink> getIpDeviceIngressLinks(DeviceId deviceId); |
| 70 | |
| 71 | /** |
| 72 | * Returns set of all ip links leading to and from the |
| 73 | * specified termination point. |
| 74 | * |
| 75 | * @param terminationPoint termination point |
| 76 | * @return set of ip links |
| 77 | */ |
| 78 | Set<IpLink> getIpLinks(TerminationPoint terminationPoint); |
| 79 | |
| 80 | /** |
| 81 | * Returns set of all ip links leading from the specified |
| 82 | * termination point. |
| 83 | * |
| 84 | * @param terminationPoint termination point |
| 85 | * @return set of ip device egress links |
| 86 | */ |
| 87 | Set<IpLink> getEgressIpLinks(TerminationPoint terminationPoint); |
| 88 | |
| 89 | /** |
| 90 | * Returns set of all ip links leading to the specified |
| 91 | * termination point. |
| 92 | * |
| 93 | * @param terminationPoint termination point |
| 94 | * @return set of ip device ingress links |
| 95 | */ |
| 96 | Set<IpLink> getIngressIpLinks(TerminationPoint terminationPoint); |
| 97 | |
| 98 | /** |
| 99 | * Returns the ip links between the specified source |
| 100 | * and destination termination points. |
| 101 | * |
| 102 | * @param src source termination point |
| 103 | * @param dst destination termination point |
| 104 | * @return ip link from source to destination; null if none found |
| 105 | */ |
| 106 | IpLink getIpLink(TerminationPoint src, TerminationPoint dst); |
| 107 | |
| 108 | } |