Jonathan Hart | 062a2e8 | 2014-02-03 09:41:57 -0800 | [diff] [blame] | 1 | package net.onrc.onos.ofcontroller.networkgraph; |
| 2 | |
| 3 | import java.util.Collection; |
| 4 | |
Yuta HIGUCHI | 181d34d | 2014-02-05 15:05:46 -0800 | [diff] [blame] | 5 | /** |
| 6 | * Interface of Switch Object exposed to the "NB" read-only Topology. |
| 7 | * |
| 8 | * Everything returned by these interfaces must be either Unmodifiable view, |
| 9 | * immutable object, or a copy of the original "SB" In-memory Topology. |
| 10 | * |
| 11 | */ |
Jonathan Hart | 062a2e8 | 2014-02-03 09:41:57 -0800 | [diff] [blame] | 12 | public interface Switch { |
Toshio Koide | 2f570c1 | 2014-02-06 16:55:32 -0800 | [diff] [blame] | 13 | public Long getDpid(); |
Yuta HIGUCHI | 181d34d | 2014-02-05 15:05:46 -0800 | [diff] [blame] | 14 | |
Jonathan Hart | 062a2e8 | 2014-02-03 09:41:57 -0800 | [diff] [blame] | 15 | public Collection<Port> getPorts(); |
Yuta HIGUCHI | 181d34d | 2014-02-05 15:05:46 -0800 | [diff] [blame] | 16 | |
Toshio Koide | 2f570c1 | 2014-02-06 16:55:32 -0800 | [diff] [blame] | 17 | public Port getPort(Long number); |
Yuta HIGUCHI | 181d34d | 2014-02-05 15:05:46 -0800 | [diff] [blame] | 18 | |
| 19 | |
Jonathan Hart | 062a2e8 | 2014-02-03 09:41:57 -0800 | [diff] [blame] | 20 | // Graph traversal API |
Yuta HIGUCHI | 9b028ca | 2014-02-11 14:07:58 -0800 | [diff] [blame] | 21 | // XXX What is the Definition of neighbor? Link exist in both direction or one-way is sufficient to be a neighbor, etc. |
Jonathan Hart | 062a2e8 | 2014-02-03 09:41:57 -0800 | [diff] [blame] | 22 | public Iterable<Switch> getNeighbors(); |
Yuta HIGUCHI | 181d34d | 2014-02-05 15:05:46 -0800 | [diff] [blame] | 23 | |
Toshio Koide | 2f570c1 | 2014-02-06 16:55:32 -0800 | [diff] [blame] | 24 | public Iterable<Link> getOutgoingLinks(); |
| 25 | public Iterable<Link> getIncomingLinks(); |
Yuta HIGUCHI | 181d34d | 2014-02-05 15:05:46 -0800 | [diff] [blame] | 26 | |
Toshio Koide | 2f570c1 | 2014-02-06 16:55:32 -0800 | [diff] [blame] | 27 | public Link getLinkToNeighbor(Long dpid); |
Yuta HIGUCHI | 181d34d | 2014-02-05 15:05:46 -0800 | [diff] [blame] | 28 | |
Yuta HIGUCHI | cb95198 | 2014-02-11 13:31:44 -0800 | [diff] [blame] | 29 | // XXX Iterable or Collection? |
Jonathan Hart | 062a2e8 | 2014-02-03 09:41:57 -0800 | [diff] [blame] | 30 | public Collection<Device> getDevices(); |
| 31 | } |