Merge pull request #428 from jonohart/master

Work on the ARP module and FlowCache for SDNIP
diff --git a/pom.xml b/pom.xml
index 3e9dc4c..943133d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -34,6 +34,7 @@
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     <powermock.version>1.5</powermock.version>
     <restlet.version>2.1-RC1</restlet.version>
+    <github.global.server>github</github.global.server>
   </properties>
   <build>
     <plugins>
@@ -145,6 +146,25 @@
           </execution>
         </executions>
       </plugin>
+      <plugin>
+        <groupId>com.github.github</groupId>
+        <artifactId>site-maven-plugin</artifactId>
+        <version>0.8</version>
+        <configuration>
+          <message>Creating site for ${project.version}</message>
+          <dryRun>true</dryRun>
+          <repositoryName>ONOS</repositoryName>
+          <repositoryOwner>OPENNETWORKINGLAB</repositoryOwner>
+        </configuration>
+        <executions>
+          <execution>
+            <goals>
+             <goal>site</goal>
+            </goals>
+            <phase>site</phase>
+          </execution>
+        </executions>
+      </plugin>
     </plugins>
   </build>
   <!-- for getting visualization reporting   -->
@@ -152,11 +172,13 @@
     <excludeDefaults>true</excludeDefaults>
     <outputDirectory>${project.build.directory}/site</outputDirectory>
     <plugins>
+      <!--
       <plugin>
         <groupId>org.apache.camel</groupId>
         <artifactId>guice-maven-plugin</artifactId>
         <version>2.11.0</version>
       </plugin>
+      -->
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-project-info-reports-plugin</artifactId>
@@ -169,7 +191,7 @@
           <reportSet>
             <reports>
               <report>dependencies</report>
-              <report>maven-emma-plugin</report>
+              <!--report>maven-emma-plugin</report-->
               <report>scm</report>
             </reports>
           </reportSet>
diff --git a/src/main/java/net/onrc/onos/graph/GraphDBOperation.java b/src/main/java/net/onrc/onos/graph/GraphDBOperation.java
index acfe43b..f1e9b46 100644
--- a/src/main/java/net/onrc/onos/graph/GraphDBOperation.java
+++ b/src/main/java/net/onrc/onos/graph/GraphDBOperation.java
@@ -3,8 +3,6 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.openflow.protocol.OFPhysicalPort;
-
 import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IDeviceObject;
 import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IFlowEntry;
 import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IFlowPath;
@@ -14,7 +12,6 @@
 import net.onrc.onos.ofcontroller.util.FlowEntryId;
 import net.onrc.onos.ofcontroller.util.FlowId;
 
-import com.google.common.base.Stopwatch;
 import com.thinkaurelius.titan.core.TitanGraph;
 import com.tinkerpop.blueprints.Vertex;
 import com.tinkerpop.frames.FramedGraph;
diff --git a/src/main/java/net/onrc/onos/ofcontroller/core/INetMapTopologyObjects.java b/src/main/java/net/onrc/onos/ofcontroller/core/INetMapTopologyObjects.java
index 9a96638..7b38fef 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/core/INetMapTopologyObjects.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/core/INetMapTopologyObjects.java
@@ -8,7 +8,6 @@
 
 import com.tinkerpop.blueprints.Direction;
 import com.tinkerpop.frames.Adjacency;
-import com.tinkerpop.frames.Incidence;
 import com.tinkerpop.frames.Property;
 import com.tinkerpop.frames.annotations.gremlin.GremlinGroovy;
 import com.tinkerpop.frames.annotations.gremlin.GremlinParam;
diff --git a/src/main/java/net/onrc/onos/ofcontroller/core/INetMapTopologyService.java b/src/main/java/net/onrc/onos/ofcontroller/core/INetMapTopologyService.java
index 1992624..954515b 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/core/INetMapTopologyService.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/core/INetMapTopologyService.java
@@ -83,7 +83,7 @@
 	     * See the documentation for method @ref prepareShortestPathTopo()
 	     * for additional information and usage.
 	     *
-	     * @shortestPathTopo the Shortest Path info handler to release.
+	     * @param shortestPathTopo the Shortest Path info handler to release.
 	     */
 	    void dropShortestPathTopo(Map<Long, ?> shortestPathTopo);
 
