Fixing topology related interface/class tree
- (Mutable)Topology no longer implements ImmutableTopology
--- BaseTopology (was ImmutableTopology)
|
+-- ImmutableTopology (new)
|
+-- MutableTopology (was Topology)
|
+-- RefreshableTopology
|
+-- TopologyInternal
This interface is placed in wrong place. To be fixed later.
Change-Id: Ifa9defcc7c0fc22bba19977fe4ea57eaf792275e
diff --git a/src/main/java/net/onrc/onos/core/topology/MutableTopology.java b/src/main/java/net/onrc/onos/core/topology/MutableTopology.java
new file mode 100644
index 0000000..7372bcb
--- /dev/null
+++ b/src/main/java/net/onrc/onos/core/topology/MutableTopology.java
@@ -0,0 +1,34 @@
+package net.onrc.onos.core.topology;
+
+import net.onrc.onos.core.topology.web.serializers.TopologySerializer;
+
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+//TODO move to appropriate package under api
+/**
+ * MutableTopology, which this instance can be updated to new view.
+ * <p>
+ * Requires read-lock to access any information on this topology view.
+ * <p>
+ * Note: This is still read-only view of the topology.
+ * <p>
+ * The northbound interface to the topology. This interface
+ * is presented to the rest of ONOS. It is currently read-only, as we want
+ * only the discovery modules to be allowed to modify the topology.
+ */
+@JsonSerialize(using = TopologySerializer.class)
+public interface MutableTopology extends BaseTopology {
+
+ /**
+ * Acquire a read lock on the entire topology. The topology will not
+ * change while readers have the lock. Must be released using
+ * {@link #releaseReadLock()}. This method will block until a read lock is
+ * available.
+ */
+ public void acquireReadLock();
+
+ /**
+ * Release the read lock on the topology.
+ */
+ public void releaseReadLock();
+}