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 | |
| 5 | import net.onrc.onos.ofcontroller.util.FlowEntry; |
| 6 | |
Yuta HIGUCHI | 181d34d | 2014-02-05 15:05:46 -0800 | [diff] [blame] | 7 | /** |
| 8 | * Interface of Switch Object exposed to the "NB" read-only Topology. |
| 9 | * |
| 10 | * Everything returned by these interfaces must be either Unmodifiable view, |
| 11 | * immutable object, or a copy of the original "SB" In-memory Topology. |
| 12 | * |
| 13 | */ |
Jonathan Hart | 062a2e8 | 2014-02-03 09:41:57 -0800 | [diff] [blame] | 14 | public interface Switch { |
Toshio Koide | 2f570c1 | 2014-02-06 16:55:32 -0800 | [diff] [blame] | 15 | public Long getDpid(); |
Yuta HIGUCHI | 181d34d | 2014-02-05 15:05:46 -0800 | [diff] [blame] | 16 | |
Jonathan Hart | 062a2e8 | 2014-02-03 09:41:57 -0800 | [diff] [blame] | 17 | public Collection<Port> getPorts(); |
Yuta HIGUCHI | 181d34d | 2014-02-05 15:05:46 -0800 | [diff] [blame] | 18 | |
Toshio Koide | 2f570c1 | 2014-02-06 16:55:32 -0800 | [diff] [blame] | 19 | public Port getPort(Long number); |
Yuta HIGUCHI | 181d34d | 2014-02-05 15:05:46 -0800 | [diff] [blame] | 20 | |
| 21 | |
Jonathan Hart | 062a2e8 | 2014-02-03 09:41:57 -0800 | [diff] [blame] | 22 | // Flows |
| 23 | public Collection<FlowEntry> getFlowEntries(); |
Yuta HIGUCHI | 181d34d | 2014-02-05 15:05:46 -0800 | [diff] [blame] | 24 | |
Jonathan Hart | 062a2e8 | 2014-02-03 09:41:57 -0800 | [diff] [blame] | 25 | // Graph traversal API |
| 26 | public Iterable<Switch> getNeighbors(); |
Yuta HIGUCHI | 181d34d | 2014-02-05 15:05:46 -0800 | [diff] [blame] | 27 | |
Toshio Koide | 2f570c1 | 2014-02-06 16:55:32 -0800 | [diff] [blame] | 28 | public Iterable<Link> getOutgoingLinks(); |
| 29 | public Iterable<Link> getIncomingLinks(); |
Yuta HIGUCHI | 181d34d | 2014-02-05 15:05:46 -0800 | [diff] [blame] | 30 | |
Toshio Koide | 2f570c1 | 2014-02-06 16:55:32 -0800 | [diff] [blame] | 31 | public Link getLinkToNeighbor(Long dpid); |
Yuta HIGUCHI | 181d34d | 2014-02-05 15:05:46 -0800 | [diff] [blame] | 32 | |
Jonathan Hart | 062a2e8 | 2014-02-03 09:41:57 -0800 | [diff] [blame] | 33 | public Collection<Device> getDevices(); |
| 34 | } |