Merged in new registry code
diff --git a/src/main/java/net/floodlightcontroller/core/INetMapTopologyObjects.java b/src/main/java/net/floodlightcontroller/core/INetMapTopologyObjects.java
index a54136c..1cf6f7b 100644
--- a/src/main/java/net/floodlightcontroller/core/INetMapTopologyObjects.java
+++ b/src/main/java/net/floodlightcontroller/core/INetMapTopologyObjects.java
@@ -47,6 +47,9 @@
 		public Iterable<IPortObject> getPorts();
 		
 		@Adjacency(label="on")
+		public IPortObject getPort(final short port_num);
+		
+		@Adjacency(label="on")
 		public void addPort(final IPortObject port);
 		
 		@Adjacency(label="on")
diff --git a/src/main/java/net/floodlightcontroller/core/ISwitchStorage.java b/src/main/java/net/floodlightcontroller/core/ISwitchStorage.java
index 5a1e1a7..3646e15 100644
--- a/src/main/java/net/floodlightcontroller/core/ISwitchStorage.java
+++ b/src/main/java/net/floodlightcontroller/core/ISwitchStorage.java
@@ -4,16 +4,8 @@
 
 import net.floodlightcontroller.core.INetMapTopologyObjects.ISwitchObject;
 
-import org.codehaus.jackson.annotate.JsonIgnore;
-import org.codehaus.jackson.annotate.JsonProperty;
 import org.openflow.protocol.OFPhysicalPort;
 
