Merge branch 'master' of https://github.com/OPENNETWORKINGLAB/ONOS
diff --git a/src/main/java/net/floodlightcontroller/core/INetMapTopologyObjects.java b/src/main/java/net/floodlightcontroller/core/INetMapTopologyObjects.java
index 71b6593..ea0daa3 100644
--- a/src/main/java/net/floodlightcontroller/core/INetMapTopologyObjects.java
+++ b/src/main/java/net/floodlightcontroller/core/INetMapTopologyObjects.java
@@ -86,8 +86,7 @@
@JsonIgnore
@Incidence(label="on",direction = Direction.IN)
public ISwitchObject getSwitch();
-
-
+
@JsonProperty("devices")
@Adjacency(label="host")
public Iterable<IDeviceObject> getDevices();
@@ -106,6 +105,9 @@
@Incidence(label="outport",direction = Direction.IN)
public Iterable<IFlowEntry> getOutFlowEntries();
+ @Adjacency(label="link")
+ public void removeLink(final IPortObject dest_port);
+
// @JsonIgnore
// @Adjacency(label="link")
// public Iterable<ILinkObject> getLinks();
diff --git a/src/main/java/net/onrc/onos/util/GraphDBUtils.java b/src/main/java/net/onrc/onos/util/GraphDBUtils.java
index 7283d09..c43434f 100644
--- a/src/main/java/net/onrc/onos/util/GraphDBUtils.java
+++ b/src/main/java/net/onrc/onos/util/GraphDBUtils.java
@@ -3,12 +3,6 @@
import java.util.ArrayList;
import java.util.List;
-import com.thinkaurelius.titan.core.TitanGraph;
-import com.tinkerpop.blueprints.Vertex;
-import com.tinkerpop.frames.FramedGraph;
-import com.tinkerpop.frames.FramedVertexIterable;
-import com.tinkerpop.gremlin.java.GremlinPipeline;
-
import net.floodlightcontroller.core.INetMapTopologyObjects.IDeviceObject;
import net.floodlightcontroller.core.INetMapTopologyObjects.IFlowEntry;
import net.floodlightcontroller.core.INetMapTopologyObjects.IFlowPath;
@@ -18,6 +12,13 @@
import net.floodlightcontroller.util.FlowEntryId;
import net.floodlightcontroller.util.FlowId;
+import com.thinkaurelius.titan.core.TitanGraph;
+import com.tinkerpop.blueprints.Vertex;
+import com.tinkerpop.blueprints.util.wrappers.event.EventGraph;
+import com.tinkerpop.frames.FramedGraph;
+import com.tinkerpop.frames.FramedVertexIterable;
+import com.tinkerpop.gremlin.java.GremlinPipeline;
+
public class GraphDBUtils implements IDBUtils {
@Override
@@ -68,7 +69,7 @@
GremlinPipeline<Vertex, IPortObject> pipe = new GremlinPipeline<Vertex, IPortObject>();
pipe.start(sw.asVertex());
pipe.out("on").has("number", number);
- FramedVertexIterable<IPortObject> r = new FramedVertexIterable(conn.getFramedGraph(), pipe, IPortObject.class);
+ FramedVertexIterable<IPortObject> r = new FramedVertexIterable<IPortObject>(conn.getFramedGraph(), (Iterable) pipe, IPortObject.class);
return r.iterator().hasNext() ? r.iterator().next() : null;
}
@@ -88,8 +89,9 @@
@Override
public void removePort(GraphDBConnection conn, IPortObject port) {
- FramedGraph<TitanGraph> fg = conn.getFramedGraph();
- fg.removeVertex(port.asVertex());
+// FramedGraph<TitanGraph> fg = conn.getFramedGraph();
+ EventGraph<TitanGraph> eg = conn.getEventGraph();
+ eg.removeVertex(port.asVertex());
}
@Override
@@ -135,7 +137,7 @@
GremlinPipeline<Vertex, IFlowPath> pipe = new GremlinPipeline<Vertex, IFlowPath>();
pipe.start(flowEntry.asVertex());
pipe.out("flow");
- FramedVertexIterable<IFlowPath> r = new FramedVertexIterable(conn.getFramedGraph(), pipe, IFlowPath.class);
+ FramedVertexIterable<IFlowPath> r = new FramedVertexIterable(conn.getFramedGraph(), (Iterable) pipe, IFlowPath.class);
return r.iterator().hasNext() ? r.iterator().next() : null;
}