Jonathan Hart | 472062d | 2014-04-03 10:56:48 -0700 | [diff] [blame] | 1 | package net.onrc.onos.core.topology; |
Jonathan Hart | 062a2e8 | 2014-02-03 09:41:57 -0800 | [diff] [blame] | 2 | |
Yuta HIGUCHI | a7f1cdd | 2014-06-09 15:05:20 -0700 | [diff] [blame] | 3 | import net.onrc.onos.core.topology.web.serializers.TopologySerializer; |
| 4 | |
Ray Milkey | 0fe4385 | 2014-06-05 14:41:46 -0700 | [diff] [blame] | 5 | import org.codehaus.jackson.map.annotate.JsonSerialize; |
Jonathan Hart | 062a2e8 | 2014-02-03 09:41:57 -0800 | [diff] [blame] | 6 | |
| 7 | /** |
Jonathan Hart | e37e4e2 | 2014-05-13 19:12:02 -0700 | [diff] [blame] | 8 | * The northbound interface to the topology. This interface |
Jonathan Hart | 062a2e8 | 2014-02-03 09:41:57 -0800 | [diff] [blame] | 9 | * 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 Hart | 062a2e8 | 2014-02-03 09:41:57 -0800 | [diff] [blame] | 11 | */ |
Ray Milkey | 0fe4385 | 2014-06-05 14:41:46 -0700 | [diff] [blame] | 12 | @JsonSerialize(using = TopologySerializer.class) |
Yuta HIGUCHI | 7c28ebb | 2014-08-19 00:29:30 -0700 | [diff] [blame^] | 13 | public interface Topology extends ImmutableTopology { |
Yuta HIGUCHI | fa74284 | 2014-07-03 22:35:13 -0700 | [diff] [blame] | 14 | |
| 15 | /** |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 16 | * Acquire a read lock on the entire topology. The topology will not |
| 17 | * change while readers have the lock. Must be released using |
Sho SHIMIZU | bfe4a45 | 2014-06-09 15:18:11 -0700 | [diff] [blame] | 18 | * {@link #releaseReadLock()}. This method will block until a read lock is |
Jonathan Hart | 26f291b | 2014-02-18 16:57:24 -0800 | [diff] [blame] | 19 | * available. |
| 20 | */ |
Pavlin Radoslavov | 8ffb8bf | 2014-02-20 15:34:26 -0800 | [diff] [blame] | 21 | public void acquireReadLock(); |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 22 | |
Pavlin Radoslavov | 7c8f69a | 2014-02-19 19:01:45 -0800 | [diff] [blame] | 23 | /** |
| 24 | * Release the read lock on the topology. |
| 25 | */ |
Pavlin Radoslavov | 8ffb8bf | 2014-02-20 15:34:26 -0800 | [diff] [blame] | 26 | public void releaseReadLock(); |
Jonathan Hart | 062a2e8 | 2014-02-03 09:41:57 -0800 | [diff] [blame] | 27 | } |