Fixed Issue #207:
Implement remaining API for getting flow state
NOTE: The implementation of the API backend is sub-optimal,
but should be sufficient for now:
We fetch all flows, and then return only the subset that match
the query conditions.
We should use the appropriate Titan/Gremlin query to filter-out
the flows as appropriate.
Estimated: 2D
Actual: 1D
diff --git a/src/main/java/net/onrc/onos/util/GraphDBUtils.java b/src/main/java/net/onrc/onos/util/GraphDBUtils.java
index ebc5942..097cfa0 100644
--- a/src/main/java/net/onrc/onos/util/GraphDBUtils.java
+++ b/src/main/java/net/onrc/onos/util/GraphDBUtils.java
@@ -100,6 +100,13 @@
}
@Override
+ public Iterable<IFlowPath> getAllFlowPaths(GraphDBConnection conn) {
+ FramedGraph<TitanGraph> fg = conn.getFramedGraph();
+
+ return fg.getVertices("type", "flow", IFlowPath.class);
+ }
+
+ @Override
public IFlowEntry searchFlowEntry(GraphDBConnection conn,
FlowEntryId flowEntryId) {
FramedGraph<TitanGraph> fg = conn.getFramedGraph();
diff --git a/src/main/java/net/onrc/onos/util/IDBUtils.java b/src/main/java/net/onrc/onos/util/IDBUtils.java
index 4ff70f3..48d5946 100644
--- a/src/main/java/net/onrc/onos/util/IDBUtils.java
+++ b/src/main/java/net/onrc/onos/util/IDBUtils.java
@@ -20,6 +20,7 @@
public void removeFlowPath(GraphDBConnection conn, IFlowPath flowPath);
public IFlowPath getFlowPathByFlowEntry(GraphDBConnection conn,
IFlowEntry flowEntry);
+ public Iterable<IFlowPath> getAllFlowPaths(GraphDBConnection conn);
public IFlowEntry searchFlowEntry(GraphDBConnection conn,
FlowEntryId flowEntryId);
public IFlowEntry newFlowEntry(GraphDBConnection conn);