blob: 0197417e0723f4d7216914966d1b9f6fef877bd6 [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;
tomf80c9722014-09-24 14:49:18 -07007import org.onlab.onos.store.Store;
tom35c0dc32014-09-19 10:00:58 -07008
9import java.util.Set;
10
11/**
tome4729872014-09-23 00:37:37 -070012 * Manages inventory of infrastructure links; not intended for direct use.
tom35c0dc32014-09-19 10:00:58 -070013 */
tomf80c9722014-09-24 14:49:18 -070014public interface LinkStore extends Store<LinkEvent, LinkStoreDelegate> {
tom35c0dc32014-09-19 10:00:58 -070015
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}