blob: ecb12122e585d2e0417fb11ae442393a1a960eeb [file] [log] [blame]
Jonathan Harte37e4e22014-05-13 19:12:02 -07001package net.onrc.onos.core.topology;
2
3import net.floodlightcontroller.core.module.IFloodlightService;
4
5/**
6 * Interface for providing the topology service to other modules.
7 */
8public 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 Radoslavov054cd592014-08-07 20:57:16 -070017 * Adds a listener for topology events.
Jonathan Harte37e4e22014-05-13 19:12:02 -070018 *
Pavlin Radoslavov054cd592014-08-07 20:57:16 -070019 * @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 Harte37e4e22014-05-13 19:12:02 -070022 */
Pavlin Radoslavov054cd592014-08-07 20:57:16 -070023 public void addListener(ITopologyListener listener,
24 boolean startFromSnapshot);
Jonathan Harte37e4e22014-05-13 19:12:02 -070025
26 /**
Pavlin Radoslavov054cd592014-08-07 20:57:16 -070027 * Removes a listener for topology events. The listener will no longer
Jonathan Harte37e4e22014-05-13 19:12:02 -070028 * receive topology events after this call.
29 *
Pavlin Radoslavov054cd592014-08-07 20:57:16 -070030 * @param listener the listener to remove.
Jonathan Harte37e4e22014-05-13 19:12:02 -070031 */
Pavlin Radoslavov054cd592014-08-07 20:57:16 -070032 public void removeListener(ITopologyListener listener);
Jonathan Harte37e4e22014-05-13 19:12:02 -070033}