blob: 768d290845be6a072511b134388cba7417219fd4 [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;
4
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)
Jonathan Hart062a2e82014-02-03 09:41:57 -080013public interface Link {
Pavlin Radoslavov7c8f69a2014-02-19 19:01:45 -080014 /**
Yuta HIGUCHIce4a06b2014-04-25 19:37:57 -070015 * Gets the source switch for the link.
Pavlin Radoslavov7c8f69a2014-02-19 19:01:45 -080016 *
17 * @return the source switch for the link.
18 */
19 public Switch getSrcSwitch();
Toshio Koide0c9106d2014-02-19 15:26:38 -080020
Pavlin Radoslavov7c8f69a2014-02-19 19:01:45 -080021 /**
Yuta HIGUCHIce4a06b2014-04-25 19:37:57 -070022 * Gets the source port for the link.
Pavlin Radoslavov7c8f69a2014-02-19 19:01:45 -080023 *
24 * @return the source port for the link.
25 */
26 public Port getSrcPort();
Toshio Koide2f570c12014-02-06 16:55:32 -080027
Pavlin Radoslavov7c8f69a2014-02-19 19:01:45 -080028 /**
Yuta HIGUCHIce4a06b2014-04-25 19:37:57 -070029 * Gets the destination switch for the link.
Pavlin Radoslavov7c8f69a2014-02-19 19:01:45 -080030 *
31 * @return the destination switch for the link.
32 */
33 public Switch getDstSwitch();
Yuta HIGUCHI181d34d2014-02-05 15:05:46 -080034
Pavlin Radoslavov7c8f69a2014-02-19 19:01:45 -080035 /**
Yuta HIGUCHIce4a06b2014-04-25 19:37:57 -070036 * Gets the destination port for the link.
Pavlin Radoslavov7c8f69a2014-02-19 19:01:45 -080037 *
38 * @return the destination port for the link.
39 */
40 public Port getDstPort();
41
42 /**
Yuta HIGUCHIce4a06b2014-04-25 19:37:57 -070043 * Gets the last seen time for the link.
Ray Milkey269ffb92014-04-03 14:43:30 -070044 * <p/>
Pavlin Radoslavov7c8f69a2014-02-19 19:01:45 -080045 * TODO: Not implemented yet.
46 * TODO: what is the time definition?
47 *
48 * @return the last seen time for the link.
49 */
50 public long getLastSeenTime();
51
52 /**
Yuta HIGUCHIce4a06b2014-04-25 19:37:57 -070053 * Gets the link cost.
Ray Milkey269ffb92014-04-03 14:43:30 -070054 * <p/>
Pavlin Radoslavov7c8f69a2014-02-19 19:01:45 -080055 * TODO: What is the unit?
56 *
Yuta HIGUCHId7b50942014-05-22 20:26:56 -070057 * @return the link cost.
Pavlin Radoslavov7c8f69a2014-02-19 19:01:45 -080058 */
59 public int getCost();
60
61 /**
Yuta HIGUCHIce4a06b2014-04-25 19:37:57 -070062 * Gets the link capacity.
Ray Milkey269ffb92014-04-03 14:43:30 -070063 * <p/>
Pavlin Radoslavov7c8f69a2014-02-19 19:01:45 -080064 * TODO: What is the unit?
65 *
66 * @return the link capacity.
67 */
68 public Double getCapacity();
Jonathan Hart062a2e82014-02-03 09:41:57 -080069}