Jonathan Hart | e37e4e2 | 2014-05-13 19:12:02 -0700 | [diff] [blame] | 1 | package net.onrc.onos.core.topology; |
| 2 | |
| 3 | import net.floodlightcontroller.core.module.IFloodlightService; |
| 4 | |
| 5 | /** |
| 6 | * Interface for providing the topology service to other modules. |
| 7 | */ |
| 8 | public interface ITopologyService extends IFloodlightService { |
| 9 | /** |
| 10 | * Allows a module to get a reference to the global topology object. |
| 11 | * |
| 12 | * @return the global Topology object |
| 13 | */ |
| 14 | public Topology getTopology(); |
| 15 | |
| 16 | /** |
Pavlin Radoslavov | 054cd59 | 2014-08-07 20:57:16 -0700 | [diff] [blame] | 17 | * Adds a listener for topology events. |
Jonathan Hart | e37e4e2 | 2014-05-13 19:12:02 -0700 | [diff] [blame] | 18 | * |
Pavlin Radoslavov | 054cd59 | 2014-08-07 20:57:16 -0700 | [diff] [blame] | 19 | * @param listener the listener to add. |
| 20 | * @param startFromSnapshot if true, and if the topology is not |
| 21 | * empty, the first event should be a snapshot of the current topology. |
Jonathan Hart | e37e4e2 | 2014-05-13 19:12:02 -0700 | [diff] [blame] | 22 | */ |
Pavlin Radoslavov | 054cd59 | 2014-08-07 20:57:16 -0700 | [diff] [blame] | 23 | public void addListener(ITopologyListener listener, |
| 24 | boolean startFromSnapshot); |
Jonathan Hart | e37e4e2 | 2014-05-13 19:12:02 -0700 | [diff] [blame] | 25 | |
| 26 | /** |
Pavlin Radoslavov | 054cd59 | 2014-08-07 20:57:16 -0700 | [diff] [blame] | 27 | * Removes a listener for topology events. The listener will no longer |
Jonathan Hart | e37e4e2 | 2014-05-13 19:12:02 -0700 | [diff] [blame] | 28 | * receive topology events after this call. |
| 29 | * |
Pavlin Radoslavov | 054cd59 | 2014-08-07 20:57:16 -0700 | [diff] [blame] | 30 | * @param listener the listener to remove. |
Jonathan Hart | e37e4e2 | 2014-05-13 19:12:02 -0700 | [diff] [blame] | 31 | */ |
Pavlin Radoslavov | 054cd59 | 2014-08-07 20:57:16 -0700 | [diff] [blame] | 32 | public void removeListener(ITopologyListener listener); |
Jonathan Hart | e37e4e2 | 2014-05-13 19:12:02 -0700 | [diff] [blame] | 33 | |
| 34 | /** |
| 35 | * Allows a module to get a reference to the southbound interface to |
| 36 | * the topology. |
| 37 | * TODO Figure out how to hide the southbound interface from |
| 38 | * applications/modules that shouldn't touch it |
| 39 | * |
| 40 | * @return the TopologyDiscoveryInterface object |
| 41 | */ |
| 42 | public TopologyDiscoveryInterface getTopologyDiscoveryInterface(); |
| 43 | } |