blob: db060a25e4285c8091e94b70476523f84acafded [file] [log] [blame]
tomedf06bb2014-08-27 16:22:15 -07001package org.onlab.onos.net.link;
2
alshabibb5522ff2014-09-29 19:20:00 -07003import java.util.Set;
4
tomeadbb462014-09-07 16:10:19 -07005import org.onlab.onos.net.ConnectPoint;
tomedf06bb2014-08-27 16:22:15 -07006import org.onlab.onos.net.DeviceId;
7import org.onlab.onos.net.Link;
8
tomedf06bb2014-08-27 16:22:15 -07009/**
10 * Service for interacting with the inventory of infrastructure links.
11 */
12public interface LinkService {
13
14 /**
tomeadbb462014-09-07 16:10:19 -070015 * Returns the count of all known infrastructure links.
16 *
17 * @return number of infrastructure links
18 */
19 int getLinkCount();
20
21 /**
tomedf06bb2014-08-27 16:22:15 -070022 * Returns a collection of all known infrastructure links.
23 *
24 * @return all infrastructure links
25 */
26 Iterable<Link> getLinks();
27
28 /**
29 * Returns set of all infrastructure links leading to and from the
30 * specified device.
31 *
32 * @param deviceId device identifier
33 * @return set of device links
34 */
35 Set<Link> getDeviceLinks(DeviceId deviceId);
36
37 /**
38 * Returns set of all infrastructure links leading from the specified device.
39 *
40 * @param deviceId device identifier
41 * @return set of device egress links
42 */
43 Set<Link> getDeviceEgressLinks(DeviceId deviceId);
44
45 /**
46 * Returns set of all infrastructure links leading to the specified device.
47 *
48 * @param deviceId device identifier
49 * @return set of device ingress links
50 */
tomd176fc42014-09-08 00:12:30 -070051 Set<Link> getDeviceIngressLinks(DeviceId deviceId);
tomedf06bb2014-08-27 16:22:15 -070052
53 /**
tomeadbb462014-09-07 16:10:19 -070054 * Returns set of all infrastructure links leading to and from the
55 * specified connection point.
56 *
57 * @param connectPoint connection point
58 * @return set of links
59 */
60 Set<Link> getLinks(ConnectPoint connectPoint);
61
62 /**
63 * Returns set of all infrastructure links leading from the specified
64 * connection point.
65 *
66 * @param connectPoint connection point
67 * @return set of device egress links
68 */
69 Set<Link> getEgressLinks(ConnectPoint connectPoint);
70
71 /**
72 * Returns set of all infrastructure links leading to the specified
73 * connection point.
74 *
75 * @param connectPoint connection point
76 * @return set of device ingress links
77 */
tomd176fc42014-09-08 00:12:30 -070078 Set<Link> getIngressLinks(ConnectPoint connectPoint);
tomeadbb462014-09-07 16:10:19 -070079
80 /**
tomd176fc42014-09-08 00:12:30 -070081 * Returns the infrastructure links between the specified source
tomeadbb462014-09-07 16:10:19 -070082 * and destination connection points.
83 *
84 * @param src source connection point
85 * @param dst destination connection point
tomd176fc42014-09-08 00:12:30 -070086 * @return link from source to destination; null if none found
tomeadbb462014-09-07 16:10:19 -070087 */
tomd176fc42014-09-08 00:12:30 -070088 Link getLink(ConnectPoint src, ConnectPoint dst);
tomeadbb462014-09-07 16:10:19 -070089
90 /**
tomedf06bb2014-08-27 16:22:15 -070091 * Adds the specified link listener.
92 *
93 * @param listener link listener
94 */
95 void addListener(LinkListener listener);
96
97 /**
98 * Removes the specified link listener.
99 *
100 * @param listener link listener
101 */
102 void removeListener(LinkListener listener);
103
104}