Bug #60 : JSON list responses from the NB-APIs returns native object (instead of...
[controller.git] / opendaylight / northbound / topology / src / main / java / org / opendaylight / controller / topology / northbound / TopologyNorthboundJAXRS.java
index c20cb26885006f0f5a3234466bfb4445ed641033..508ffafe6fdf8f1a1a5fff4466ee54e0f0862da9 100644 (file)
@@ -200,8 +200,7 @@ public class TopologyNorthboundJAXRS {
         if (topo != null) {
             List<EdgeProperties> res = new ArrayList<EdgeProperties>();
             for (Map.Entry<Edge, Set<Property>> entry : topo.entrySet()) {
-                EdgeProperties el = new EdgeProperties(entry.getKey(),
-                        entry.getValue());
+                EdgeProperties el = new EdgeProperties(entry.getKey(), entry.getValue());
                 res.add(el);
             }
             return new Topology(res);
@@ -316,7 +315,7 @@ public class TopologyNorthboundJAXRS {
             @ResponseCode(code = 503, condition = "One or more of Controller services are unavailable") })
     public Response addUserLink(
             @PathParam(value = "containerName") String containerName,
-            @TypeHint(TopologyUserLinkConfig.class) JAXBElement<TopologyUserLinkConfig> userLinkConfig) {
+            @TypeHint(TopologyUserLinkConfig.class) TopologyUserLinkConfig userLinkConfig) {
 
         if (!NorthboundUtils.isAuthorized(
                 getUserName(), containerName, Privilege.WRITE, this)) {
@@ -331,9 +330,9 @@ public class TopologyNorthboundJAXRS {
                     RestMessages.NOCONTAINER.toString());
         }
 
-        Status status = topologyManager.addUserLink(userLinkConfig.getValue());
+        Status status = topologyManager.addUserLink(userLinkConfig);
         if (status.isSuccess()) {
-            NorthboundUtils.auditlog("User Link", username, "added", userLinkConfig.getValue().getName(), containerName);
+            NorthboundUtils.auditlog("User Link", username, "added", userLinkConfig.getName(), containerName);
             return Response.status(Response.Status.CREATED).build();
         }
         throw new InternalServerErrorException(status.getDescription());