blob: ab321306b90b8312728125d54892a9155f8ca9dc [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 */
Pavlin Radoslavov24409672014-08-20 16:45:11 -07008public interface ITopologyService extends IFloodlightService,
9 ITopologyReplicationWriter {
Jonathan Harte37e4e22014-05-13 19:12:02 -070010 /**
11 * Allows a module to get a reference to the global topology object.
12 *
13 * @return the global Topology object
14 */
Yuta HIGUCHId92b10c2014-08-25 09:30:28 -070015 public MutableTopology getTopology();
Jonathan Harte37e4e22014-05-13 19:12:02 -070016
17 /**
Pavlin Radoslavov054cd592014-08-07 20:57:16 -070018 * Adds a listener for topology events.
Jonathan Harte37e4e22014-05-13 19:12:02 -070019 *
Pavlin Radoslavov054cd592014-08-07 20:57:16 -070020 * @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 Harte37e4e22014-05-13 19:12:02 -070023 */
Pavlin Radoslavov054cd592014-08-07 20:57:16 -070024 public void addListener(ITopologyListener listener,
25 boolean startFromSnapshot);
Jonathan Harte37e4e22014-05-13 19:12:02 -070026
27 /**
Pavlin Radoslavov054cd592014-08-07 20:57:16 -070028 * Removes a listener for topology events. The listener will no longer
Jonathan Harte37e4e22014-05-13 19:12:02 -070029 * receive topology events after this call.
30 *
Pavlin Radoslavov054cd592014-08-07 20:57:16 -070031 * @param listener the listener to remove.
Jonathan Harte37e4e22014-05-13 19:12:02 -070032 */
Pavlin Radoslavov054cd592014-08-07 20:57:16 -070033 public void removeListener(ITopologyListener listener);
Jonathan Harte37e4e22014-05-13 19:12:02 -070034}