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 | ce4a06b | 2014-04-25 19:37:57 -0700 | [diff] [blame] | 3 | // TODO Everything returned by these interfaces must be either Unmodifiable view, |
| 4 | // immutable object, or a copy of the original "SB" In-memory Topology. |
Yuta HIGUCHI | 181d34d | 2014-02-05 15:05:46 -0800 | [diff] [blame] | 5 | /** |
Yuta HIGUCHI | ce4a06b | 2014-04-25 19:37:57 -0700 | [diff] [blame] | 6 | * Interface of Port object in Network Graph topology. |
Yuta HIGUCHI | 181d34d | 2014-02-05 15:05:46 -0800 | [diff] [blame] | 7 | */ |
Jonathan Hart | 062a2e8 | 2014-02-03 09:41:57 -0800 | [diff] [blame] | 8 | public interface Port { |
Yuta HIGUCHI | ce4a06b | 2014-04-25 19:37:57 -0700 | [diff] [blame] | 9 | |
| 10 | /** |
| 11 | * Gets the data path ID (dpid) of the switch, which this port is on. |
| 12 | * |
| 13 | * @return data path ID (dpid) |
| 14 | */ |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 15 | public Long getDpid(); |
Yuta HIGUCHI | 181d34d | 2014-02-05 15:05:46 -0800 | [diff] [blame] | 16 | |
Yuta HIGUCHI | ce4a06b | 2014-04-25 19:37:57 -0700 | [diff] [blame] | 17 | /** |
| 18 | * Gets the port number of this port. |
| 19 | * |
| 20 | * @return port number |
| 21 | */ |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 22 | public Long getNumber(); |
Yuta HIGUCHI | 181d34d | 2014-02-05 15:05:46 -0800 | [diff] [blame] | 23 | |
Yuta HIGUCHI | ce4a06b | 2014-04-25 19:37:57 -0700 | [diff] [blame] | 24 | /** |
| 25 | * Gets the hardware address of this port. |
| 26 | * <p/> |
| 27 | * TODO Not implemented yet. |
| 28 | * TODO Should return value type be Long? |
| 29 | * |
| 30 | * @return hardware address |
| 31 | */ |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 32 | public Long getHardwareAddress(); |
Yuta HIGUCHI | 4bfdd53 | 2014-02-07 13:47:36 -0800 | [diff] [blame] | 33 | |
Yuta HIGUCHI | ce4a06b | 2014-04-25 19:37:57 -0700 | [diff] [blame] | 34 | /** |
| 35 | * Description of this port. |
| 36 | * <p/> |
| 37 | * TODO Not implemented yet. |
| 38 | * |
| 39 | * @return description of this port |
| 40 | */ |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 41 | public String getDescription(); |
| 42 | |
Yuta HIGUCHI | ce4a06b | 2014-04-25 19:37:57 -0700 | [diff] [blame] | 43 | /** |
| 44 | * Gets the parent switch. |
| 45 | * |
| 46 | * @return {@link Switch} instance |
| 47 | */ |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 48 | public Switch getSwitch(); |
| 49 | |
Yuta HIGUCHI | ce4a06b | 2014-04-25 19:37:57 -0700 | [diff] [blame] | 50 | /** |
| 51 | * Gets the outgoing link from this port. |
| 52 | * |
| 53 | * @return {@link Link} if there exist a outgoing link from this, |
| 54 | * {@code null} otherwise. |
| 55 | */ |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 56 | public Link getOutgoingLink(); |
| 57 | |
Yuta HIGUCHI | ce4a06b | 2014-04-25 19:37:57 -0700 | [diff] [blame] | 58 | /** |
| 59 | * Gets the incoming link to this port. |
| 60 | * |
| 61 | * @return {@link Link} if there exist a incoming link to this, {@code null} |
| 62 | * otherwise. |
| 63 | */ |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 64 | public Link getIncomingLink(); |
| 65 | |
Yuta HIGUCHI | ce4a06b | 2014-04-25 19:37:57 -0700 | [diff] [blame] | 66 | // XXX Iterable or Collection? |
| 67 | /** |
| 68 | * Gets all the devices attached to this port. |
| 69 | * |
| 70 | * @return {@link Device}s attached to this port |
| 71 | */ |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 72 | public Iterable<Device> getDevices(); |
Jonathan Hart | 062a2e8 | 2014-02-03 09:41:57 -0800 | [diff] [blame] | 73 | } |