add commit() and rollback() methods to IDBOperation class.
diff --git a/src/main/java/net/onrc/onos/util/GraphDBOperation.java b/src/main/java/net/onrc/onos/util/GraphDBOperation.java
index a6ba79b..1d5ab20 100644
--- a/src/main/java/net/onrc/onos/util/GraphDBOperation.java
+++ b/src/main/java/net/onrc/onos/util/GraphDBOperation.java
@@ -11,6 +11,7 @@
import net.floodlightcontroller.core.ISwitchStorage.SwitchState;
import net.floodlightcontroller.util.FlowEntryId;
import net.floodlightcontroller.util.FlowId;
+import net.onrc.onos.util.GraphDBConnection.Transaction;
import com.thinkaurelius.titan.core.TitanGraph;
import com.tinkerpop.blueprints.Vertex;
@@ -258,4 +259,16 @@
FramedGraph<TitanGraph> fg = conn.getFramedGraph();
fg.removeVertex(flowEntry.asVertex());
}
+
+ public IDBConnection getDBConnection() {
+ return conn;
+ }
+
+ public void commit() {
+ conn.endTx(Transaction.COMMIT);
+ }
+
+ public void rollback() {
+ conn.endTx(Transaction.ROLLBACK);
+ }
}
diff --git a/src/main/java/net/onrc/onos/util/IDBOperation.java b/src/main/java/net/onrc/onos/util/IDBOperation.java
index 6a0d52d..2eeb527 100644
--- a/src/main/java/net/onrc/onos/util/IDBOperation.java
+++ b/src/main/java/net/onrc/onos/util/IDBOperation.java
@@ -37,4 +37,6 @@
public IFlowEntry searchFlowEntry(FlowEntryId flowEntryId);
public Iterable<IFlowEntry> getAllFlowEntries();
public void removeFlowEntry(IFlowEntry flowEntry);
+
+ public IDBConnection getDBConnection();
}