blob: 7372bcb7d8ec6a4a1c749d3ce624b9891bbcf96b [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
Yuta HIGUCHId92b10c2014-08-25 09:30:28 -07007//TODO move to appropriate package under api
Jonathan Hart062a2e82014-02-03 09:41:57 -08008/**
Yuta HIGUCHId92b10c2014-08-25 09:30:28 -07009 * MutableTopology, which this instance can be updated to new view.
10 * <p>
11 * Requires read-lock to access any information on this topology view.
12 * <p>
13 * Note: This is still read-only view of the topology.
14 * <p>
Jonathan Harte37e4e22014-05-13 19:12:02 -070015 * The northbound interface to the topology. This interface
Jonathan Hart062a2e82014-02-03 09:41:57 -080016 * is presented to the rest of ONOS. It is currently read-only, as we want
17 * only the discovery modules to be allowed to modify the topology.
Jonathan Hart062a2e82014-02-03 09:41:57 -080018 */
Ray Milkey0fe43852014-06-05 14:41:46 -070019@JsonSerialize(using = TopologySerializer.class)
Yuta HIGUCHId92b10c2014-08-25 09:30:28 -070020public interface MutableTopology extends BaseTopology {
Yuta HIGUCHIfa742842014-07-03 22:35:13 -070021
22 /**
Ray Milkey269ffb92014-04-03 14:43:30 -070023 * Acquire a read lock on the entire topology. The topology will not
24 * change while readers have the lock. Must be released using
Sho SHIMIZUbfe4a452014-06-09 15:18:11 -070025 * {@link #releaseReadLock()}. This method will block until a read lock is
Jonathan Hart26f291b2014-02-18 16:57:24 -080026 * available.
27 */
Pavlin Radoslavov8ffb8bf2014-02-20 15:34:26 -080028 public void acquireReadLock();
Ray Milkey269ffb92014-04-03 14:43:30 -070029
Pavlin Radoslavov7c8f69a2014-02-19 19:01:45 -080030 /**
31 * Release the read lock on the topology.
32 */
Pavlin Radoslavov8ffb8bf2014-02-20 15:34:26 -080033 public void releaseReadLock();
Jonathan Hart062a2e82014-02-03 09:41:57 -080034}