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