Code Review
/
controller.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Merge "Bug #25: Installing/removing flows with ".""
[controller.git]
/
opendaylight
/
web
/
flows
/
src
/
main
/
java
/
org
/
opendaylight
/
controller
/
flows
/
web
/
Flows.java
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 f9e6a6aaae24aef573a32a7acda652a731b3d64a..be7560985a56fdeb3df3ae1d28020f8f87cd56a7 100644
(file)
--- 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
@RequestMapping(value = "/main")
@ResponseBody
- public
Set<Map<String, Object>
> getFlows(HttpServletRequest request, @RequestParam(required = false) String container) {
+ public
Map<String, Object
> 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();
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;
}
return null;
}
@@
-100,7
+101,7
@@
public class Flows implements IDaylightWeb {
// get static flow list
List<FlowConfig> staticFlowList = frm.getStaticFlows();
// get static flow list
List<FlowConfig> staticFlowList = frm.getStaticFlows();
- Set<Map<String, Object>>
outpu
t = new HashSet<Map<String, Object>>();
+ Set<Map<String, Object>>
flowSe
t = new HashSet<Map<String, Object>>();
for (FlowConfig flowConfig : staticFlowList) {
Map<String, Object> entry = new HashMap<String, Object>();
entry.put("flow", flowConfig);
for (FlowConfig flowConfig : staticFlowList) {
Map<String, Object> entry = new HashMap<String, Object>();
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());
entry.put("node", (description.isEmpty() || description
.equalsIgnoreCase("none")) ? node.toString() : description);
entry.put("nodeId", node.toString());
-
outpu
t.add(entry);
+
flowSe
t.add(entry);
}
}
+ Map <String, Object> output = new HashMap<String, Object>(2);
+ output.put("flows", flowSet);
+ output.put("privilege", privilege);
return output;
}
return output;
}
@@
-244,7
+248,7
@@
public class Flows implements IDaylightWeb {
.getDescription();
}
.getDescription();
}
- @RequestMapping(value = "/flow/{nodeId}/{name}", method = RequestMethod.POST)
+ @RequestMapping(value = "/flow/{nodeId}/{name
:.*
}", method = RequestMethod.POST)
@ResponseBody
public String removeFlow(@PathVariable("nodeId") String nodeId,
@PathVariable("name") String name,
@ResponseBody
public String removeFlow(@PathVariable("nodeId") String nodeId,
@PathVariable("name") String name,