blob: 4391471766e977daf462d5c82e5ca0a96e31be6d [file] [log] [blame]
tom35c0dc32014-09-19 10:00:58 -07001package org.onlab.onos.net.link;
2
3import org.onlab.onos.net.ConnectPoint;
4import org.onlab.onos.net.DeviceId;
5import org.onlab.onos.net.Link;
6import org.onlab.onos.net.provider.ProviderId;
7
8import java.util.Set;
9
10/**
tom5bcc9462014-09-19 10:11:31 -070011 * Manages inventory of infrastructure links. It may do so using whatever
12 * means are appropriate.
tom35c0dc32014-09-19 10:00:58 -070013 */
14public interface LinkStore {
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}