Merge "Table features : modified yang model. Patch set 2: Modified match types as...
[controller.git] / opendaylight / northbound / containermanager / src / main / java / org / opendaylight / controller / containermanager / northbound / ContainerManagerNorthbound.java
index e2e1a62325e8198a0367da866d6298e75cd6a81f..fe38361cca246465bf514686b0beb872e72dd9f5 100644 (file)
@@ -9,7 +9,6 @@
 
 package org.opendaylight.controller.containermanager.northbound;
 
-import java.security.Principal;
 import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.List;
@@ -72,9 +71,9 @@ public class ContainerManagerNorthbound {
 
     @Context
     public void setSecurityContext(SecurityContext context) {
-        Principal principal;
-        principal = context.getUserPrincipal();
-        username = principal.getName();
+        if (context != null && context.getUserPrincipal() != null) {
+            username = context.getUserPrincipal().getName();
+        }
     }
 
     protected String getUserName() {
@@ -115,8 +114,8 @@ public class ContainerManagerNorthbound {
      * http://localhost:8080/controller/nb/v2/containermanager/containers
      *
      * Response body in XML:
-     * <container-config-list>
-     *       <container-config>
+     * <containerConfig-list>
+     *       <containerConfig>
      *          <container>black</container>
      *          <staticVlan>10</staticVlan>
      *          <nodeConnectors>OF|1@OF|00:00:00:00:00:00:00:01</nodeConnectors>
@@ -125,8 +124,8 @@ public class ContainerManagerNorthbound {
      *           <name>tcp</name>
      *           <protocol>TCP</protocol>
      *          </flowSpecs>
-     *        </container-config>
-     *        <container-config>
+     *        </containerConfig>
+     *        <containerConfig>
      *          <container>red</container>
      *          <staticVlan>20</staticVlan>
      *          <nodeConnectors>OF|1@OF|00:00:00:00:00:00:00:01</nodeConnectors>
@@ -135,11 +134,11 @@ public class ContainerManagerNorthbound {
      *           <name>udp</name>
      *           <protocol>UDP</protocol>
      *          </flowSpecs>
-     *      </container-config>
-     * </container-config-list>
+     *      </containerConfig>
+     * </containerConfig-list>
      *
      * Response body in JSON:
-     * { "container-config" : [
+     * { "containerConfig" : [
      *     { "container" : "black",
      *       "nodeConnectors" : [
      *          "OF|1@OF|00:00:00:00:00:00:00:01", "OF|23@OF|00:00:00:00:00:00:20:21"
@@ -197,16 +196,16 @@ public class ContainerManagerNorthbound {
      * http://localhost:8080/controller/nb/v2/containermanager/container/blue
      *
      * Response body in XML:
-     * <container-config>
+     * <containerConfig>
      *      <container>blue</container>
      *      <staticVlan>10</staticVlan>
      *      <nodeConnectors>OF|1@OF|00:00:00:00:00:00:00:01</nodeConnectors>
      *      <nodeConnectors>OF|23@OF|00:00:00:00:00:00:20:21</nodeConnectors>
-     * </container-config>
+     * </containerConfig>
      *
      * Response body in JSON:
      * {
-     *    "container-config": [
+     *    "containerConfig": [
      *       {
      *        "container": "yellow",
      *        "staticVlan": "10",
@@ -260,11 +259,11 @@ public class ContainerManagerNorthbound {
      * http://localhost:8080/controller/nb/v2/containermanager/container/yellow
      *
      * Request body in XML:
-     * <container-config>
+     * <containerConfig>
      *       <container>yellow</container>
      *       <staticVlan>10</staticVlan>
      *       <nodeConnectors></nodeConnectors>
-     * </container-config>
+     * </containerConfig>
      *
      * Request body in JSON:
      * {
@@ -364,6 +363,7 @@ public class ContainerManagerNorthbound {
      * Response body in XML:
      * <flow-spec-config>
      *      <name>ssh</name>
+     *      <dlVlan>52</dlVlan>
      *      <nwSrc>10.0.0.101</nwSrc>
      *      <nwDst>10.0.0.102</nwDst>
      *      <protocol>IPv4</protocol>
@@ -374,6 +374,7 @@ public class ContainerManagerNorthbound {
      * Response body in JSON:
      * {
      *    "protocol" : "IPv4",
+     *    "dlVlan" : "52",
      *    "nwDst" : "10.0.0.102",
      *    "name" : "ssh",
      *    "nwSrc" : "10.0.0.101",
@@ -429,6 +430,7 @@ public class ContainerManagerNorthbound {
      * <flow-spec-configs>
      *       <flow-spec-config>
      *           <name>ssh</name>
+     *           <dlVlan>52</dlVlan>
      *           <nwSrc>10.0.0.101</nwSrc>
      *           <nwDst>10.0.0.102</nwDst>
      *           <protocol>IPv4</protocol>
@@ -437,6 +439,7 @@ public class ContainerManagerNorthbound {
      *       </flow-spec-config>
      *       <flow-spec-config>
      *           <name>http2</name>
+     *           <dlVlan>123</dlVlan>
      *           <nwSrc>10.0.0.201</nwSrc>
      *           <nwDst>10.0.0.202</nwDst>
      *           <protocol></protocol>
@@ -450,6 +453,7 @@ public class ContainerManagerNorthbound {
      *   "flow-spec-config": [
      *     {
      *       "name": "http",
+     *       "dlVlan" : "52",
      *       "nwSrc": "10.0.0.201",
      *       "nwDst": "10.0.0.202",
      *       "protocol": "",
@@ -458,6 +462,7 @@ public class ContainerManagerNorthbound {
      *     },
      *     {
      *       "name": "ssh",
+     *       "dlVlan" : "123",
      *       "nwSrc": "10.0.0.101",
      *       "nwDst": "10.0.0.102",
      *       "protocol": "IPv4",
@@ -511,6 +516,7 @@ public class ContainerManagerNorthbound {
      * Request body in XML:
      *   <flow-spec-config>
      *         <name>http</name>
+     *         <dlVlan>25</dlVlan>
      *         <nwSrc>10.0.0.101</nwSrc>
      *         <nwDst>10.0.0.102</nwDst>
      *         <protocol></protocol>
@@ -520,10 +526,11 @@ public class ContainerManagerNorthbound {
      *
      * Request body in JSON:
      * {
-     *    "protocol" : "",
-     *    "nwDst" : "10.0.0.102",
      *    "name" : "http",
+     *    "dlVlan" : "25",
      *    "nwSrc" : "10.0.0.101",
+     *    "nwDst" : "10.0.0.102",
+     *    "protocol" : "",
      *    "tpSrc" : "80",
      *    "tpDst" : "100"
      * }