Move to Titan 0.2.1
diff --git a/src/main/java/net/onrc/onos/util/GraphDBConnection.java b/src/main/java/net/onrc/onos/util/GraphDBConnection.java
index cc3e0e7..7ea0ab8 100644
--- a/src/main/java/net/onrc/onos/util/GraphDBConnection.java
+++ b/src/main/java/net/onrc/onos/util/GraphDBConnection.java
@@ -8,7 +8,6 @@
import com.thinkaurelius.titan.core.TitanFactory;
import com.thinkaurelius.titan.core.TitanGraph;
import com.tinkerpop.blueprints.TransactionalGraph;
-import com.tinkerpop.blueprints.TransactionalGraph.Conclusion;
import com.tinkerpop.blueprints.Vertex;
import com.tinkerpop.blueprints.util.wrappers.event.EventTransactionalGraph;
import com.tinkerpop.frames.FramedGraph;
@@ -25,7 +24,7 @@
class TransactionHandle {
protected TransactionalGraph tr;
public void create() {
- tr = graph.startTransaction();
+ tr = graph.newTransaction();
}
}
protected static Logger log = LoggerFactory.getLogger(GraphDBConnection.class);
@@ -72,7 +71,7 @@
graph.createKeyIndex("switch_state",
Vertex.class);
}
- graph.stopTransaction(Conclusion.SUCCESS);
+ graph.commit();
eg = new EventTransactionalGraph<TitanGraph>(graph);
}
if (utils == null) {
@@ -125,9 +124,9 @@
try {
switch (tx) {
case COMMIT:
- graph.stopTransaction(Conclusion.SUCCESS);
+ graph.commit();
case ROLLBACK:
- graph.stopTransaction(Conclusion.FAILURE);
+ graph.rollback();
}
} catch (Exception e) {
// TODO Auto-generated catch block
@@ -139,15 +138,15 @@
switch (tx) {
case COMMIT:
if (tr != null && tr.tr != null) {
- tr.tr.stopTransaction(Conclusion.SUCCESS);
+ tr.tr.commit();
} else {
- graph.stopTransaction(Conclusion.SUCCESS);
+ graph.commit();
}
case ROLLBACK:
if (tr != null && tr.tr != null) {
- tr.tr.stopTransaction(Conclusion.FAILURE);
+ tr.tr.rollback();
} else {
- graph.stopTransaction(Conclusion.FAILURE);
+ graph.rollback();
}
}
}
@@ -158,9 +157,9 @@
if (fire.equals(GenerateEvent.TRUE)) {
switch (tx) {
case COMMIT:
- eg.stopTransaction(Conclusion.SUCCESS);
+ eg.commit();
case ROLLBACK:
- eg.stopTransaction(Conclusion.FAILURE);
+ eg.rollback();
}
} else {
endTx(tx);
@@ -173,7 +172,5 @@
public void close() {
endTx(Transaction.COMMIT);
-// graph.shutdown();
- }
-
+ }
}
diff --git a/src/main/java/net/onrc/onos/util/GraphDBUtils.java b/src/main/java/net/onrc/onos/util/GraphDBUtils.java
index 2dac008..6601bf9 100644
--- a/src/main/java/net/onrc/onos/util/GraphDBUtils.java
+++ b/src/main/java/net/onrc/onos/util/GraphDBUtils.java
@@ -15,7 +15,7 @@
import com.thinkaurelius.titan.core.TitanGraph;
import com.tinkerpop.blueprints.Vertex;
import com.tinkerpop.frames.FramedGraph;
-import com.tinkerpop.frames.FramedVertexIterable;
+import com.tinkerpop.frames.structures.FramedVertexIterable;
import com.tinkerpop.gremlin.java.GremlinPipeline;
public class GraphDBUtils implements IDBUtils {
diff --git a/src/main/java/net/onrc/onos/util/IDBUtils.java b/src/main/java/net/onrc/onos/util/IDBUtils.java
index 4aa8168..35803d2 100644
--- a/src/main/java/net/onrc/onos/util/IDBUtils.java
+++ b/src/main/java/net/onrc/onos/util/IDBUtils.java
@@ -37,6 +37,5 @@
ISwitchObject newSwitch(GraphDBConnection conn);
void removePort(GraphDBConnection conn, IPortObject port);
void removeSwitch(GraphDBConnection conn, ISwitchObject sw);
- Iterable<IFlowEntry> getAllSwitchNotUpdatedFlowEntries(
- GraphDBConnection conn);
+ Iterable<IFlowEntry> getAllSwitchNotUpdatedFlowEntries(GraphDBConnection conn);
}
diff --git a/src/main/java/net/onrc/onos/util/LocalTopologyEventListener.java b/src/main/java/net/onrc/onos/util/LocalTopologyEventListener.java
index 17d4b2a..61f227d 100644
--- a/src/main/java/net/onrc/onos/util/LocalTopologyEventListener.java
+++ b/src/main/java/net/onrc/onos/util/LocalTopologyEventListener.java
@@ -88,13 +88,15 @@
@Override
- public void edgePropertyChanged(Edge arg0, String arg1, Object arg2) {
+ public void edgePropertyChanged(Edge arg0, String arg1, Object arg2,
+ Object arg3) {
// TODO Auto-generated method stub
}
@Override
- public void vertexPropertyChanged(Vertex arg0, String arg1, Object arg2) {
+ public void vertexPropertyChanged(Vertex arg0, String arg1, Object arg2,
+ Object arg3) {
// TODO Auto-generated method stub
}