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 | */ |
Pavlin Radoslavov | 2440967 | 2014-08-20 16:45:11 -0700 | [diff] [blame] | 8 | public interface ITopologyService extends IFloodlightService, |
| 9 | ITopologyReplicationWriter { |
Jonathan Hart | e37e4e2 | 2014-05-13 19:12:02 -0700 | [diff] [blame] | 10 | /** |
| 11 | * Allows a module to get a reference to the global topology object. |
| 12 | * |
| 13 | * @return the global Topology object |
| 14 | */ |
Yuta HIGUCHI | d92b10c | 2014-08-25 09:30:28 -0700 | [diff] [blame] | 15 | public MutableTopology getTopology(); |
Jonathan Hart | e37e4e2 | 2014-05-13 19:12:02 -0700 | [diff] [blame] | 16 | |
| 17 | /** |
Pavlin Radoslavov | 054cd59 | 2014-08-07 20:57:16 -0700 | [diff] [blame] | 18 | * Adds a listener for topology events. |
Jonathan Hart | e37e4e2 | 2014-05-13 19:12:02 -0700 | [diff] [blame] | 19 | * |
Pavlin Radoslavov | 054cd59 | 2014-08-07 20:57:16 -0700 | [diff] [blame] | 20 | * @param listener the listener to add. |
| 21 | * @param startFromSnapshot if true, and if the topology is not |
| 22 | * empty, the first event should be a snapshot of the current topology. |
Jonathan Hart | e37e4e2 | 2014-05-13 19:12:02 -0700 | [diff] [blame] | 23 | */ |
Pavlin Radoslavov | 054cd59 | 2014-08-07 20:57:16 -0700 | [diff] [blame] | 24 | public void addListener(ITopologyListener listener, |
| 25 | boolean startFromSnapshot); |
Jonathan Hart | e37e4e2 | 2014-05-13 19:12:02 -0700 | [diff] [blame] | 26 | |
| 27 | /** |
Pavlin Radoslavov | 054cd59 | 2014-08-07 20:57:16 -0700 | [diff] [blame] | 28 | * Removes a listener for topology events. The listener will no longer |
Jonathan Hart | e37e4e2 | 2014-05-13 19:12:02 -0700 | [diff] [blame] | 29 | * receive topology events after this call. |
| 30 | * |
Pavlin Radoslavov | 054cd59 | 2014-08-07 20:57:16 -0700 | [diff] [blame] | 31 | * @param listener the listener to remove. |
Jonathan Hart | e37e4e2 | 2014-05-13 19:12:02 -0700 | [diff] [blame] | 32 | */ |
Pavlin Radoslavov | 054cd59 | 2014-08-07 20:57:16 -0700 | [diff] [blame] | 33 | public void removeListener(ITopologyListener listener); |
Jonathan Hart | e37e4e2 | 2014-05-13 19:12:02 -0700 | [diff] [blame] | 34 | } |