diff --git a/src/main/java/net/onrc/onos/util/GraphDBConnection.java b/src/main/java/net/onrc/onos/util/GraphDBConnection.java
index 9a50f47..1cc4e5a 100644
--- a/src/main/java/net/onrc/onos/util/GraphDBConnection.java
+++ b/src/main/java/net/onrc/onos/util/GraphDBConnection.java
@@ -43,6 +43,11 @@
 	}
 
 	/* Static 'instance' method */
+	/**
+	 * Get the instance of GraphDBConnection class.
+	 * @param conf the path to the database configuration file.
+	 * @return GraphDBConnection instance.
+	 */
 	public static synchronized GraphDBConnection getInstance(final String conf) {
 		if (GraphDBConnection.configFile == null
 				|| GraphDBConnection.configFile.isEmpty()) {
@@ -79,6 +84,9 @@
 		return singleton;
 	}
 
+	/** 
+	 * Get a FramedGraph instance of the graph.
+	 */
 	public FramedGraph<TitanGraph> getFramedGraph() {
 		if (isValid()) {
 			FramedGraph<TitanGraph> fg = new FramedGraph<TitanGraph>(graph);
@@ -89,6 +97,10 @@
 		}
 	}
 
+	/**
+	 * Get EventTransactionalGraph of the titan graph.
+	 * @return EventTransactionalGraph of the titan graph
+	 */
 	protected EventTransactionalGraph<TitanGraph> getEventGraph() {
 		if (isValid()) {
 			return eg;
@@ -97,16 +109,25 @@
 		}
 	}
 
+	/**
+	 * Add LocalGraphChangedLister for the graph.
+	 */
 	public void addEventListener(final LocalGraphChangedListener listener) {
 		EventTransactionalGraph<TitanGraph> eg = this.getEventGraph();
 		eg.addListener(listener);
 		log.debug("Registered listener {}", listener.getClass());
 	}
 
+	/**
+	 * Return whether this connection is valid.
+	 */
 	public Boolean isValid() {
 		return (graph != null || graph.isOpen());
 	}
 
+	/**
+	 * Commit changes for the graph operations.
+	 */
 	public void commit() {
 		try {
 			graph.commit();
@@ -116,6 +137,9 @@
 		}
 	}
 
+	/**
+	 * Rollback changes for the graph operations.
+	 */
 	public void rollback() {
 		try {
 			graph.rollback();
@@ -125,6 +149,9 @@
 		}
 	}
 
+	/**
+	 * Close this database connection.
+	 */
 	public void close() {
 		commit();
 	}
diff --git a/src/main/java/net/onrc/onos/util/GraphDBOperation.java b/src/main/java/net/onrc/onos/util/GraphDBOperation.java
index da41dbd..92157fb 100644
--- a/src/main/java/net/onrc/onos/util/GraphDBOperation.java
+++ b/src/main/java/net/onrc/onos/util/GraphDBOperation.java
@@ -20,16 +20,27 @@
 
 public class GraphDBOperation implements IDBOperation {
 	private GraphDBConnection conn;
-	
+
+	/**
+	 * Create a GraphDBOperation instance from specified GraphDBConnection's instance.
+	 * @param dbConnection an instance of GraphDBConnection
+	 */
 	public GraphDBOperation(GraphDBConnection dbConnection) {
 		this.conn = dbConnection;
 	}
-	
+
+	/**
+	 * Create a GraphDBOperation instance from database configuration path.
+	 * @param dbConfPath a path for database configuration file.
+	 */
 	public GraphDBOperation(final String dbConfPath) {
 		this.conn = GraphDBConnection.getInstance(dbConfPath);
 	}
 
-	@Override
+	/**
+	 * Create a new switch and return the created switch object.
+	 * @param dpid DPID of the switch
+	 */
 	public ISwitchObject newSwitch(String dpid) {
 		FramedGraph<TitanGraph> fg = conn.getFramedGraph();	
 		ISwitchObject obj = fg.addVertex(null,ISwitchObject.class);
@@ -40,7 +51,10 @@
 		return obj;
 	}
 
-	@Override
+	/**
+	 * Search and get a switch object with DPID.
+	 * @param dpid DPID of the switch 
+	 */
 	public ISwitchObject searchSwitch(String dpid) {
 		// TODO Auto-generated method stub
 		FramedGraph<TitanGraph> fg = conn.getFramedGraph();
@@ -50,7 +64,10 @@
 				
 	}
 
-	@Override
+	/**
+	 * Search and get an active switch object with DPID.
+	 * @param dpid DPID of the switch 
+	 */
 	public ISwitchObject searchActiveSwitch(String dpid) {
 	
 	    ISwitchObject sw = searchSwitch(dpid);
@@ -61,14 +78,18 @@
 	    return null;
 	}
 
-	@Override
+	/**
+	 * Get all switch objects.
+	 */
 	public Iterable<ISwitchObject> getAllSwitches() {
 		FramedGraph<TitanGraph> fg = conn.getFramedGraph();
 		Iterable<ISwitchObject> switches =  fg.getVertices("type","switch",ISwitchObject.class);
 		return switches;
 	}
 
-	@Override
+	/**
+	 * Get all active switch objects.
+	 */
 	public Iterable<ISwitchObject> getActiveSwitches() {
 		FramedGraph<TitanGraph> fg = conn.getFramedGraph();
 		Iterable<ISwitchObject> switches =  fg.getVertices("type","switch",ISwitchObject.class);
@@ -82,7 +103,9 @@
 		return activeSwitches;
 	}
 
-	@Override
+	/**
+	 * Get all inactive switch objects.
+	 */
 	public Iterable<ISwitchObject> getInactiveSwitches() {
 		FramedGraph<TitanGraph> fg = conn.getFramedGraph();
 		Iterable<ISwitchObject> switches =  fg.getVertices("type","switch",ISwitchObject.class);
@@ -96,20 +119,28 @@
 		return inactiveSwitches;
 	}
 
-	@Override
+	/**
+	 * Get all flow entries' objects where their switches are not updated.
+	 */
 	public Iterable<IFlowEntry> getAllSwitchNotUpdatedFlowEntries() {
 		FramedGraph<TitanGraph> fg = conn.getFramedGraph();
 		//TODO: Should use an enum for flow_switch_state
 		return fg.getVertices("switch_state", "FE_SWITCH_NOT_UPDATED", IFlowEntry.class);
 	}
 
-	@Override
+	/**
+	 * Remove specified switch.
+	 * @param sw switch object to remove
+	 */
 	public void removeSwitch(ISwitchObject sw) {
 		FramedGraph<TitanGraph> fg = conn.getFramedGraph();	
 		fg.removeVertex(sw.asVertex());		
 	}
 
-	@Override
+	/**
+	 * Create a port having specified port number.
+	 * @param portNumber port number
+	 */
 	public IPortObject newPort(Short portNumber) {
 		FramedGraph<TitanGraph> fg = conn.getFramedGraph();	
 		IPortObject obj = fg.addVertex(null,IPortObject.class);
@@ -120,25 +151,29 @@
 		return obj;
 	}
 
-	@Override
-		public IPortObject searchPort(String dpid, short number) {
-			ISwitchObject sw = searchSwitch(dpid);
-			if (sw != null) {
-				
-				IPortObject port = null;
-				
-				// Requires Frames 2.3.0
-				
-				try {
-					port = sw.getPort(number);
-				} catch (Exception e) {
-					// TODO Auto-generated catch block
-					e.printStackTrace();
-				}
-				
-				return port;
+	/**
+	 * Search and get a port object of specified switch and port number.
+	 * @param dpid DPID of a switch
+	 * @param number port number of the switch's port
+	 */
+	public IPortObject searchPort(String dpid, short number) {
+		ISwitchObject sw = searchSwitch(dpid);
+		if (sw != null) {
+			
+			IPortObject port = null;
+			
+			// Requires Frames 2.3.0
+			
+			try {
+				port = sw.getPort(number);
+			} catch (Exception e) {
+				// TODO Auto-generated catch block
+				e.printStackTrace();
 			}
 			
+			return port;
+		}
+			
 	//		if (sw != null) {
 	//			GremlinPipeline<Vertex, IPortObject> pipe = new GremlinPipeline<Vertex, IPortObject>();
 	//			pipe.start(sw.asVertex());
@@ -146,17 +181,22 @@
 	//			FramedVertexIterable<IPortObject> r = new FramedVertexIterable<IPortObject>(conn.getFramedGraph(), (Iterable) pipe, IPortObject.class);
 	//			return r != null && r.iterator().hasNext() ? r.iterator().next() : null;
 	//		}
-			return null;
-		}
+		return null;
+	}
 
-	@Override
-		public void removePort(IPortObject port) {
-			FramedGraph<TitanGraph> fg = conn.getFramedGraph();	
-	//		EventGraph<TitanGraph> eg = conn.getEventGraph();
-			if (fg != null) fg.removeVertex(port.asVertex());		
-		}
+	/**
+	 * Remove the specified switch port.
+	 * @param port switch port object to remove
+	 */
+	public void removePort(IPortObject port) {
+		FramedGraph<TitanGraph> fg = conn.getFramedGraph();	
+//		EventGraph<TitanGraph> eg = conn.getEventGraph();
+		if (fg != null) fg.removeVertex(port.asVertex());		
+	}
 
-	@Override
+	/**
+	 * Create and return a device object.
+	 */
 	public IDeviceObject newDevice() {
 		FramedGraph<TitanGraph> fg = conn.getFramedGraph();	
 		IDeviceObject obj = fg.addVertex(null,IDeviceObject.class);
@@ -164,7 +204,10 @@
 		return obj;
 	}
 
-	@Override
+	/**
+	 * Search and get a device object having specified MAC address.
+	 * @param macAddr MAC address to search and get
+	 */
 	public IDeviceObject searchDevice(String macAddr) {
 		// TODO Auto-generated method stub
 		FramedGraph<TitanGraph> fg = conn.getFramedGraph();	
@@ -172,19 +215,26 @@
 			fg.getVertices("dl_addr",macAddr, IDeviceObject.class).iterator().next() : null;
 	}
 
-	@Override
+	/**
+	 * Get all devices.
+	 */
 	public Iterable<IDeviceObject> getDevices() {
 		FramedGraph<TitanGraph> fg = conn.getFramedGraph();	
 		return fg != null ? fg.getVertices("type","device",IDeviceObject.class) : null;
 	}
 
-	@Override
+	/**
+	 * Remove the specified device.
+	 * @param dev a device object to remove
+	 */
 	public void removeDevice(IDeviceObject dev) {
 		FramedGraph<TitanGraph> fg = conn.getFramedGraph();	
 		if (fg != null) fg.removeVertex(dev.asVertex());		
 	}
 
-	@Override
+	/**
+	 * Create and return a flow path object.
+	 */
 	public IFlowPath newFlowPath() {
 		FramedGraph<TitanGraph> fg = conn.getFramedGraph();	
 		IFlowPath flowPath = fg.addVertex(null, IFlowPath.class);
@@ -192,7 +242,10 @@
 		return flowPath;
 	}
 
-	@Override
+	/**
+	 * Search and get a flow path object with specified flow ID.
+	 * @param flowId flow ID to search
+	 */
 	public IFlowPath searchFlowPath(FlowId flowId) {
 		FramedGraph<TitanGraph> fg = conn.getFramedGraph();
 		
@@ -201,7 +254,10 @@
 				   IFlowPath.class).iterator().next() : null;
 	}
 
-	@Override
+	/**
+	 * Get a flow path object with a flow entry.
+	 * @param flowEntry flow entry object
+	 */
 	public IFlowPath getFlowPathByFlowEntry(IFlowEntry flowEntry) {
 		GremlinPipeline<Vertex, IFlowPath> pipe = new GremlinPipeline<Vertex, IFlowPath>();
 		pipe.start(flowEntry.asVertex());
@@ -210,7 +266,9 @@
 		return r.iterator().hasNext() ? r.iterator().next() : null;
 	}
 
-	@Override
+	/**
+	 * Get all flow path objects.
+	 */
     public Iterable<IFlowPath> getAllFlowPaths() {
 		FramedGraph<TitanGraph> fg = conn.getFramedGraph();
 		Iterable<IFlowPath> flowPaths = fg.getVertices("type", "flow", IFlowPath.class);
@@ -225,13 +283,18 @@
 		return nonNullFlows;
 	}
 
-	@Override
+    /**
+     * Remove the specified flow path.
+     * @param flowPath flow path object to remove
+     */
 	public void removeFlowPath(IFlowPath flowPath) {
 		FramedGraph<TitanGraph> fg = conn.getFramedGraph();
 		fg.removeVertex(flowPath.asVertex());
 	}
 
-	@Override
+	/**
+	 * Create and return a flow entry object.
+	 */
 	public IFlowEntry newFlowEntry() {
 		FramedGraph<TitanGraph> fg = conn.getFramedGraph();	
 		IFlowEntry flowEntry = fg.addVertex(null, IFlowEntry.class);
@@ -239,7 +302,10 @@
 		return flowEntry;
 	}
 
-	@Override
+	/**
+	 * Search and get a flow entry object with flow entry ID.
+	 * @param flowEntryId flow entry ID to search
+	 */
 	public IFlowEntry searchFlowEntry(FlowEntryId flowEntryId) {
 		FramedGraph<TitanGraph> fg = conn.getFramedGraph();
 		
@@ -248,31 +314,48 @@
 				   IFlowEntry.class).iterator().next() : null;
 	}
 
-	@Override
-        public Iterable<IFlowEntry> getAllFlowEntries() {
+	/**
+	 * Get all flow entry objects.
+	 */
+	public Iterable<IFlowEntry> getAllFlowEntries() {
 		FramedGraph<TitanGraph> fg = conn.getFramedGraph();
 		
 		return fg.getVertices("type", "flow_entry", IFlowEntry.class);
 	}
 
-	@Override
+	/**
+	 * Remove the specified flow entry.
+	 * @param flowEntry flow entry object to remove
+	 */
 	public void removeFlowEntry(IFlowEntry flowEntry) {
 		FramedGraph<TitanGraph> fg = conn.getFramedGraph();
 		fg.removeVertex(flowEntry.asVertex());
 	}
 	
+	/**
+	 * Get the instance of GraphDBConnection assigned to this class.
+	 */
 	public IDBConnection getDBConnection() {
 		return conn;
 	}
 	
+	/**
+	 * Commit changes for the graph.
+	 */
 	public void commit() {
 		conn.commit();
 	}
-	
+
+	/**
+	 * Rollback changes for the graph.
+	 */
 	public void rollback() {
 		conn.rollback();
 	}
 
+	/**
+	 * Close the connection of the assigned GraphDBConnection.
+	 */
 	public void close() {
 		conn.close();
 	}