-import com.tinkerpop.blueprints.Direction;
-import com.tinkerpop.frames.Adjacency;
-import com.tinkerpop.frames.Incidence;
-import com.tinkerpop.frames.Property;
-import com.tinkerpop.frames.VertexFrame;
-
 public interface ISwitchStorage extends INetMapStorage {
 	
 	public enum SwitchState {
diff --git a/src/main/java/net/floodlightcontroller/core/internal/SwitchStorageImpl.java b/src/main/java/net/floodlightcontroller/core/internal/SwitchStorageImpl.java
index 0e43ed2..3039679 100644
--- a/src/main/java/net/floodlightcontroller/core/internal/SwitchStorageImpl.java
+++ b/src/main/java/net/floodlightcontroller/core/internal/SwitchStorageImpl.java
@@ -20,8 +20,6 @@
 import com.tinkerpop.blueprints.Edge;
 import com.tinkerpop.blueprints.Vertex;
 import com.tinkerpop.frames.FramedGraph;
-import com.tinkerpop.gremlin.java.GremlinPipeline;
-
 import net.floodlightcontroller.core.INetMapTopologyObjects.ISwitchObject;
 import net.floodlightcontroller.core.ISwitchStorage;
 
diff --git a/src/main/java/net/floodlightcontroller/core/internal/TopoSwitchServiceImpl.java b/src/main/java/net/floodlightcontroller/core/internal/TopoSwitchServiceImpl.java
index deae4bf..e8b1bf8 100644
--- a/src/main/java/net/floodlightcontroller/core/internal/TopoSwitchServiceImpl.java
+++ b/src/main/java/net/floodlightcontroller/core/internal/TopoSwitchServiceImpl.java
@@ -1,7 +1,5 @@
 package net.floodlightcontroller.core.internal;
 
-import java.util.List;
-
 import net.floodlightcontroller.core.INetMapTopologyObjects.IPortObject;
 import net.floodlightcontroller.core.INetMapTopologyObjects.ISwitchObject;
 import net.floodlightcontroller.core.INetMapTopologyService.ITopoSwitchService;
diff --git a/src/main/java/net/floodlightcontroller/devicemanager/IDeviceStorage.java b/src/main/java/net/floodlightcontroller/devicemanager/IDeviceStorage.java
index 582afe0..f41e32c 100644
--- a/src/main/java/net/floodlightcontroller/devicemanager/IDeviceStorage.java
+++ b/src/main/java/net/floodlightcontroller/devicemanager/IDeviceStorage.java
@@ -7,8 +7,9 @@
 	
 	public IDeviceObject addDevice(IDevice device);
 	public IDeviceObject updateDevice(IDevice device);
-	public IDeviceObject removeDevice(IDevice device);
+	public void removeDevice(IDevice device);
 	public IDeviceObject getDeviceByMac(String mac);
 	public IDeviceObject getDeviceByIP(String ip);
-	
+	public void changeDeviceAttachments(IDevice device);
+	public void changeDeviceIPv4Address(IDevice device);	
 }
diff --git a/src/main/java/net/floodlightcontroller/devicemanager/internal/DeviceStorageImpl.java b/src/main/java/net/floodlightcontroller/devicemanager/internal/DeviceStorageImpl.java
index 14f93cb..cfbbb41 100644
--- a/src/main/java/net/floodlightcontroller/devicemanager/internal/DeviceStorageImpl.java
+++ b/src/main/java/net/floodlightcontroller/devicemanager/internal/DeviceStorageImpl.java
@@ -1,21 +1,12 @@
 package net.floodlightcontroller.devicemanager.internal;
 
-import java.util.ArrayList;
 import java.util.List;
-import java.util.Set;
-
 import org.openflow.util.HexString;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import com.google.common.collect.Lists;
 import com.thinkaurelius.titan.core.TitanException;
-import com.thinkaurelius.titan.core.TitanFactory;
-import com.thinkaurelius.titan.core.TitanGraph;
-import com.tinkerpop.blueprints.Vertex;
-import com.tinkerpop.blueprints.TransactionalGraph.Conclusion;
-import com.tinkerpop.frames.FramedGraph;
-
 import net.floodlightcontroller.core.INetMapTopologyObjects.IDeviceObject;
 import net.floodlightcontroller.core.INetMapTopologyObjects.IPortObject;
 import net.floodlightcontroller.core.INetMapTopologyService.ITopoSwitchService;
@@ -23,31 +14,19 @@
 import net.floodlightcontroller.devicemanager.IDevice;
 import net.floodlightcontroller.devicemanager.IDeviceStorage;
 import net.floodlightcontroller.devicemanager.SwitchPort;
+import net.onrc.onos.util.GraphDBConnection;
+import net.onrc.onos.util.GraphDBConnection.Transaction;
 
 public class DeviceStorageImpl implements IDeviceStorage {
 	
-	public TitanGraph graph;
+//	public TitanGraph graph;
+	public GraphDBConnection conn;
 	protected static Logger log = LoggerFactory.getLogger(SwitchStorageImpl.class);
 	public ITopoSwitchService svc;
 
 	@Override
 	public void init(String conf) {
-	       graph = TitanFactory.open(conf);
-	        
-	        // FIXME: Creation on Indexes should be done only once
-	        Set<String> s = graph.getIndexedKeys(Vertex.class);
-	        if (!s.contains("dpid")) {
-	           graph.createKeyIndex("dpid", Vertex.class);
-	           graph.stopTransaction(Conclusion.SUCCESS);
-	        }
-	        if (!s.contains("type")) {
-	        	graph.createKeyIndex("type", Vertex.class);
-	        	graph.stopTransaction(Conclusion.SUCCESS);
-	        }
-	        if (!s.contains("dl_address")) {
-	        	graph.createKeyIndex("dl_address", Vertex.class);
-	        	graph.stopTransaction(Conclusion.SUCCESS);
-	        }
+		conn = GraphDBConnection.getInstance(conf);
 	}	
 
 	public void finalize() {
@@ -56,45 +35,32 @@
 	
 	@Override
 	public void close() {
-		graph.shutdown();
+		conn.close();
 	}
 
 	@Override
 	public IDeviceObject addDevice(IDevice device) {
 		// TODO Auto-generated method stub
-		FramedGraph<TitanGraph> fg = new FramedGraph<TitanGraph>(graph);;
 		IDeviceObject obj = null;
-       	SwitchPort[] attachmentPoints = device.getAttachmentPoints();
-       	List<IPortObject> attachedPorts; 
  		try {
-            if (fg.getVertices("dl_address",device.getMACAddressString()).iterator().hasNext()) {
-            	obj = fg.getVertices("dl_address",device.getMACAddressString(),
-            			IDeviceObject.class).iterator().next();
-                attachedPorts = Lists.newArrayList(obj.getAttachedPorts());
-
+            if ((obj = conn.utils().searchDevice(conn, device.getMACAddressString())) != null) {
+                log.debug("Adding device {}: found existing device",device.getMACAddressString());
             } else {
-            	obj = fg.addVertex(null,IDeviceObject.class);
-            	attachedPorts = new ArrayList<IPortObject>();
+            	obj = conn.utils().newDevice(conn);
+                log.debug("Adding device {}: creating new device",device.getMACAddressString());
             }
-            for (SwitchPort ap : attachmentPoints) {
-            	 IPortObject port = svc.getPortOnSwitch(HexString.toHexString(ap.getSwitchDPID()),
-            												(short) ap.getPort());
-            	if (attachedPorts.contains(port)) {
-            		attachedPorts.remove(port);
-            	} else {
-            		obj.setHostPort(port);
-            	}            		
-            }
-            for (IPortObject port: attachedPorts) {
-            		obj.removeHostPort(port);
-            }
+            changeDeviceAttachments(device, obj);
+            
  			obj.setIPAddress(device.getIPv4Addresses().toString());
  			obj.setMACAddress(device.getMACAddressString());
  			obj.setType("device");
  			obj.setState("ACTIVE");
- 			graph.stopTransaction(Conclusion.SUCCESS);
-		} catch (TitanException e) {
+ 			conn.endTx(Transaction.COMMIT);
+ 			
+ 			log.debug("Adding device {}",device.getMACAddressString());
+		} catch (Exception e) {
             // TODO: handle exceptions
+          	conn.endTx(Transaction.ROLLBACK);
 			log.error(":addDevice mac:{} failed", device.getMACAddressString());
 		}	
 		
@@ -103,19 +69,29 @@
 
 	@Override
 	public IDeviceObject updateDevice(IDevice device) {
-		// TODO Auto-generated method stub
 		return addDevice(device);
 	}
 
 	@Override
-	public IDeviceObject removeDevice(IDevice device) {
+	public void removeDevice(IDevice device) {
 		// TODO Auto-generated method stub
-		return null;
+		IDeviceObject dev;
+		try {
+			if ((dev = conn.utils().searchDevice(conn, device.getMACAddressString())) != null) {
+             	conn.utils().removeDevice(conn, dev);
+              	conn.endTx(Transaction.COMMIT);
+            	log.error("DeviceStorage:removeDevice mac:{} done", device.getMACAddressString());
+            }
+		} catch (Exception e) {
+             // TODO: handle exceptions
+          	conn.endTx(Transaction.ROLLBACK);
+			log.error("DeviceStorage:removeDevice mac:{} failed", device.getMACAddressString());
+		}
 	}
 
 	@Override
 	public IDeviceObject getDeviceByMac(String mac) {
-		// TODO Auto-generated method stub
+		
 		return null;
 	}
 
@@ -125,4 +101,64 @@
 		return null;
 	}
 
+	@Override
+	public void changeDeviceAttachments(IDevice device) {
+		// TODO Auto-generated method stub
+		IDeviceObject obj = null;
+ 		try {
+            if ((obj = conn.utils().searchDevice(conn, device.getMACAddressString())) != null) {
+                log.debug("Changing device ports {}: found existing device",device.getMACAddressString());
+                changeDeviceAttachments(device, obj);
+     			conn.endTx(Transaction.COMMIT);
+           } else {
+   				log.debug("failed to search device...now adding {}",device.getMACAddressString());
+   				addDevice(device);
+           }            			
+		} catch (Exception e) {
+            // TODO: handle exceptions
+          	conn.endTx(Transaction.ROLLBACK);
+			log.error(":addDevice mac:{} failed", device.getMACAddressString());
+		}	
+	}
+	
+	public void changeDeviceAttachments(IDevice device, IDeviceObject obj) {
+		SwitchPort[] attachmentPoints = device.getAttachmentPoints();
+		List<IPortObject> attachedPorts = Lists.newArrayList(obj.getAttachedPorts());
+
+        for (SwitchPort ap : attachmentPoints) {
+       	 IPortObject port = conn.utils().searchPort(conn,
+       			 									HexString.toHexString(ap.getSwitchDPID()),
+       												(short) ap.getPort());
+       	if (attachedPorts.contains(port)) {
+       		attachedPorts.remove(port);
+       	} else {
+               log.debug("Adding device {}: attaching to port",device.getMACAddressString());
+               port.setDevice(obj);
+       		//obj.setHostPort(port);
+       	}            		
+       }
+       for (IPortObject port: attachedPorts) {
+       		port.removeDevice(obj);
+       	//	obj.removeHostPort(port);
+       }	
+	}
+
+	@Override
+	public void changeDeviceIPv4Address(IDevice device) {
+		// TODO Auto-generated method stub
+		IDeviceObject obj;
+  		try {
+  			if ((obj = conn.utils().searchDevice(conn, device.getMACAddressString())) != null) {
+            	obj.setIPAddress(device.getIPv4Addresses().toString());
+              	conn.endTx(Transaction.COMMIT); 
+  			} else {
+            	log.error(":changeDeviceIPv4Address mac:{} failed", device.getMACAddressString());
+             }		
+  		} catch (TitanException e) {
+            // TODO: handle exceptions
+          	conn.endTx(Transaction.ROLLBACK);
+			log.error(":changeDeviceIPv4Address mac:{} failed due to exception {}", device.getMACAddressString(),e);
+		}
+	}
+
 }
diff --git a/src/main/java/net/floodlightcontroller/onoslistener/OnosPublisher.java b/src/main/java/net/floodlightcontroller/onoslistener/OnosPublisher.java
new file mode 100644
index 0000000..532e293
--- /dev/null
+++ b/src/main/java/net/floodlightcontroller/onoslistener/OnosPublisher.java
@@ -0,0 +1,144 @@
+package net.floodlightcontroller.onoslistener;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Map;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import net.floodlightcontroller.core.IFloodlightProviderService;
+import net.floodlightcontroller.core.IOFSwitch;
+import net.floodlightcontroller.core.IOFSwitchListener;
+import net.floodlightcontroller.core.ISwitchStorage;
+import net.floodlightcontroller.core.internal.SwitchStorageImpl;
+import net.floodlightcontroller.core.module.FloodlightModuleContext;
+import net.floodlightcontroller.core.module.FloodlightModuleException;
+import net.floodlightcontroller.core.module.IFloodlightModule;
+import net.floodlightcontroller.core.module.IFloodlightService;
+import net.floodlightcontroller.devicemanager.IDevice;
+import net.floodlightcontroller.devicemanager.IDeviceListener;
+import net.floodlightcontroller.devicemanager.IDeviceService;
+import net.floodlightcontroller.devicemanager.IDeviceStorage;
+import net.floodlightcontroller.devicemanager.internal.DeviceStorageImpl;
+import net.floodlightcontroller.linkdiscovery.ILinkDiscoveryListener;
+
+public class OnosPublisher implements IDeviceListener, IOFSwitchListener,
+		ILinkDiscoveryListener, IFloodlightModule {
+	
+	protected IDeviceStorage devStore;
+	protected ISwitchStorage swStore;
+	protected static Logger log;
+	protected IDeviceService deviceService;
+	
+	protected static final String DBConfigFile = "dbconf";
+
+	@Override
+	public void linkDiscoveryUpdate(LDUpdate update) {
+		// TODO Auto-generated method stub
+
+	}
+
+	@Override
+	public void addedSwitch(IOFSwitch sw) {
+		// TODO Auto-generated method stub
+
+	}
+
+	@Override
+	public void removedSwitch(IOFSwitch sw) {
+		// TODO Auto-generated method stub
+
+	}
+
+	@Override
+	public void switchPortChanged(Long switchId) {
+		// TODO Auto-generated method stub
+
+	}
+
+	@Override
+	public String getName() {
+		return "OnosPublisher";
+	}
+
+	@Override
+	public void deviceAdded(IDevice device) {
+		// TODO Auto-generated method stub
+		log.debug("{}:deviceAdded(): Adding device {}",this.getClass(),device.getMACAddressString());
+		devStore.addDevice(device);
+	}
+
+	@Override
+	public void deviceRemoved(IDevice device) {
+		// TODO Auto-generated method stub
+
+	}
+
+	@Override
+	public void deviceMoved(IDevice device) {
+		// TODO Auto-generated method stub
+		devStore.changeDeviceAttachments(device);
+
+	}
+
+	@Override
+	public void deviceIPV4AddrChanged(IDevice device) {
+		// TODO Auto-generated method stub
+		devStore.changeDeviceIPv4Address(device);
+
+	}
+
+	@Override
+	public void deviceVlanChanged(IDevice device) {
+		// TODO Auto-generated method stub
+	}
+	
+
+	@Override
+	public Collection<Class<? extends IFloodlightService>> getModuleServices() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public Map<Class<? extends IFloodlightService>, IFloodlightService> getServiceImpls() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public Collection<Class<? extends IFloodlightService>> getModuleDependencies() {
+	    Collection<Class<? extends IFloodlightService>> l =
+	            new ArrayList<Class<? extends IFloodlightService>>();
+	        l.add(IFloodlightProviderService.class);
+	        l.add(IDeviceService.class);
+	        return l;
+	}
+
+	@Override
+	public void init(FloodlightModuleContext context)
+			throws FloodlightModuleException {
+		// TODO Auto-generated method stub
+		Map<String, String> configMap = context.getConfigParams(this);
+		String conf = configMap.get(DBConfigFile);
+		
+		log = LoggerFactory.getLogger(OnosPublisher.class);
+		deviceService = context.getServiceImpl(IDeviceService.class);
+		
+		swStore = new SwitchStorageImpl();
+		swStore.init(conf);
+		devStore = new DeviceStorageImpl();
+		devStore.init(conf);
+		
+		log.debug("Initializing OnosPublisher module with {}", conf);
+		
+	}
+
+	@Override
+	public void startUp(FloodlightModuleContext context) {
+		// TODO Auto-generated method stub
+		deviceService.addListener(this);		
+	}
+
+}
diff --git a/src/main/java/net/onrc/onos/util/GraphDBConnection.java b/src/main/java/net/onrc/onos/util/GraphDBConnection.java
new file mode 100644
index 0000000..7c1ea2a
--- /dev/null
+++ b/src/main/java/net/onrc/onos/util/GraphDBConnection.java
@@ -0,0 +1,84 @@
+package net.onrc.onos.util;
+
+import java.util.Set;
+
+import com.thinkaurelius.titan.core.TitanFactory;
+import com.thinkaurelius.titan.core.TitanGraph;
+import com.tinkerpop.blueprints.Vertex;
+import com.tinkerpop.blueprints.TransactionalGraph.Conclusion;
+import com.tinkerpop.frames.FramedGraph;
+
+public class GraphDBConnection {
+	public enum Transaction {
+		COMMIT,
+		ROLLBACK
+	}
+	private static GraphDBConnection singleton = new GraphDBConnection( );
+	private static TitanGraph graph;
+	private static GraphDBUtils utils;
+	   
+	   /* A private Constructor prevents any other 
+	    * class from instantiating.
+	    */
+	   private GraphDBConnection(){ }
+	   
+	   /* Static 'instance' method */
+	   public static GraphDBConnection getInstance(String conf) {
+		   if (graph == null||graph.isOpen()) {
+		        graph = TitanFactory.open(conf);		        
+		        // FIXME: Creation on Indexes should be done only once
+		        Set<String> s = graph.getIndexedKeys(Vertex.class);
+		        if (!s.contains("dpid")) {
+		           graph.createKeyIndex("dpid", Vertex.class);
+		        }
+		        if (!s.contains("type")) {
+		        	graph.createKeyIndex("type", Vertex.class);
+		        }
+		        if (!s.contains("dl_address")) {
+		        	graph.createKeyIndex("dl_address", Vertex.class);
+		        }
+		   }
+		   graph.stopTransaction(Conclusion.SUCCESS);
+		   if (utils == null) {
+			   utils = new GraphDBUtils();
+		   }
+	      return singleton;
+	   }
+	   
+	   public IDBUtils utils() {
+		   return utils;
+	   }
+	   
+	   protected FramedGraph<TitanGraph> getFramedGraph() {
+	   
+		   	if (isValid()) {
+		   		FramedGraph<TitanGraph> fg = new FramedGraph<TitanGraph>(graph);
+		   		return fg;
+		   	} else {
+		   		return null;
+		   	}
+	   }
+	   
+	   public Boolean isValid() {
+		   
+		   return (graph != null||graph.isOpen());
+	   }
+	   
+	   public void startTx() {
+		   
+	   }
+	   
+	   public void endTx(Transaction tx) {
+		   switch (tx) {
+		   case COMMIT:
+			   graph.stopTransaction(Conclusion.SUCCESS);
+		   case ROLLBACK:
+			   graph.stopTransaction(Conclusion.FAILURE);
+		   }
+	   }
+	   
+	   public void close() {
+		   
+	   }
+	   
+}
diff --git a/src/main/java/net/onrc/onos/util/GraphDBUtils.java b/src/main/java/net/onrc/onos/util/GraphDBUtils.java
new file mode 100644
index 0000000..8bb83ea
--- /dev/null
+++ b/src/main/java/net/onrc/onos/util/GraphDBUtils.java
@@ -0,0 +1,59 @@
+package net.onrc.onos.util;
+
+import com.thinkaurelius.titan.core.TitanGraph;
+import com.thinkaurelius.titan.graphdb.transaction.VertexIterable;
+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.IPortObject;
+import net.floodlightcontroller.core.INetMapTopologyObjects.ISwitchObject;
+import net.floodlightcontroller.routing.Link;
+
+public class GraphDBUtils implements IDBUtils {
+
+	@Override
+	public ISwitchObject searchSwitch(GraphDBConnection conn, String dpid) {
+		// TODO Auto-generated method stub
+		FramedGraph<TitanGraph> fg = conn.getFramedGraph();
+		
+		return fg.getVertices("dpid",dpid).iterator().hasNext() ? 
+				fg.getVertices("dpid",dpid,ISwitchObject.class).iterator().next() : null;
+    			
+	}
+
+	@Override
+	public IDeviceObject searchDevice(GraphDBConnection conn, String macAddr) {
+		// TODO Auto-generated method stub
+		FramedGraph<TitanGraph> fg = conn.getFramedGraph();	
+		return fg.getVertices("dl_address",macAddr).iterator().hasNext() ? fg.getVertices("dl_address",macAddr,
+    			IDeviceObject.class).iterator().next() : null;
+    			
+	}
+
+	@Override
+	public IPortObject searchPort(GraphDBConnection conn, String dpid, short number) {
+		ISwitchObject sw = searchSwitch(conn, dpid);
+		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);
+	    return r.iterator().hasNext() ? r.iterator().next() : null;		
+	}
+
+	@Override
+	public IDeviceObject newDevice(GraphDBConnection conn) {
+		FramedGraph<TitanGraph> fg = conn.getFramedGraph();	
+		IDeviceObject obj = fg.addVertex(null,IDeviceObject.class);
+		return obj;
+	}
+
+	@Override
+	public void removeDevice(GraphDBConnection conn, IDeviceObject dev) {
+		FramedGraph<TitanGraph> fg = conn.getFramedGraph();	
+		fg.removeVertex(dev.asVertex());		
+	}
+
+}
diff --git a/src/main/java/net/onrc/onos/util/IDBUtils.java b/src/main/java/net/onrc/onos/util/IDBUtils.java
new file mode 100644
index 0000000..52dbc70
--- /dev/null
+++ b/src/main/java/net/onrc/onos/util/IDBUtils.java
@@ -0,0 +1,13 @@
+package net.onrc.onos.util;
+
+import net.floodlightcontroller.core.INetMapTopologyObjects.IDeviceObject;
+import net.floodlightcontroller.core.INetMapTopologyObjects.IPortObject;
+import net.floodlightcontroller.core.INetMapTopologyObjects.ISwitchObject;
+
+public interface IDBUtils {	
+	public ISwitchObject searchSwitch(GraphDBConnection conn, String dpid);
+	public IDeviceObject searchDevice(GraphDBConnection conn, String macAddr);
+	public IDeviceObject newDevice(GraphDBConnection conn);
+	public void removeDevice(GraphDBConnection conn, IDeviceObject dev);
+	public IPortObject searchPort(GraphDBConnection conn, String dpid, short number);
+}
diff --git a/src/main/resources/META-INF/services/net.floodlightcontroller.core.module.IFloodlightModule b/src/main/resources/META-INF/services/net.floodlightcontroller.core.module.IFloodlightModule
index c389220..99ca4c8 100644
--- a/src/main/resources/META-INF/services/net.floodlightcontroller.core.module.IFloodlightModule
+++ b/src/main/resources/META-INF/services/net.floodlightcontroller.core.module.IFloodlightModule
@@ -23,6 +23,7 @@
 net.floodlightcontroller.core.test.MockFloodlightProvider
 net.floodlightcontroller.core.test.MockThreadPoolService
 net.floodlightcontroller.firewall.Firewall
+net.floodlightcontroller.onoslistener.OnosPublisher
 net.floodlightcontroller.flowcache.FlowManager
 net.floodlightcontroller.routing.TopoRouteService
 net.onrc.onos.registry.controller.ZookeeperRegistry
diff --git a/src/main/resources/floodlightdefault.properties b/src/main/resources/floodlightdefault.properties
index 68a96c5..9ea7a92 100644
--- a/src/main/resources/floodlightdefault.properties
+++ b/src/main/resources/floodlightdefault.properties
@@ -9,9 +9,11 @@
 net.floodlightcontroller.counter.CounterStore,\
 net.floodlightcontroller.perfmon.PktInProcessingTime,\
 net.floodlightcontroller.ui.web.StaticWebRoutable,\
+net.floodlightcontroller.onoslistener.OnosPublisher, \
 net.onrc.onos.registry.controller.StandaloneRegistry
 net.floodlightcontroller.restserver.RestApiServer.port = 8080
 net.floodlightcontroller.core.FloodlightProvider.openflowport = 6633
 net.floodlightcontroller.jython.JythonDebugInterface.port = 6655
 net.floodlightcontroller.forwarding.Forwarding.idletimeout = 5
 net.floodlightcontroller.forwarding.Forwarding.hardtimeout = 0
+net.floodlightcontroller.onoslistener.OnosPublisher.dbconf = /tmp/cassandra.titan