Implemented the API method to get all switch-controller information from Zookeeper. Also implemented the informational REST APIs for the Registry service
diff --git a/src/main/java/net/onrc/onos/registry/controller/ControllerRegistryResource.java b/src/main/java/net/onrc/onos/registry/controller/ControllerRegistryResource.java
new file mode 100644
index 0000000..51f1d32
--- /dev/null
+++ b/src/main/java/net/onrc/onos/registry/controller/ControllerRegistryResource.java
@@ -0,0 +1,35 @@
+package net.onrc.onos.registry.controller;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.restlet.resource.Get;
+import org.restlet.resource.ServerResource;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class ControllerRegistryResource extends ServerResource {
+
+ protected static Logger log = LoggerFactory.getLogger(ControllerRegistryResource.class);
+
+ @Get("json")
+ public Collection<String> getControllers() {
+ IControllerRegistryService registry =
+ (IControllerRegistryService) getContext().getAttributes().
+ get(IControllerRegistryService.class.getCanonicalName());
+
+ Collection<String> controllers = null;
+ try {
+ controllers = registry.getAllControllers();
+ } catch (RegistryException e) {
+ log.warn("Error retrieving controller list: {}", e.getMessage());
+ }
+
+ if (controllers == null){
+ controllers = new ArrayList<String>();
+ }
+
+ return controllers;
+ }
+
+}