blob: 087110f1ec88f7bdbfd29136e28ad6d6baaec6d2 [file] [log] [blame]
Jonathan Hart472062d2014-04-03 10:56:48 -07001package net.onrc.onos.core.topology;
Jonathan Hart062a2e82014-02-03 09:41:57 -08002
Yuta HIGUCHIa7f1cdd2014-06-09 15:05:20 -07003import net.onrc.onos.core.topology.web.serializers.LinkSerializer;
Yuta HIGUCHI02ccb8c2014-07-10 11:29:45 -07004import net.onrc.onos.core.util.LinkTuple;
Pavlin Radoslavov1cbfcae2014-05-23 17:28:08 -07005import org.codehaus.jackson.map.annotate.JsonSerialize;
6
Yuta HIGUCHIce4a06b2014-04-25 19:37:57 -07007// TODO Everything returned by these interfaces must be either Unmodifiable view,
8// immutable object, or a copy of the original "SB" In-memory Topology.
Yuta HIGUCHI181d34d2014-02-05 15:05:46 -08009/**
Jonathan Harte37e4e22014-05-13 19:12:02 -070010 * Interface of Link object in the topology.
Yuta HIGUCHI181d34d2014-02-05 15:05:46 -080011 */
Pavlin Radoslavov1cbfcae2014-05-23 17:28:08 -070012@JsonSerialize(using = LinkSerializer.class)
Yuta HIGUCHI692e68e2014-07-09 18:08:02 -070013public interface Link extends ITopologyElement, StringAttributes {
Yuta HIGUCHI02ccb8c2014-07-10 11:29:45 -070014
15 /**
16 * Gets a {@link LinkTuple} that identifies this link.
17 *
18 * @return a LinkTuple representing the Port
19 */
20 public LinkTuple getLinkTuple();
21
Pavlin Radoslavov7c8f69a2014-02-19 19:01:45 -080022 /**
Yuta HIGUCHIce4a06b2014-04-25 19:37:57 -070023 * Gets the source switch for the link.
Pavlin Radoslavov7c8f69a2014-02-19 19:01:45 -080024 *
25 * @return the source switch for the link.
26 */
27 public Switch getSrcSwitch();
Toshio Koide0c9106d2014-02-19 15:26:38 -080028
Pavlin Radoslavov7c8f69a2014-02-19 19:01:45 -080029 /**
Yuta HIGUCHIce4a06b2014-04-25 19:37:57 -070030 * Gets the source port for the link.
Pavlin Radoslavov7c8f69a2014-02-19 19:01:45 -080031 *
32 * @return the source port for the link.
33 */
34 public Port getSrcPort();
Toshio Koide2f570c12014-02-06 16:55:32 -080035
Pavlin Radoslavov7c8f69a2014-02-19 19:01:45 -080036 /**
Yuta HIGUCHIce4a06b2014-04-25 19:37:57 -070037 * Gets the destination switch for the link.
Pavlin Radoslavov7c8f69a2014-02-19 19:01:45 -080038 *
39 * @return the destination switch for the link.
40 */
41 public Switch getDstSwitch();
Yuta HIGUCHI181d34d2014-02-05 15:05:46 -080042
Pavlin Radoslavov7c8f69a2014-02-19 19:01:45 -080043 /**
Yuta HIGUCHIce4a06b2014-04-25 19:37:57 -070044 * Gets the destination port for the link.
Pavlin Radoslavov7c8f69a2014-02-19 19:01:45 -080045 *
46 * @return the destination port for the link.
47 */
48 public Port getDstPort();
49
50 /**
Yuta HIGUCHIce4a06b2014-04-25 19:37:57 -070051 * Gets the last seen time for the link.
Ray Milkey269ffb92014-04-03 14:43:30 -070052 * <p/>
Pavlin Radoslavov7c8f69a2014-02-19 19:01:45 -080053 * TODO: Not implemented yet.
54 * TODO: what is the time definition?
55 *
56 * @return the last seen time for the link.
57 */
58 public long getLastSeenTime();
59
60 /**
Yuta HIGUCHIce4a06b2014-04-25 19:37:57 -070061 * Gets the link capacity.
Ray Milkey269ffb92014-04-03 14:43:30 -070062 * <p/>
Pavlin Radoslavov7c8f69a2014-02-19 19:01:45 -080063 * TODO: What is the unit?
64 *
65 * @return the link capacity.
66 */
67 public Double getCapacity();
Praseed Balakrishnanfa21be12014-07-15 14:42:26 -070068
69 /**
70 * Returns the link type of the link.
71 *
72 * @return {@link LinkType} for this link
73 */
74 public LinkType getLinkType();
Jonathan Hart062a2e82014-02-03 09:41:57 -080075}