blob: 464f463fdd51815b84f9570fcc191cd9c0e8d482 [file] [log] [blame]
Jonathan Hart472062d2014-04-03 10:56:48 -07001package net.onrc.onos.core.topology;
Jonathan Hart062a2e82014-02-03 09:41:57 -08002
Yuta HIGUCHIa7f1cdd2014-06-09 15:05:20 -07003import net.onrc.onos.core.topology.web.serializers.TopologySerializer;
4
Ray Milkey0fe43852014-06-05 14:41:46 -07005import org.codehaus.jackson.map.annotate.JsonSerialize;
Jonathan Hart062a2e82014-02-03 09:41:57 -08006
7/**
Jonathan Harte37e4e22014-05-13 19:12:02 -07008 * The northbound interface to the topology. This interface
Jonathan Hart062a2e82014-02-03 09:41:57 -08009 * is presented to the rest of ONOS. It is currently read-only, as we want
10 * only the discovery modules to be allowed to modify the topology.
Jonathan Hart062a2e82014-02-03 09:41:57 -080011 */
Ray Milkey0fe43852014-06-05 14:41:46 -070012@JsonSerialize(using = TopologySerializer.class)
Yuta HIGUCHI7c28ebb2014-08-19 00:29:30 -070013public interface Topology extends ImmutableTopology {
Yuta HIGUCHIfa742842014-07-03 22:35:13 -070014
15 /**
Ray Milkey269ffb92014-04-03 14:43:30 -070016 * Acquire a read lock on the entire topology. The topology will not
17 * change while readers have the lock. Must be released using
Sho SHIMIZUbfe4a452014-06-09 15:18:11 -070018 * {@link #releaseReadLock()}. This method will block until a read lock is
Jonathan Hart26f291b2014-02-18 16:57:24 -080019 * available.
20 */
Pavlin Radoslavov8ffb8bf2014-02-20 15:34:26 -080021 public void acquireReadLock();
Ray Milkey269ffb92014-04-03 14:43:30 -070022
Pavlin Radoslavov7c8f69a2014-02-19 19:01:45 -080023 /**
24 * Release the read lock on the topology.
25 */
Pavlin Radoslavov8ffb8bf2014-02-20 15:34:26 -080026 public void releaseReadLock();
Jonathan Hart062a2e82014-02-03 09:41:57 -080027}