@@ -95,7 +95,7 @@
 	     * See the documentation for method @ref prepareShortestPathTopo()
 	     * for additional information and usage.
 	     *
-	     * @paran shortestPathTopoHandler the Shortest Path info handler
+	     * @param shortestPathTopo the Shortest Path info handler
 	     * to use.
 	     * @param src the source in the shortest path computation.
 	     * @param dest the destination in the shortest path computation.
diff --git a/src/main/java/net/onrc/onos/ofcontroller/core/ISwitchStorage.java b/src/main/java/net/onrc/onos/ofcontroller/core/ISwitchStorage.java
index a4dd528..4fcebb2 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/core/ISwitchStorage.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/core/ISwitchStorage.java
@@ -1,8 +1,5 @@
 package net.onrc.onos.ofcontroller.core;
 
-import java.util.Collection;
-
-
 import net.floodlightcontroller.core.IOFSwitch;
 
 import org.openflow.protocol.OFPhysicalPort;
diff --git a/src/main/java/net/onrc/onos/ofcontroller/core/internal/LinkStorageImpl.java b/src/main/java/net/onrc/onos/ofcontroller/core/internal/LinkStorageImpl.java
index c37fad2..e5f2f58 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/core/internal/LinkStorageImpl.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/core/internal/LinkStorageImpl.java
@@ -15,10 +15,7 @@
 import org.slf4j.LoggerFactory;
 
 import com.thinkaurelius.titan.core.TitanException;
-import com.tinkerpop.blueprints.Direction;
-import com.tinkerpop.blueprints.Edge;
 import com.tinkerpop.blueprints.Vertex;
-import com.tinkerpop.gremlin.java.GremlinPipeline;
 import com.tinkerpop.pipes.PipeFunction;
 import com.tinkerpop.pipes.transform.PathPipe;
 
