Jonathan Hart | 472062d | 2014-04-03 10:56:48 -0700 | [diff] [blame] | 1 | package net.onrc.onos.core.topology; |
Jonathan Hart | 062a2e8 | 2014-02-03 09:41:57 -0800 | [diff] [blame] | 2 | |
Pavlin Radoslavov | 1cbfcae | 2014-05-23 17:28:08 -0700 | [diff] [blame] | 3 | import net.onrc.onos.core.topology.serializers.LinkSerializer; |
| 4 | import org.codehaus.jackson.map.annotate.JsonSerialize; |
| 5 | |
Yuta HIGUCHI | ce4a06b | 2014-04-25 19:37:57 -0700 | [diff] [blame] | 6 | // 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 HIGUCHI | 181d34d | 2014-02-05 15:05:46 -0800 | [diff] [blame] | 8 | /** |
Jonathan Hart | e37e4e2 | 2014-05-13 19:12:02 -0700 | [diff] [blame] | 9 | * Interface of Link object in the topology. |
Yuta HIGUCHI | 181d34d | 2014-02-05 15:05:46 -0800 | [diff] [blame] | 10 | */ |
Pavlin Radoslavov | 1cbfcae | 2014-05-23 17:28:08 -0700 | [diff] [blame] | 11 | @JsonSerialize(using = LinkSerializer.class) |
Jonathan Hart | 062a2e8 | 2014-02-03 09:41:57 -0800 | [diff] [blame] | 12 | public interface Link { |
Pavlin Radoslavov | 7c8f69a | 2014-02-19 19:01:45 -0800 | [diff] [blame] | 13 | /** |
Yuta HIGUCHI | ce4a06b | 2014-04-25 19:37:57 -0700 | [diff] [blame] | 14 | * Gets the source switch for the link. |
Pavlin Radoslavov | 7c8f69a | 2014-02-19 19:01:45 -0800 | [diff] [blame] | 15 | * |
| 16 | * @return the source switch for the link. |
| 17 | */ |
| 18 | public Switch getSrcSwitch(); |
Toshio Koide | 0c9106d | 2014-02-19 15:26:38 -0800 | [diff] [blame] | 19 | |
Pavlin Radoslavov | 7c8f69a | 2014-02-19 19:01:45 -0800 | [diff] [blame] | 20 | /** |
Yuta HIGUCHI | ce4a06b | 2014-04-25 19:37:57 -0700 | [diff] [blame] | 21 | * Gets the source port for the link. |
Pavlin Radoslavov | 7c8f69a | 2014-02-19 19:01:45 -0800 | [diff] [blame] | 22 | * |
| 23 | * @return the source port for the link. |
| 24 | */ |
| 25 | public Port getSrcPort(); |
Toshio Koide | 2f570c1 | 2014-02-06 16:55:32 -0800 | [diff] [blame] | 26 | |
Pavlin Radoslavov | 7c8f69a | 2014-02-19 19:01:45 -0800 | [diff] [blame] | 27 | /** |
Yuta HIGUCHI | ce4a06b | 2014-04-25 19:37:57 -0700 | [diff] [blame] | 28 | * Gets the destination switch for the link. |
Pavlin Radoslavov | 7c8f69a | 2014-02-19 19:01:45 -0800 | [diff] [blame] | 29 | * |
| 30 | * @return the destination switch for the link. |
| 31 | */ |
| 32 | public Switch getDstSwitch(); |
Yuta HIGUCHI | 181d34d | 2014-02-05 15:05:46 -0800 | [diff] [blame] | 33 | |
Pavlin Radoslavov | 7c8f69a | 2014-02-19 19:01:45 -0800 | [diff] [blame] | 34 | /** |
Yuta HIGUCHI | ce4a06b | 2014-04-25 19:37:57 -0700 | [diff] [blame] | 35 | * Gets the destination port for the link. |
Pavlin Radoslavov | 7c8f69a | 2014-02-19 19:01:45 -0800 | [diff] [blame] | 36 | * |
| 37 | * @return the destination port for the link. |
| 38 | */ |
| 39 | public Port getDstPort(); |
| 40 | |
| 41 | /** |
Yuta HIGUCHI | ce4a06b | 2014-04-25 19:37:57 -0700 | [diff] [blame] | 42 | * Gets the last seen time for the link. |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 43 | * <p/> |
Pavlin Radoslavov | 7c8f69a | 2014-02-19 19:01:45 -0800 | [diff] [blame] | 44 | * 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 HIGUCHI | ce4a06b | 2014-04-25 19:37:57 -0700 | [diff] [blame] | 52 | * Gets the link cost. |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 53 | * <p/> |
Pavlin Radoslavov | 7c8f69a | 2014-02-19 19:01:45 -0800 | [diff] [blame] | 54 | * TODO: What is the unit? |
| 55 | * |
Yuta HIGUCHI | d7b5094 | 2014-05-22 20:26:56 -0700 | [diff] [blame] | 56 | * @return the link cost. |
Pavlin Radoslavov | 7c8f69a | 2014-02-19 19:01:45 -0800 | [diff] [blame] | 57 | */ |
| 58 | public int getCost(); |
| 59 | |
| 60 | /** |
Yuta HIGUCHI | ce4a06b | 2014-04-25 19:37:57 -0700 | [diff] [blame] | 61 | * Gets the link capacity. |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 62 | * <p/> |
Pavlin Radoslavov | 7c8f69a | 2014-02-19 19:01:45 -0800 | [diff] [blame] | 63 | * TODO: What is the unit? |
| 64 | * |
| 65 | * @return the link capacity. |
| 66 | */ |
| 67 | public Double getCapacity(); |
Jonathan Hart | 062a2e8 | 2014-02-03 09:41:57 -0800 | [diff] [blame] | 68 | } |