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 | |
Yuta HIGUCHI | d92b10c | 2014-08-25 09:30:28 -0700 | [diff] [blame] | 7 | //TODO move to appropriate package under api |
Jonathan Hart | 062a2e8 | 2014-02-03 09:41:57 -0800 | [diff] [blame] | 8 | /** |
Yuta HIGUCHI | d92b10c | 2014-08-25 09:30:28 -0700 | [diff] [blame] | 9 | * 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 Hart | e37e4e2 | 2014-05-13 19:12:02 -0700 | [diff] [blame] | 15 | * The northbound interface to the topology. This interface |
Jonathan Hart | 062a2e8 | 2014-02-03 09:41:57 -0800 | [diff] [blame] | 16 | * 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 Hart | 062a2e8 | 2014-02-03 09:41:57 -0800 | [diff] [blame] | 18 | */ |
Ray Milkey | 0fe4385 | 2014-06-05 14:41:46 -0700 | [diff] [blame] | 19 | @JsonSerialize(using = TopologySerializer.class) |
Yuta HIGUCHI | d92b10c | 2014-08-25 09:30:28 -0700 | [diff] [blame] | 20 | public interface MutableTopology extends BaseTopology { |
Yuta HIGUCHI | fa74284 | 2014-07-03 22:35:13 -0700 | [diff] [blame] | 21 | |
| 22 | /** |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 23 | * Acquire a read lock on the entire topology. The topology will not |
| 24 | * change while readers have the lock. Must be released using |
Sho SHIMIZU | bfe4a45 | 2014-06-09 15:18:11 -0700 | [diff] [blame] | 25 | * {@link #releaseReadLock()}. This method will block until a read lock is |
Jonathan Hart | 26f291b | 2014-02-18 16:57:24 -0800 | [diff] [blame] | 26 | * available. |
| 27 | */ |
Pavlin Radoslavov | 8ffb8bf | 2014-02-20 15:34:26 -0800 | [diff] [blame] | 28 | public void acquireReadLock(); |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 29 | |
Pavlin Radoslavov | 7c8f69a | 2014-02-19 19:01:45 -0800 | [diff] [blame] | 30 | /** |
| 31 | * Release the read lock on the topology. |
| 32 | */ |
Pavlin Radoslavov | 8ffb8bf | 2014-02-20 15:34:26 -0800 | [diff] [blame] | 33 | public void releaseReadLock(); |
Jonathan Hart | 062a2e8 | 2014-02-03 09:41:57 -0800 | [diff] [blame] | 34 | } |