Fix checkstyle whitespace issues - WHITESPACE ONLY
Change-Id: Ic205c1afd639c6008d61d9de95cb764eeb6238ca
diff --git a/src/main/java/net/onrc/onos/core/topology/web/DatastoreLinksResource.java b/src/main/java/net/onrc/onos/core/topology/web/DatastoreLinksResource.java
index 4837055..0f3b85c 100644
--- a/src/main/java/net/onrc/onos/core/topology/web/DatastoreLinksResource.java
+++ b/src/main/java/net/onrc/onos/core/topology/web/DatastoreLinksResource.java
@@ -7,8 +7,8 @@
public class DatastoreLinksResource extends ServerResource {
- @Get("json")
- public Iterable<KVLink> retrieve() {
- return KVLink.getAllLinks();
- }
+ @Get("json")
+ public Iterable<KVLink> retrieve() {
+ return KVLink.getAllLinks();
+ }
}
diff --git a/src/main/java/net/onrc/onos/core/topology/web/DatastorePortsResource.java b/src/main/java/net/onrc/onos/core/topology/web/DatastorePortsResource.java
index 46eaf1a..2ffb476 100644
--- a/src/main/java/net/onrc/onos/core/topology/web/DatastorePortsResource.java
+++ b/src/main/java/net/onrc/onos/core/topology/web/DatastorePortsResource.java
@@ -7,8 +7,8 @@
public class DatastorePortsResource extends ServerResource {
- @Get("json")
- public Iterable<KVPort> retrieve() {
- return KVPort.getAllPorts();
- }
+ @Get("json")
+ public Iterable<KVPort> retrieve() {
+ return KVPort.getAllPorts();
+ }
}
diff --git a/src/main/java/net/onrc/onos/core/topology/web/DatastoreSwitchesResource.java b/src/main/java/net/onrc/onos/core/topology/web/DatastoreSwitchesResource.java
index fe2cfcd..9459764 100644
--- a/src/main/java/net/onrc/onos/core/topology/web/DatastoreSwitchesResource.java
+++ b/src/main/java/net/onrc/onos/core/topology/web/DatastoreSwitchesResource.java
@@ -6,10 +6,10 @@
import org.restlet.resource.ServerResource;
public class DatastoreSwitchesResource extends ServerResource {
-
- @Get("json")
- public Iterable<KVSwitch> retrieve() {
- return KVSwitch.getAllSwitches();
- }
+
+ @Get("json")
+ public Iterable<KVSwitch> retrieve() {
+ return KVSwitch.getAllSwitches();
+ }
}
diff --git a/src/main/java/net/onrc/onos/core/topology/web/NetworkGraphLinksResource.java b/src/main/java/net/onrc/onos/core/topology/web/NetworkGraphLinksResource.java
index 5886aa5..8d4bc93 100644
--- a/src/main/java/net/onrc/onos/core/topology/web/NetworkGraphLinksResource.java
+++ b/src/main/java/net/onrc/onos/core/topology/web/NetworkGraphLinksResource.java
@@ -15,29 +15,29 @@
import org.slf4j.LoggerFactory;
public class NetworkGraphLinksResource extends ServerResource {
-
- private static final Logger log = LoggerFactory.getLogger(NetworkGraphLinksResource.class);
- @Get("json")
- public String retrieve() {
- INetworkGraphService networkGraphService = (INetworkGraphService) getContext().getAttributes().
- get(INetworkGraphService.class.getCanonicalName());
-
- NetworkGraph graph = networkGraphService.getNetworkGraph();
+ private static final Logger log = LoggerFactory.getLogger(NetworkGraphLinksResource.class);
- ObjectMapper mapper = new ObjectMapper();
- SimpleModule module = new SimpleModule("module", new Version(1, 0, 0, null));
- module.addSerializer(new LinkSerializer());
- mapper.registerModule(module);
-
- try {
- graph.acquireReadLock();
- return mapper.writeValueAsString(graph.getLinks());
- } catch (IOException e) {
- log.error("Error writing link list to JSON", e);
- return "";
- } finally {
- graph.releaseReadLock();
- }
- }
+ @Get("json")
+ public String retrieve() {
+ INetworkGraphService networkGraphService = (INetworkGraphService) getContext().getAttributes().
+ get(INetworkGraphService.class.getCanonicalName());
+
+ NetworkGraph graph = networkGraphService.getNetworkGraph();
+
+ ObjectMapper mapper = new ObjectMapper();
+ SimpleModule module = new SimpleModule("module", new Version(1, 0, 0, null));
+ module.addSerializer(new LinkSerializer());
+ mapper.registerModule(module);
+
+ try {
+ graph.acquireReadLock();
+ return mapper.writeValueAsString(graph.getLinks());
+ } catch (IOException e) {
+ log.error("Error writing link list to JSON", e);
+ return "";
+ } finally {
+ graph.releaseReadLock();
+ }
+ }
}
diff --git a/src/main/java/net/onrc/onos/core/topology/web/NetworkGraphShortestPathResource.java b/src/main/java/net/onrc/onos/core/topology/web/NetworkGraphShortestPathResource.java
index 1d4164b..6650efc 100644
--- a/src/main/java/net/onrc/onos/core/topology/web/NetworkGraphShortestPathResource.java
+++ b/src/main/java/net/onrc/onos/core/topology/web/NetworkGraphShortestPathResource.java
@@ -28,54 +28,54 @@
@Get("json")
public String retrieve() {
- INetworkGraphService networkGraphService =
- (INetworkGraphService)getContext().getAttributes().
- get(INetworkGraphService.class.getCanonicalName());
+ INetworkGraphService networkGraphService =
+ (INetworkGraphService) getContext().getAttributes().
+ get(INetworkGraphService.class.getCanonicalName());
- NetworkGraph graph = networkGraphService.getNetworkGraph();
+ NetworkGraph graph = networkGraphService.getNetworkGraph();
- ObjectMapper mapper = new ObjectMapper();
- SimpleModule module = new SimpleModule("module", new Version(1, 0, 0, null));
- module.addSerializer(new LinkSerializer());
- mapper.registerModule(module);
+ ObjectMapper mapper = new ObjectMapper();
+ SimpleModule module = new SimpleModule("module", new Version(1, 0, 0, null));
+ module.addSerializer(new LinkSerializer());
+ mapper.registerModule(module);
- //
- // Fetch the attributes
- //
- String srcDpidStr = (String)getRequestAttributes().get("src-dpid");
- String dstDpidStr = (String)getRequestAttributes().get("dst-dpid");
- Dpid srcDpid = new Dpid(srcDpidStr);
- Dpid dstDpid = new Dpid(dstDpidStr);
- log.debug("Getting Shortest Path {}--{}", srcDpidStr, dstDpidStr);
+ //
+ // Fetch the attributes
+ //
+ String srcDpidStr = (String) getRequestAttributes().get("src-dpid");
+ String dstDpidStr = (String) getRequestAttributes().get("dst-dpid");
+ Dpid srcDpid = new Dpid(srcDpidStr);
+ Dpid dstDpid = new Dpid(dstDpidStr);
+ log.debug("Getting Shortest Path {}--{}", srcDpidStr, dstDpidStr);
- //
- // Do the Shortest Path computation and return the result: list of
- // links.
- //
- try {
- graph.acquireReadLock();
- Switch srcSwitch = graph.getSwitch(srcDpid.value());
- Switch dstSwitch = graph.getSwitch(dstDpid.value());
- if ((srcSwitch == null) || (dstSwitch == null))
- return "";
- ConstrainedBFSTree bfsTree = new ConstrainedBFSTree(srcSwitch);
- Path path = bfsTree.getPath(dstSwitch);
- List<Link> links = new LinkedList<>();
- for (LinkEvent linkEvent : path) {
- Link link = graph.getLink(linkEvent.getSrc().getDpid(),
- linkEvent.getSrc().getNumber(),
- linkEvent.getDst().getDpid(),
- linkEvent.getDst().getNumber());
- if (link == null)
- return "";
- links.add(link);
- }
- return mapper.writeValueAsString(links);
- } catch (IOException e) {
- log.error("Error writing Shortest Path to JSON", e);
- return "";
- } finally {
- graph.releaseReadLock();
- }
+ //
+ // Do the Shortest Path computation and return the result: list of
+ // links.
+ //
+ try {
+ graph.acquireReadLock();
+ Switch srcSwitch = graph.getSwitch(srcDpid.value());
+ Switch dstSwitch = graph.getSwitch(dstDpid.value());
+ if ((srcSwitch == null) || (dstSwitch == null))
+ return "";
+ ConstrainedBFSTree bfsTree = new ConstrainedBFSTree(srcSwitch);
+ Path path = bfsTree.getPath(dstSwitch);
+ List<Link> links = new LinkedList<>();
+ for (LinkEvent linkEvent : path) {
+ Link link = graph.getLink(linkEvent.getSrc().getDpid(),
+ linkEvent.getSrc().getNumber(),
+ linkEvent.getDst().getDpid(),
+ linkEvent.getDst().getNumber());
+ if (link == null)
+ return "";
+ links.add(link);
+ }
+ return mapper.writeValueAsString(links);
+ } catch (IOException e) {
+ log.error("Error writing Shortest Path to JSON", e);
+ return "";
+ } finally {
+ graph.releaseReadLock();
+ }
}
}
diff --git a/src/main/java/net/onrc/onos/core/topology/web/NetworkGraphSwitchesResource.java b/src/main/java/net/onrc/onos/core/topology/web/NetworkGraphSwitchesResource.java
index 059771f..3a053e5 100644
--- a/src/main/java/net/onrc/onos/core/topology/web/NetworkGraphSwitchesResource.java
+++ b/src/main/java/net/onrc/onos/core/topology/web/NetworkGraphSwitchesResource.java
@@ -16,30 +16,30 @@
import org.slf4j.LoggerFactory;
public class NetworkGraphSwitchesResource extends ServerResource {
-
- private static final Logger log = LoggerFactory.getLogger(NetworkGraphSwitchesResource.class);
- @Get("json")
- public String retrieve() {
- INetworkGraphService networkGraphService = (INetworkGraphService) getContext().getAttributes().
- get(INetworkGraphService.class.getCanonicalName());
-
- NetworkGraph graph = networkGraphService.getNetworkGraph();
-
- ObjectMapper mapper = new ObjectMapper();
- SimpleModule module = new SimpleModule("module", new Version(1, 0, 0, null));
- module.addSerializer(new SwitchSerializer());
- module.addSerializer(new PortSerializer());
- mapper.registerModule(module);
-
- try {
- graph.acquireReadLock();
- return mapper.writeValueAsString(graph.getSwitches());
- } catch (IOException e) {
- log.error("Error writing switch list to JSON", e);
- return "";
- } finally {
- graph.releaseReadLock();
- }
- }
+ private static final Logger log = LoggerFactory.getLogger(NetworkGraphSwitchesResource.class);
+
+ @Get("json")
+ public String retrieve() {
+ INetworkGraphService networkGraphService = (INetworkGraphService) getContext().getAttributes().
+ get(INetworkGraphService.class.getCanonicalName());
+
+ NetworkGraph graph = networkGraphService.getNetworkGraph();
+
+ ObjectMapper mapper = new ObjectMapper();
+ SimpleModule module = new SimpleModule("module", new Version(1, 0, 0, null));
+ module.addSerializer(new SwitchSerializer());
+ module.addSerializer(new PortSerializer());
+ mapper.registerModule(module);
+
+ try {
+ graph.acquireReadLock();
+ return mapper.writeValueAsString(graph.getSwitches());
+ } catch (IOException e) {
+ log.error("Error writing switch list to JSON", e);
+ return "";
+ } finally {
+ graph.releaseReadLock();
+ }
+ }
}
diff --git a/src/main/java/net/onrc/onos/core/topology/web/NetworkGraphWebRoutable.java b/src/main/java/net/onrc/onos/core/topology/web/NetworkGraphWebRoutable.java
index c6791e5..8f32f8a 100644
--- a/src/main/java/net/onrc/onos/core/topology/web/NetworkGraphWebRoutable.java
+++ b/src/main/java/net/onrc/onos/core/topology/web/NetworkGraphWebRoutable.java
@@ -8,33 +8,33 @@
public class NetworkGraphWebRoutable implements RestletRoutable {
- @Override
- public Restlet getRestlet(Context context) {
- Router router = new Router(context);
- // leaving old path there for compatibility
- router.attach("/rc/switches/json", DatastoreSwitchesResource.class);
- router.attach("/rc/links/json", DatastoreLinksResource.class);
- router.attach("/rc/ports/json", DatastorePortsResource.class);
+ @Override
+ public Restlet getRestlet(Context context) {
+ Router router = new Router(context);
+ // leaving old path there for compatibility
+ router.attach("/rc/switches/json", DatastoreSwitchesResource.class);
+ router.attach("/rc/links/json", DatastoreLinksResource.class);
+ router.attach("/rc/ports/json", DatastorePortsResource.class);
- // debug API to dump datastore content
- router.attach("/ds/switches/json", DatastoreSwitchesResource.class);
- router.attach("/ds/links/json", DatastoreLinksResource.class);
- router.attach("/ds/ports/json", DatastorePortsResource.class);
+ // debug API to dump datastore content
+ router.attach("/ds/switches/json", DatastoreSwitchesResource.class);
+ router.attach("/ds/links/json", DatastoreLinksResource.class);
+ router.attach("/ds/ports/json", DatastorePortsResource.class);
- router.attach("/ng/switches/json", NetworkGraphSwitchesResource.class);
- router.attach("/ng/links/json", NetworkGraphLinksResource.class);
- router.attach("/ng/shortest-path/{src-dpid}/{dst-dpid}/json", NetworkGraphShortestPathResource.class);
-
- // Old URLs for compatibility
- router.attach("/topology/switches/json", NetworkGraphSwitchesResource.class);
- router.attach("/topology/links/json", NetworkGraphLinksResource.class);
-
- return router;
- }
+ router.attach("/ng/switches/json", NetworkGraphSwitchesResource.class);
+ router.attach("/ng/links/json", NetworkGraphLinksResource.class);
+ router.attach("/ng/shortest-path/{src-dpid}/{dst-dpid}/json", NetworkGraphShortestPathResource.class);
- @Override
- public String basePath() {
- return "/wm/onos";
- }
+ // Old URLs for compatibility
+ router.attach("/topology/switches/json", NetworkGraphSwitchesResource.class);
+ router.attach("/topology/links/json", NetworkGraphLinksResource.class);
+
+ return router;
+ }
+
+ @Override
+ public String basePath() {
+ return "/wm/onos";
+ }
}