tom | 35c0dc3 | 2014-09-19 10:00:58 -0700 | [diff] [blame] | 1 | package org.onlab.onos.net.link; |
| 2 | |
| 3 | import org.onlab.onos.net.ConnectPoint; |
| 4 | import org.onlab.onos.net.DeviceId; |
| 5 | import org.onlab.onos.net.Link; |
| 6 | import org.onlab.onos.net.provider.ProviderId; |
tom | f80c972 | 2014-09-24 14:49:18 -0700 | [diff] [blame] | 7 | import org.onlab.onos.store.Store; |
tom | 35c0dc3 | 2014-09-19 10:00:58 -0700 | [diff] [blame] | 8 | |
| 9 | import java.util.Set; |
| 10 | |
| 11 | /** |
tom | e472987 | 2014-09-23 00:37:37 -0700 | [diff] [blame] | 12 | * Manages inventory of infrastructure links; not intended for direct use. |
tom | 35c0dc3 | 2014-09-19 10:00:58 -0700 | [diff] [blame] | 13 | */ |
tom | f80c972 | 2014-09-24 14:49:18 -0700 | [diff] [blame] | 14 | public interface LinkStore extends Store<LinkEvent, LinkStoreDelegate> { |
tom | 35c0dc3 | 2014-09-19 10:00:58 -0700 | [diff] [blame] | 15 | |
| 16 | /** |
| 17 | * Returns the number of links in the store. |
| 18 | * |
| 19 | * @return number of links |
| 20 | */ |
| 21 | int getLinkCount(); |
| 22 | |
| 23 | /** |
| 24 | * Returns an iterable collection of all links in the inventory. |
| 25 | * |
| 26 | * @return collection of all links |
| 27 | */ |
| 28 | Iterable<Link> getLinks(); |
| 29 | |
| 30 | /** |
| 31 | * Returns all links egressing from the specified device. |
| 32 | * |
| 33 | * @param deviceId device identifier |
| 34 | * @return set of device links |
| 35 | */ |
| 36 | Set<Link> getDeviceEgressLinks(DeviceId deviceId); |
| 37 | |
| 38 | /** |
| 39 | * Returns all links ingressing from the specified device. |
| 40 | * |
| 41 | * @param deviceId device identifier |
| 42 | * @return set of device links |
| 43 | */ |
| 44 | Set<Link> getDeviceIngressLinks(DeviceId deviceId); |
| 45 | |
| 46 | /** |
| 47 | * Returns the link between the two end-points. |
| 48 | * |
| 49 | * @param src source connection point |
| 50 | * @param dst destination connection point |
| 51 | * @return link or null if one not found between the end-points |
| 52 | */ |
| 53 | Link getLink(ConnectPoint src, ConnectPoint dst); |
| 54 | |
| 55 | /** |
| 56 | * Returns all links egressing from the specified connection point. |
| 57 | * |
| 58 | * @param src source connection point |
| 59 | * @return set of connection point links |
| 60 | */ |
| 61 | Set<Link> getEgressLinks(ConnectPoint src); |
| 62 | |
| 63 | /** |
| 64 | * Returns all links ingressing to the specified connection point. |
| 65 | * |
| 66 | * @param dst destination connection point |
| 67 | * @return set of connection point links |
| 68 | */ |
| 69 | Set<Link> getIngressLinks(ConnectPoint dst); |
| 70 | |
| 71 | /** |
| 72 | * Creates a new link, or updates an existing one, based on the given |
| 73 | * information. |
| 74 | * |
| 75 | * @param providerId provider identity |
| 76 | * @param linkDescription link description |
| 77 | * @return create or update link event, or null if no change resulted |
| 78 | */ |
| 79 | public LinkEvent createOrUpdateLink(ProviderId providerId, |
| 80 | LinkDescription linkDescription); |
| 81 | |
| 82 | /** |
| 83 | * Removes the link based on the specified information. |
| 84 | * |
| 85 | * @param src link source |
| 86 | * @param dst link destination |
| 87 | * @return remove link event, or null if no change resulted |
| 88 | */ |
| 89 | LinkEvent removeLink(ConnectPoint src, ConnectPoint dst); |
| 90 | |
| 91 | } |