Minor cleanup in the TopologyManager API:
* Added TopologyManager constructor for a given database operation handler.
* Removed method TopologyManager.setDbOperationHandler()
diff --git a/src/main/java/net/onrc/onos/ofcontroller/topology/TopologyManager.java b/src/main/java/net/onrc/onos/ofcontroller/topology/TopologyManager.java
index dffaf43..a327ef9 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/topology/TopologyManager.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/topology/TopologyManager.java
@@ -123,13 +123,13 @@
}
/**
- * Set the database operation handler.
+ * Constructor for a given database operation handler.
*
- * @param init_op the database operation handler to use for the
+ * @param handler the database operation handler to use for the
* initialization.
*/
- public void setDbOperationHandler(GraphDBOperation init_op) {
- this.op = init_op;
+ public TopologyManager(GraphDBOperation handler) {
+ this.op = handler;
}
/**
diff --git a/src/test/java/net/onrc/onos/ofcontroller/topology/TopologyManagerTest.java b/src/test/java/net/onrc/onos/ofcontroller/topology/TopologyManagerTest.java
index fbec59e..8bdee72 100644
--- a/src/test/java/net/onrc/onos/ofcontroller/topology/TopologyManagerTest.java
+++ b/src/test/java/net/onrc/onos/ofcontroller/topology/TopologyManagerTest.java
@@ -64,8 +64,7 @@
TestDatabaseManager.populateTestData(titanGraph);
// Prepare the TopologyManager instance
- topologyManager = new TopologyManager();
- topologyManager.setDbOperationHandler(oper);
+ topologyManager = new TopologyManager(oper);
}
/**