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 | |
Yuta HIGUCHI | a7f1cdd | 2014-06-09 15:05:20 -0700 | [diff] [blame] | 3 | import net.onrc.onos.core.topology.web.serializers.LinkSerializer; |
Yuta HIGUCHI | 02ccb8c | 2014-07-10 11:29:45 -0700 | [diff] [blame] | 4 | import net.onrc.onos.core.util.LinkTuple; |
Pavlin Radoslavov | 1cbfcae | 2014-05-23 17:28:08 -0700 | [diff] [blame] | 5 | import org.codehaus.jackson.map.annotate.JsonSerialize; |
| 6 | |
Yuta HIGUCHI | ce4a06b | 2014-04-25 19:37:57 -0700 | [diff] [blame] | 7 | // 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 HIGUCHI | 181d34d | 2014-02-05 15:05:46 -0800 | [diff] [blame] | 9 | /** |
Jonathan Hart | e37e4e2 | 2014-05-13 19:12:02 -0700 | [diff] [blame] | 10 | * Interface of Link object in the topology. |
Yuta HIGUCHI | 181d34d | 2014-02-05 15:05:46 -0800 | [diff] [blame] | 11 | */ |
Pavlin Radoslavov | 1cbfcae | 2014-05-23 17:28:08 -0700 | [diff] [blame] | 12 | @JsonSerialize(using = LinkSerializer.class) |
Yuta HIGUCHI | 692e68e | 2014-07-09 18:08:02 -0700 | [diff] [blame] | 13 | public interface Link extends ITopologyElement, StringAttributes { |
Yuta HIGUCHI | 02ccb8c | 2014-07-10 11:29:45 -0700 | [diff] [blame] | 14 | |
| 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 Radoslavov | 7c8f69a | 2014-02-19 19:01:45 -0800 | [diff] [blame] | 22 | /** |
Yuta HIGUCHI | ce4a06b | 2014-04-25 19:37:57 -0700 | [diff] [blame] | 23 | * Gets the source switch for the link. |
Pavlin Radoslavov | 7c8f69a | 2014-02-19 19:01:45 -0800 | [diff] [blame] | 24 | * |
| 25 | * @return the source switch for the link. |
| 26 | */ |
| 27 | public Switch getSrcSwitch(); |
Toshio Koide | 0c9106d | 2014-02-19 15:26:38 -0800 | [diff] [blame] | 28 | |
Pavlin Radoslavov | 7c8f69a | 2014-02-19 19:01:45 -0800 | [diff] [blame] | 29 | /** |
Yuta HIGUCHI | ce4a06b | 2014-04-25 19:37:57 -0700 | [diff] [blame] | 30 | * Gets the source port for the link. |
Pavlin Radoslavov | 7c8f69a | 2014-02-19 19:01:45 -0800 | [diff] [blame] | 31 | * |
| 32 | * @return the source port for the link. |
| 33 | */ |
| 34 | public Port getSrcPort(); |
Toshio Koide | 2f570c1 | 2014-02-06 16:55:32 -0800 | [diff] [blame] | 35 | |
Pavlin Radoslavov | 7c8f69a | 2014-02-19 19:01:45 -0800 | [diff] [blame] | 36 | /** |
Yuta HIGUCHI | ce4a06b | 2014-04-25 19:37:57 -0700 | [diff] [blame] | 37 | * Gets the destination switch for the link. |
Pavlin Radoslavov | 7c8f69a | 2014-02-19 19:01:45 -0800 | [diff] [blame] | 38 | * |
| 39 | * @return the destination switch for the link. |
| 40 | */ |
| 41 | public Switch getDstSwitch(); |
Yuta HIGUCHI | 181d34d | 2014-02-05 15:05:46 -0800 | [diff] [blame] | 42 | |
Pavlin Radoslavov | 7c8f69a | 2014-02-19 19:01:45 -0800 | [diff] [blame] | 43 | /** |
Yuta HIGUCHI | ce4a06b | 2014-04-25 19:37:57 -0700 | [diff] [blame] | 44 | * Gets the destination port for the link. |
Pavlin Radoslavov | 7c8f69a | 2014-02-19 19:01:45 -0800 | [diff] [blame] | 45 | * |
| 46 | * @return the destination port for the link. |
| 47 | */ |
| 48 | public Port getDstPort(); |
| 49 | |
| 50 | /** |
Yuta HIGUCHI | ce4a06b | 2014-04-25 19:37:57 -0700 | [diff] [blame] | 51 | * Gets the last seen time for the link. |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 52 | * <p/> |
Pavlin Radoslavov | 7c8f69a | 2014-02-19 19:01:45 -0800 | [diff] [blame] | 53 | * 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 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(); |
Praseed Balakrishnan | fa21be1 | 2014-07-15 14:42:26 -0700 | [diff] [blame] | 68 | |
| 69 | /** |
| 70 | * Returns the link type of the link. |
| 71 | * |
| 72 | * @return {@link LinkType} for this link |
| 73 | */ |
| 74 | public LinkType getLinkType(); |
Jonathan Hart | 062a2e8 | 2014-02-03 09:41:57 -0800 | [diff] [blame] | 75 | } |