X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fweb%2Fflows%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fflows%2Fweb%2FFlows.java;h=c4341347d088c95944987f1470da8633adece44a;hp=f9e6a6aaae24aef573a32a7acda652a731b3d64a;hb=refs%2Fchanges%2F04%2F504%2F1;hpb=c7580b185ce5ac0efd9d2184cb68efb7ab2a33d3 diff --git a/opendaylight/web/flows/src/main/java/org/opendaylight/controller/flows/web/Flows.java b/opendaylight/web/flows/src/main/java/org/opendaylight/controller/flows/web/Flows.java index f9e6a6aaae..c4341347d0 100644 --- a/opendaylight/web/flows/src/main/java/org/opendaylight/controller/flows/web/Flows.java +++ b/opendaylight/web/flows/src/main/java/org/opendaylight/controller/flows/web/Flows.java @@ -75,12 +75,13 @@ public class Flows implements IDaylightWeb { @RequestMapping(value = "/main") @ResponseBody - public Set> getFlows(HttpServletRequest request, @RequestParam(required = false) String container) { + public Map getFlows(HttpServletRequest request, @RequestParam(required = false) String container) { String containerName = (container == null) ? GlobalConstants.DEFAULT.toString() : container; // Derive the privilege this user has on the current container String userName = request.getUserPrincipal().getName(); - if (DaylightWebUtil.getContainerPrivilege(userName, containerName, this) == Privilege.NONE) { + Privilege privilege = DaylightWebUtil.getContainerPrivilege(userName, containerName, this); + if (privilege == Privilege.NONE) { return null; } @@ -100,7 +101,7 @@ public class Flows implements IDaylightWeb { // get static flow list List staticFlowList = frm.getStaticFlows(); - Set> output = new HashSet>(); + Set> flowSet = new HashSet>(); for (FlowConfig flowConfig : staticFlowList) { Map entry = new HashMap(); entry.put("flow", flowConfig); @@ -110,9 +111,12 @@ public class Flows implements IDaylightWeb { entry.put("node", (description.isEmpty() || description .equalsIgnoreCase("none")) ? node.toString() : description); entry.put("nodeId", node.toString()); - output.add(entry); + flowSet.add(entry); } + Map output = new HashMap(2); + output.put("flows", flowSet); + output.put("privilege", privilege); return output; }