blob: 7782188b14235cdc75892ece95fff280d991c6aa [file] [log] [blame]
Jonathan Hart472062d2014-04-03 10:56:48 -07001package net.onrc.onos.core.topology;
Jonathan Hart062a2e82014-02-03 09:41:57 -08002
Pavlin Radoslavov1cbfcae2014-05-23 17:28:08 -07003import net.onrc.onos.core.topology.serializers.LinkSerializer;
4import org.codehaus.jackson.map.annotate.JsonSerialize;
5
Yuta HIGUCHIce4a06b2014-04-25 19:37:57 -07006// TODO Everything returned by these interfaces must be either Unmodifiable view,
7// immutable object, or a copy of the original "SB" In-memory Topology.
Yuta HIGUCHI181d34d2014-02-05 15:05:46 -08008/**
Jonathan Harte37e4e22014-05-13 19:12:02 -07009 * Interface of Link object in the topology.
Yuta HIGUCHI181d34d2014-02-05 15:05:46 -080010 */
Pavlin Radoslavov1cbfcae2014-05-23 17:28:08 -070011@JsonSerialize(using = LinkSerializer.class)
Jonathan Hart062a2e82014-02-03 09:41:57 -080012public interface Link {
Pavlin Radoslavov7c8f69a2014-02-19 19:01:45 -080013 /**
Yuta HIGUCHIce4a06b2014-04-25 19:37:57 -070014 * Gets the source switch for the link.
Pavlin Radoslavov7c8f69a2014-02-19 19:01:45 -080015 *
16 * @return the source switch for the link.
17 */
18 public Switch getSrcSwitch();
Toshio Koide0c9106d2014-02-19 15:26:38 -080019
Pavlin Radoslavov7c8f69a2014-02-19 19:01:45 -080020 /**
Yuta HIGUCHIce4a06b2014-04-25 19:37:57 -070021 * Gets the source port for the link.
Pavlin Radoslavov7c8f69a2014-02-19 19:01:45 -080022 *
23 * @return the source port for the link.
24 */
25 public Port getSrcPort();
Toshio Koide2f570c12014-02-06 16:55:32 -080026
Pavlin Radoslavov7c8f69a2014-02-19 19:01:45 -080027 /**
Yuta HIGUCHIce4a06b2014-04-25 19:37:57 -070028 * Gets the destination switch for the link.
Pavlin Radoslavov7c8f69a2014-02-19 19:01:45 -080029 *
30 * @return the destination switch for the link.
31 */
32 public Switch getDstSwitch();
Yuta HIGUCHI181d34d2014-02-05 15:05:46 -080033
Pavlin Radoslavov7c8f69a2014-02-19 19:01:45 -080034 /**
Yuta HIGUCHIce4a06b2014-04-25 19:37:57 -070035 * Gets the destination port for the link.
Pavlin Radoslavov7c8f69a2014-02-19 19:01:45 -080036 *
37 * @return the destination port for the link.
38 */
39 public Port getDstPort();
40
41 /**
Yuta HIGUCHIce4a06b2014-04-25 19:37:57 -070042 * Gets the last seen time for the link.
Ray Milkey269ffb92014-04-03 14:43:30 -070043 * <p/>
Pavlin Radoslavov7c8f69a2014-02-19 19:01:45 -080044 * TODO: Not implemented yet.
45 * TODO: what is the time definition?
46 *
47 * @return the last seen time for the link.
48 */
49 public long getLastSeenTime();
50
51 /**
Yuta HIGUCHIce4a06b2014-04-25 19:37:57 -070052 * Gets the link cost.
Ray Milkey269ffb92014-04-03 14:43:30 -070053 * <p/>
Pavlin Radoslavov7c8f69a2014-02-19 19:01:45 -080054 * TODO: What is the unit?
55 *
Yuta HIGUCHId7b50942014-05-22 20:26:56 -070056 * @return the link cost.
Pavlin Radoslavov7c8f69a2014-02-19 19:01:45 -080057 */
58 public int getCost();
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();
Jonathan Hart062a2e82014-02-03 09:41:57 -080068}