@@ -142,7 +139,7 @@
 	
 	/**
 	 * Delete a record in the LinkStorage.
-	 * @param link Record to be deleted.
+	 * @param lt Record to be deleted.
 	 */
 	@Override
 	public void deleteLink(Link lt) {
diff --git a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowManager.java b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowManager.java
index 2b3b0f2..ce9941e 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowManager.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowManager.java
@@ -64,7 +64,9 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-
+/**
+ * Flow Manager class for handling the network flows.
+ */
 public class FlowManager implements IFloodlightModule, IFlowService, INetMapStorage {
 
     protected GraphDBOperation op;
@@ -105,6 +107,10 @@
     private ScheduledExecutorService mapReaderScheduler;
     private ScheduledExecutorService shortestPathReconcileScheduler;
 
+    /**
+     * Periodic task for reading the Flow Entries and pushing changes
+     * into the switches.
+     */
     final Runnable mapReader = new Runnable() {
 	    public void run() {
 		try {
@@ -249,6 +255,10 @@
 	    }
 	};
 
+    /**
+     * Periodic task for reading the Flow Paths and recomputing the
+     * shortest paths.
+     */
     final Runnable shortestPathReconcile = new Runnable() {
 	    public void run() {
 		try {
@@ -414,27 +424,38 @@
 	    }
 	};
 
-    //final ScheduledFuture<?> mapReaderHandle =
-	//mapReaderScheduler.scheduleAtFixedRate(mapReader, 3, 3, TimeUnit.SECONDS);
 
-    //final ScheduledFuture<?> shortestPathReconcileHandle =
-	//shortestPathReconcileScheduler.scheduleAtFixedRate(shortestPathReconcile, 3, 3, TimeUnit.SECONDS);
-
+    /**
+     * Initialize the Flow Manager.
+     *
+     * @param conf the Graph Database configuration string.
+     */
     @Override
     public void init(String conf) {
     	op = new GraphDBOperation(conf);
 	topoRouteService = new TopoRouteService(conf);
     }
 
+    /**
+     * Shutdown the Flow Manager operation.
+     */
     public void finalize() {
     	close();
     }
 
+    /**
+     * Shutdown the Flow Manager operation.
+     */
     @Override
     public void close() {
     	op.close();
     }
 
+    /**
+     * Get the collection of offered module services.
+     *
+     * @return the collection of offered module services.
+     */
     @Override
     public Collection<Class<? extends IFloodlightService>> getModuleServices() {
         Collection<Class<? extends IFloodlightService>> l = 
@@ -443,6 +464,11 @@
         return l;
     }
 
+    /**
+     * Get the collection of implemented services.
+     *
+     * @return the collection of implemented services.
+     */
     @Override
     public Map<Class<? extends IFloodlightService>, IFloodlightService> 
 			       getServiceImpls() {
@@ -454,6 +480,11 @@
         return m;
     }
 
+    /**
+     * Get the collection of modules this module depends on.
+     *
+     * @return the collection of modules this module depends on.
+     */
     @Override
     public Collection<Class<? extends IFloodlightService>> 
                                                     getModuleDependencies() {
@@ -464,6 +495,11 @@
         return l;
     }
 
+    /**
+     * Initialize the module.
+     *
+     * @param context the module context to use for the initialization.
+     */
     @Override
     public void init(FloodlightModuleContext context)
 	throws FloodlightModuleException {
@@ -478,10 +514,15 @@
 	String conf = "/tmp/cassandra.titan";
 	this.init(conf);
 	
-		mapReaderScheduler = Executors.newScheduledThreadPool(1);
-		shortestPathReconcileScheduler = Executors.newScheduledThreadPool(1);
+	mapReaderScheduler = Executors.newScheduledThreadPool(1);
+	shortestPathReconcileScheduler = Executors.newScheduledThreadPool(1);
     }
 
+    /**
+     * Get the next Flow Entry ID to use.
+     *
+     * @return the next Flow Entry ID to use.
+     */
     private synchronized long getNextFlowEntryId() {
 	//
 	// Generate the next Flow Entry ID.
@@ -500,17 +541,22 @@
 	return result;
     }
 
+    /**
+     * Startup module operation.
+     *
+     * @param context the module context to use for the startup.
+     */
     @Override
     public void startUp(FloodlightModuleContext context) {
-		restApi.addRestletRoutable(new FlowWebRoutable());
+	restApi.addRestletRoutable(new FlowWebRoutable());
 	
-		// Initialize the Flow Entry ID generator
-		nextFlowEntryIdPrefix = randomGenerator.nextInt();
+	// Initialize the Flow Entry ID generator
+	nextFlowEntryIdPrefix = randomGenerator.nextInt();
 		
-		mapReaderScheduler.scheduleAtFixedRate(
-				mapReader, 3, 3, TimeUnit.SECONDS);
-		shortestPathReconcileScheduler.scheduleAtFixedRate(
-				shortestPathReconcile, 3, 3, TimeUnit.SECONDS);
+	mapReaderScheduler.scheduleAtFixedRate(
+			mapReader, 3, 3, TimeUnit.SECONDS);
+	shortestPathReconcileScheduler.scheduleAtFixedRate(
+			shortestPathReconcile, 3, 3, TimeUnit.SECONDS);
     }
 
     /**
@@ -747,8 +793,7 @@
 	// - flowEntry.actionOutputPort()
 	// - flowEntry.actions()
 	//
-	ISwitchObject sw =
-	    op.searchSwitch(flowEntry.dpid().toString());
+	ISwitchObject sw = op.searchSwitch(flowEntry.dpid().toString());
 	flowEntryObj.setSwitchDpid(flowEntry.dpid().toString());
 	flowEntryObj.setSwitch(sw);
 	if (flowEntry.flowEntryMatch().matchInPort()) {
@@ -1164,21 +1209,22 @@
     }
 
     /**
-     * Get summary of all installed flows by all installers in a given range
+     * Get summary of all installed flows by all installers in a given range.
      *
-     * @param flowId the data path endpoints of the flows to get.
-     * @param maxFlows: the maximum number of flows to be returned
+     * @param flowId the Flow ID of the first flow in the flow range to get.
+     * @param maxFlows the maximum number of flows to be returned.
      * @return the Flow Paths if found, otherwise null.
      */
     @Override
     public ArrayList<IFlowPath> getAllFlowsSummary(FlowId flowId, int maxFlows) {
 
-		// TODO: The implementation below is not optimal:
-		// We fetch all flows, and then return only the subset that match
-		// the query conditions.
-		// We should use the appropriate Titan/Gremlin query to filter-out
-		// the flows as appropriate.
-		//
+	//
+	// TODO: The implementation below is not optimal:
+	// We fetch all flows, and then return only the subset that match
+	// the query conditions.
+	// We should use the appropriate Titan/Gremlin query to filter-out
+	// the flows as appropriate.
+	//
     	//ArrayList<FlowPath> flowPaths = new ArrayList<FlowPath>();
     	
     	ArrayList<IFlowPath> flowPathsWithoutFlowEntries = getAllFlowsWithoutFlowEntries();
@@ -1278,8 +1324,13 @@
 
 	return flowPaths;
     }
-    
-    public ArrayList<IFlowPath> getAllFlowsWithoutFlowEntries(){
+
+    /**
+     * Get all Flows information, without the associated Flow Entries.
+     *
+     * @return all Flows information, without the associated Flow Entries.
+     */
+    public ArrayList<IFlowPath> getAllFlowsWithoutFlowEntries() {
     	Iterable<IFlowPath> flowPathsObj = null;
     	ArrayList<IFlowPath> flowPathsObjArray = new ArrayList<IFlowPath>();
     	ArrayList<FlowPath> flowPaths = new ArrayList<FlowPath>();
diff --git a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/IFlowService.java b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/IFlowService.java
index 0fbb23c..df11d6b 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/IFlowService.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/IFlowService.java
@@ -10,7 +10,7 @@
 import net.onrc.onos.ofcontroller.util.FlowPath;
 
 /**
- * @short Interface for providing Flow Service to other modules.
+ * Interface for providing Flow Service to other modules.
  */
 public interface IFlowService extends IFloodlightService {
     /**
@@ -88,8 +88,8 @@
     /**
      * Get summary of all installed flows by all installers.
      *
-     * @param flowId: starting flow Id of the range
-     * @param maxFlows: number of flows to return
+     * @param flowId starting flow Id of the range
+     * @param maxFlows number of flows to return
      * @return the Flow Paths if found, otherwise null.
      */
     ArrayList<IFlowPath> getAllFlowsSummary(FlowId flowId, int maxFlows);
diff --git a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/web/AddFlowResource.java b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/web/AddFlowResource.java
index 2800305..7464ec5 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/web/AddFlowResource.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/web/AddFlowResource.java
@@ -14,10 +14,23 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+/**
+ * Flow Manager REST API implementation: Add a Flow with the Flow
+ * Entries:
+ *
+ *   POST /wm/flow/add/json
+ */
 public class AddFlowResource extends ServerResource {
 
     protected static Logger log = LoggerFactory.getLogger(AddFlowResource.class);
 
+    /**
+     * Implement the API.
+     *
+     * @param flowJson a string with the JSON representation of the Flow to
+     * add.
+     * @return the Flow ID of the added flow.
+     */
     @Post("json")
     public FlowId store(String flowJson) {
 	FlowId result = new FlowId();
diff --git a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/web/AddShortestPathFlowResource.java b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/web/AddShortestPathFlowResource.java
index 2a75c6a..c454b0f 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/web/AddShortestPathFlowResource.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/web/AddShortestPathFlowResource.java
@@ -14,10 +14,23 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+/**
+ * Flow Manager REST API implementation: Add a Flow by delegating
+ * the Shortest Path computation to ONOS:
+ *
+ *   POST /wm/flow/add-shortest-path/json
+ */
 public class AddShortestPathFlowResource extends ServerResource {
 
     protected static Logger log = LoggerFactory.getLogger(AddShortestPathFlowResource.class);
 
+    /**
+     * Implement the API.
+     *
+     * @param flowJson a string with the JSON representation of the Flow to
+     * add.
+     * @return the Flow ID of the added flow.
+     */
     @Post("json")
     public FlowId store(String flowJson) {
 	FlowId result = new FlowId();
diff --git a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/web/ClearFlowResource.java b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/web/ClearFlowResource.java
index 1daa2ab..db591ae 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/web/ClearFlowResource.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/web/ClearFlowResource.java
@@ -8,9 +8,22 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+/**
+ * Flow Manager REST API implementation: Clear internal Flow state.
+ *
+ * The "{flow-id}" request attribute value can be either a specific Flow ID,
+ * or the keyword "all" to clear all Flows:
+ *
+ *   GET /wm/flow/clear/{flow-id}/json
+ */
 public class ClearFlowResource extends ServerResource {
     protected static Logger log = LoggerFactory.getLogger(ClearFlowResource.class);
 
+    /**
+     * Implement the API.
+     *
+     * @return true on success, otehrwise false.
+     */
     @Get("json")
     public Boolean retrieve() {
 	Boolean result = false;
diff --git a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/web/DeleteFlowResource.java b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/web/DeleteFlowResource.java
index 393ff44..5b2bad4 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/web/DeleteFlowResource.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/web/DeleteFlowResource.java
@@ -8,9 +8,22 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+/**
+ * Flow Manager REST API implementation: Delete Flow state.
+ *
+ * The "{flow-id}" request attribute value can be either a specific Flow ID,
+ * or the keyword "all" to delete all Flows:
+ *
+ *   GET /wm/flow/delete/{flow-id}/json
+ */
 public class DeleteFlowResource extends ServerResource {
     protected static Logger log = LoggerFactory.getLogger(DeleteFlowResource.class);
 
+    /**
+     * Implement the API.
+     *
+     * @return true on success, otehrwise false.
+     */
     @Get("json")
     public Boolean retrieve() {
 	Boolean result = false;
diff --git a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/web/FlowWebRoutable.java b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/web/FlowWebRoutable.java
index e1c6da9..e027270 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/web/FlowWebRoutable.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/web/FlowWebRoutable.java
@@ -6,6 +6,9 @@
 import org.restlet.Restlet;
 import org.restlet.routing.Router;
 
+/**
+ * REST API implementation for the Flow Manager.
+ */
 public class FlowWebRoutable implements RestletRoutable {
     /**
      * Create the Restlet router and bind to the proper resources.
diff --git a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/web/GetAllFlowsByEndpointsResource.java b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/web/GetAllFlowsByEndpointsResource.java
index 6142096..0308e89 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/web/GetAllFlowsByEndpointsResource.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/web/GetAllFlowsByEndpointsResource.java
@@ -14,9 +14,29 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+/**
+ * Flow Manager REST API implementation: Get all Flow state for given
+ * source and destination switches and ports.
+ *
+ * The "{src-dpid}" request attribute value is the source DPID of the flows to
+ * get.
+ * The "{src-port}" request attribute value is the source port of the flows to
+ * get.
+ * The "{dst-dpid}" request attribute value is the destination DPID of the
+ * flows to get.
+ * The "{dst-port}" request attribute value is the destination port of the
+ * flows to get.
+ *
+ *   GET /wm/flow/getall-by-endpoints/{src-dpid}/{src-port}/{dst-dpid}/{dst-port}/json"
+ */
 public class GetAllFlowsByEndpointsResource extends ServerResource {
     protected static Logger log = LoggerFactory.getLogger(GetAllFlowsByEndpointsResource.class);
 
+    /**
+     * Implement the API.
+     *
+     * @return the collection of Flow states if any found, otherwise null.
+     */
     @Get("json")
     public ArrayList<FlowPath> retrieve() {
 	ArrayList<FlowPath> result = null;
diff --git a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/web/GetAllFlowsByInstallerIdResource.java b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/web/GetAllFlowsByInstallerIdResource.java
index 498108f..43f1618 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/web/GetAllFlowsByInstallerIdResource.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/web/GetAllFlowsByInstallerIdResource.java
@@ -15,9 +15,31 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+/**
+ * Flow Manager REST API implementation: Get all Flow state for a given
+ * Installer ID and given source and destination switches and ports.
+ *
+ * The "{installer-id}" request attribute value is the Installer ID of the
+ * flows to get.
+ * The "{src-dpid}" request attribute value is the source DPID of the flows to
+ * get.
+ * The "{src-port}" request attribute value is the source port of the flows to
+ * get.
+ * The "{dst-dpid}" request attribute value is the destination DPID of the
+ * flows to get.
+ * The "{dst-port}" request attribute value is the destination port of the
+ * flows to get.
+ *
+ *   GET /wm/flow/getall-by-installer-id/{installer-id}/{src-dpid}/{src-port}/{dst-dpid}/{dst-port}/json"
+ */
 public class GetAllFlowsByInstallerIdResource extends ServerResource {
     protected static Logger log = LoggerFactory.getLogger(GetAllFlowsByInstallerIdResource.class);
 
+    /**
+     * Implement the API.
+     *
+     * @return the collection of Flow states if any found, otherwise null.
+     */
     @Get("json")
     public ArrayList<FlowPath> retrieve() {
 	ArrayList<FlowPath> result = null;
diff --git a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/web/GetAllFlowsResource.java b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/web/GetAllFlowsResource.java
index 61eaf27..ab88348 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/web/GetAllFlowsResource.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/web/GetAllFlowsResource.java
@@ -10,9 +10,19 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+/**
+ * Flow Manager REST API implementation: Get all Flow state.
+ *
+ *   GET /wm/flow/getall/json"
+ */
 public class GetAllFlowsResource extends ServerResource {
     protected static Logger log = LoggerFactory.getLogger(GetAllFlowsResource.class);
 
+    /**
+     * Implement the API.
+     *
+     * @return the collection of Flow states if any found, otherwise null.
+     */
     @Get("json")
     public ArrayList<FlowPath> retrieve() {
 	ArrayList<FlowPath> result = null;
diff --git a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/web/GetFlowByIdResource.java b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/web/GetFlowByIdResource.java
index 48e7369..77a898c 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/web/GetFlowByIdResource.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/web/GetFlowByIdResource.java
@@ -9,9 +9,21 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+/**
+ * Flow Manager REST API implementation: Get a single Flow state.
+ *
+ * The "{flow-id}" request attribute value is the Flow ID of the flow to get:
+ *
+ *   GET /wm/flow/get/{flow-id}/json
+ */
 public class GetFlowByIdResource extends ServerResource {
     protected static Logger log = LoggerFactory.getLogger(GetFlowByIdResource.class);
 
+    /**
+     * Implement the API.
+     *
+     * @return the Flow state if the flow is found, otherwise null.
+     */
     @Get("json")
     public FlowPath retrieve() {
 	FlowPath result = null;
diff --git a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/web/GetSummaryFlowsResource.java b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/web/GetSummaryFlowsResource.java
index 4b3c00f..67e1ad6 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/web/GetSummaryFlowsResource.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/web/GetSummaryFlowsResource.java
@@ -11,9 +11,25 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+/**
+ * Flow Manager REST API implementation: Get summary of all installed
+ * flows by all installers in a given range.
+ *
+ * The "{flow-id}" request attribute value is the Flow ID of the flow in the
+ * flow range to get.
+ * The "{max-flows}" request attribute value is the maximum number of flows
+ * to be returned.
+ *
+ *   GET /wm/flow/getsummary/{flow-id}/{max-flows}/json"
+ */
 public class GetSummaryFlowsResource extends ServerResource {
     protected static Logger log = LoggerFactory.getLogger(GetSummaryFlowsResource.class);
 
+    /**
+     * Implement the API.
+     *
+     * @return the collection of Flow states if any found, otherwise null.
+     */
     @Get("json")
     public ArrayList<IFlowPath> retrieve() {
     	ArrayList<IFlowPath> result = null;
diff --git a/src/main/java/net/onrc/onos/ofcontroller/linkdiscovery/internal/LinkDiscoveryManager.java b/src/main/java/net/onrc/onos/ofcontroller/linkdiscovery/internal/LinkDiscoveryManager.java
index 7736723..c9f3d5e 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/linkdiscovery/internal/LinkDiscoveryManager.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/linkdiscovery/internal/LinkDiscoveryManager.java
@@ -34,7 +34,6 @@
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Set;
-import java.util.concurrent.BlockingQueue;
 import java.util.concurrent.LinkedBlockingQueue;
 import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.TimeUnit;
@@ -1393,7 +1392,6 @@
 
     /**
      * When a switch disconnects we remove any links from our map and notify.
-     * @param The id of the switch
      */
     @Override
     public void removedSwitch(IOFSwitch iofSwitch) {
diff --git a/src/main/java/net/onrc/onos/ofcontroller/routing/TopoRouteService.java b/src/main/java/net/onrc/onos/ofcontroller/routing/TopoRouteService.java
index a784d7d..21381d9 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/routing/TopoRouteService.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/routing/TopoRouteService.java
@@ -1,7 +1,5 @@
 package net.onrc.onos.ofcontroller.routing;
 
-import java.util.ArrayList;
-import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -27,8 +25,6 @@
 
 import com.tinkerpop.blueprints.Direction;
 import com.tinkerpop.blueprints.Vertex;
-import com.tinkerpop.pipes.PipeFunction;
-import com.tinkerpop.pipes.branch.LoopPipe.LoopBundle;
 
 
 /**
diff --git a/src/main/java/net/onrc/onos/ofcontroller/util/FlowEntryAction.java b/src/main/java/net/onrc/onos/ofcontroller/util/FlowEntryAction.java
index f150983..1f8849a 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/util/FlowEntryAction.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/util/FlowEntryAction.java
@@ -1508,7 +1508,7 @@
      * Set the action to output to queue on a port.
      *
      * @param port the port to set.
-     * @param int queueId the queue ID to set.
+     * @param queueId the queue ID to set.
      */
     public void setActionEnqueue(Port port, int queueId) {
 	actionEnqueue = new ActionEnqueue(port, queueId);
diff --git a/src/main/java/net/onrc/onos/ofcontroller/util/FlowEntryActions.java b/src/main/java/net/onrc/onos/ofcontroller/util/FlowEntryActions.java
index 46f638d..53aab66 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/util/FlowEntryActions.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/util/FlowEntryActions.java
@@ -68,7 +68,7 @@
     /**
      * Add a Flow Entry Action.
      *
-     * @param FlowEntryAction the Flow Entry Action to add.
+     * @param flowEntryAction the Flow Entry Action to add.
      */
     public void addAction(FlowEntryAction flowEntryAction) {
 	actions.add(flowEntryAction);
diff --git a/src/main/java/net/onrc/onos/ofcontroller/util/FlowPath.java b/src/main/java/net/onrc/onos/ofcontroller/util/FlowPath.java
index c1b2f9f..a56dbff 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/util/FlowPath.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/util/FlowPath.java
@@ -1,7 +1,5 @@
 package net.onrc.onos.ofcontroller.util;
 
-import java.util.ArrayList;
-
 import net.floodlightcontroller.util.MACAddress;
 import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IFlowEntry;
 import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IFlowPath;
diff --git a/src/main/java/net/onrc/onos/registry/controller/IControllerRegistryService.java b/src/main/java/net/onrc/onos/registry/controller/IControllerRegistryService.java
index 21da47e..33ba272 100644
--- a/src/main/java/net/onrc/onos/registry/controller/IControllerRegistryService.java
+++ b/src/main/java/net/onrc/onos/registry/controller/IControllerRegistryService.java
@@ -80,7 +80,7 @@
 	/**
 	 * Register a controller to the ONOS cluster. Must be called before
 	 * the registry can be used to take control of any switches.
-	 * @param controller A unique string ID identifying this controller
+	 * @param controllerId A unique string ID identifying this controller
 	 * in the cluster
 	 * @throws errors connecting to registry service, 
 	 * controllerId already registered
diff --git a/src/test/java/net/onrc/onos/ofcontroller/core/INetMapTopologyObjectsIDeviceObjectTest.java b/src/test/java/net/onrc/onos/ofcontroller/core/INetMapTopologyObjectsIDeviceObjectTest.java
index 3ea90ba..323a0eb 100644
--- a/src/test/java/net/onrc/onos/ofcontroller/core/INetMapTopologyObjectsIDeviceObjectTest.java
+++ b/src/test/java/net/onrc/onos/ofcontroller/core/INetMapTopologyObjectsIDeviceObjectTest.java
@@ -7,8 +7,6 @@
 import net.onrc.onos.graph.GraphDBConnection;
 import net.onrc.onos.graph.GraphDBOperation;
 import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IDeviceObject;
-import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IFlowEntry;
-import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IFlowPath;
 import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IPortObject;
 import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.ISwitchObject;
 import net.onrc.onos.ofcontroller.core.internal.SwitchStorageImpl;
diff --git a/src/test/java/net/onrc/onos/ofcontroller/core/INetMapTopologyObjectsIPortObjectTest.java b/src/test/java/net/onrc/onos/ofcontroller/core/INetMapTopologyObjectsIPortObjectTest.java
index 2ddab3d..74f9758 100644
--- a/src/test/java/net/onrc/onos/ofcontroller/core/INetMapTopologyObjectsIPortObjectTest.java
+++ b/src/test/java/net/onrc/onos/ofcontroller/core/INetMapTopologyObjectsIPortObjectTest.java
@@ -11,10 +11,6 @@
 import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.ISwitchObject;
 import net.onrc.onos.ofcontroller.core.internal.SwitchStorageImpl;
 import net.onrc.onos.ofcontroller.core.internal.TestDatabaseManager;
-import net.onrc.onos.ofcontroller.flowmanager.FlowManager;
-import net.onrc.onos.ofcontroller.util.FlowId;
-import net.onrc.onos.ofcontroller.util.FlowPath;
-
 import org.easymock.EasyMock;
 import org.junit.After;
 import org.junit.Before;
diff --git a/src/test/java/net/onrc/onos/ofcontroller/core/internal/SwitchStorageImplTest.java b/src/test/java/net/onrc/onos/ofcontroller/core/internal/SwitchStorageImplTest.java
index 1922cfe..f276680 100644
--- a/src/test/java/net/onrc/onos/ofcontroller/core/internal/SwitchStorageImplTest.java
+++ b/src/test/java/net/onrc/onos/ofcontroller/core/internal/SwitchStorageImplTest.java
@@ -13,7 +13,6 @@
 import org.easymock.EasyMock;
 import org.junit.After;
 import org.junit.Before;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.openflow.protocol.OFPhysicalPort;
diff --git a/src/test/java/net/onrc/onos/ofcontroller/core/internal/SwitchStorageImplTestBB.java b/src/test/java/net/onrc/onos/ofcontroller/core/internal/SwitchStorageImplTestBB.java
index 57aefd3..19ac709 100644
--- a/src/test/java/net/onrc/onos/ofcontroller/core/internal/SwitchStorageImplTestBB.java
+++ b/src/test/java/net/onrc/onos/ofcontroller/core/internal/SwitchStorageImplTestBB.java
@@ -15,7 +15,6 @@
 import org.easymock.EasyMock;
 import org.junit.After;
 import org.junit.Before;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.openflow.protocol.OFPhysicalPort;
diff --git a/src/test/java/net/onrc/onos/ofcontroller/core/internal/TestableSwitchStorageImpl.java b/src/test/java/net/onrc/onos/ofcontroller/core/internal/TestableSwitchStorageImpl.java
index e78a1b6..e0b34e1 100644
--- a/src/test/java/net/onrc/onos/ofcontroller/core/internal/TestableSwitchStorageImpl.java
+++ b/src/test/java/net/onrc/onos/ofcontroller/core/internal/TestableSwitchStorageImpl.java
@@ -1,13 +1,7 @@
 package net.onrc.onos.ofcontroller.core.internal;
 
-import java.util.Set;
-
 import net.onrc.onos.ofcontroller.core.internal.SwitchStorageImpl;
 
-import com.thinkaurelius.titan.core.TitanGraph;
-import com.tinkerpop.blueprints.Vertex;
-import com.tinkerpop.blueprints.TransactionalGraph.Conclusion;
-
 /**
  * Seam that allows me to set up a testable instance of SwitchStorageImpl that 
  * writes to a file database rather than a Cassandra cluster. 
diff --git a/src/test/java/net/onrc/onos/ofcontroller/routing/TopoRouteServiceTest.java b/src/test/java/net/onrc/onos/ofcontroller/routing/TopoRouteServiceTest.java
index a33df98..7929eb1 100644
--- a/src/test/java/net/onrc/onos/ofcontroller/routing/TopoRouteServiceTest.java
+++ b/src/test/java/net/onrc/onos/ofcontroller/routing/TopoRouteServiceTest.java
@@ -1,21 +1,13 @@
 package net.onrc.onos.ofcontroller.routing;
 
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
 import java.util.Map;
 
 import org.easymock.EasyMock;
 
 import org.junit.After;
 import org.junit.Before;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
@@ -25,16 +17,6 @@
 
 import com.thinkaurelius.titan.core.TitanGraph;
 import com.thinkaurelius.titan.core.TitanFactory;
-import com.tinkerpop.blueprints.Vertex;
-import com.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine;
-import com.tinkerpop.gremlin.java.GremlinPipeline;
-import com.tinkerpop.pipes.PipeFunction;
-import com.tinkerpop.pipes.branch.LoopPipe.LoopBundle;
-
-import javax.script.ScriptContext;
-import javax.script.ScriptEngine;
-import javax.script.ScriptException;
-
 import net.onrc.onos.graph.GraphDBConnection;
 import net.onrc.onos.graph.GraphDBOperation;
 import net.onrc.onos.ofcontroller.core.internal.TestDatabaseManager;