Clean up source code of REST API
- Add missing @Produces annotation
- Correct comments
- Restrict variable access level
Change-Id: I7f75650b83651248370e7781b1e8aec7eac2314c
diff --git a/web/api/src/main/java/org/onosproject/rest/resources/TopologyWebResource.java b/web/api/src/main/java/org/onosproject/rest/resources/TopologyWebResource.java
index 2675fbe..c01d94f 100644
--- a/web/api/src/main/java/org/onosproject/rest/resources/TopologyWebResource.java
+++ b/web/api/src/main/java/org/onosproject/rest/resources/TopologyWebResource.java
@@ -44,12 +44,12 @@
@Path("topology")
public class TopologyWebResource extends AbstractWebResource {
- public static final String CLUSTER_NOT_FOUND = "Cluster is not found";
+ private static final String CLUSTER_NOT_FOUND = "Cluster is not found";
/**
- * Get overview of current topology.
+ * Gets overview of current topology.
*
- * @return topology overview
+ * @return 200 OK with topology overview
* @onos.rsModel Topology
*/
@GET
@@ -61,9 +61,9 @@
}
/**
- * Get overview of topology SCCs.
+ * Gets overview of topology SCCs.
*
- * @return topology clusters overview
+ * @return 200 OK with topology clusters overview
* @onos.rsModel TopologyClusters
*/
@GET
@@ -78,10 +78,10 @@
}
/**
- * Get details of a specific SCC.
+ * Gets details of a specific SCC.
*
* @param clusterId id of the cluster to query
- * @return topology cluster details
+ * @return 200 OK with topology cluster details
* @onos.rsModel TopologyCluster
*/
@GET
@@ -102,10 +102,10 @@
}
/**
- * Get devices in a specific SCC.
+ * Gets devices in a specific SCC.
*
* @param clusterId id of the cluster to query
- * @return topology cluster devices
+ * @return 200 OK with topology cluster devices
* @onos.rsModel TopologyClustersDevices
*/
@GET
@@ -126,10 +126,10 @@
}
/**
- * Get links in specific SCC.
+ * Gets links in specific SCC.
*
* @param clusterId id of the cluster to query
- * @return topology cluster links
+ * @return 200 OK with topology cluster links
* @onos.rsModel LinksGet
*/
@GET
@@ -175,11 +175,11 @@
}
/**
- * Test if a connect point is in broadcast set.
+ * Tests if a connect point is in broadcast set.
*
* @param connectPointString deviceid:portnumber
- * @return JSON representation of true if the connect point is broadcast,
- * false otherwise
+ * @return 200 OK with JSON representation of true if the connect point is
+ * broadcast, false otherwise
* @onos.rsModel TopologyBroadcast
*/
@GET
@@ -193,17 +193,16 @@
ConnectPoint connectPoint = new ConnectPoint(deviceId, portNumber);
boolean isBroadcast = get(TopologyService.class).isBroadcastPoint(topology, connectPoint);
- return ok(mapper()
- .createObjectNode()
+ return ok(mapper().createObjectNode()
.put("broadcast", isBroadcast))
.build();
}
/**
- * Test if a connect point is infrastructure or edge.
+ * Tests if a connect point is infrastructure or edge.
*
* @param connectPointString deviceid:portnumber
- * @return JSON representation of true if the connect point is broadcast,
+ * @return 200 OK with JSON representation of true if the connect point is broadcast,
* false otherwise
* @onos.rsModel TopologyInfrastructure
*/
@@ -218,10 +217,8 @@
ConnectPoint connectPoint = new ConnectPoint(deviceId, portNumber);
boolean isInfrastructure = get(TopologyService.class).isInfrastructure(topology, connectPoint);
- return ok(mapper()
- .createObjectNode()
+ return ok(mapper().createObjectNode()
.put("infrastructure", isInfrastructure))
.build();
}
-
}