Add test for generated code checking list of dependencies.
[controller.git] / opendaylight / containermanager / api / src / main / java / org / opendaylight / controller / containermanager / ContainerFlowConfig.java
index c9b5dab8080f36d96a301db894845abafa1ca028..9740a9259833c0ef9d60ad821eaea1e0ee723aef 100644 (file)
@@ -114,6 +114,17 @@ public class ContainerFlowConfig implements Serializable {
         //this.unidirectional = false;
     }
 
+    public ContainerFlowConfig(String name, String dlVlan, String srcIP, String dstIP, String proto, String srcPort,
+            String dstPort) {
+        this.name = name;
+        this.dlVlan = dlVlan;
+        this.nwSrc = srcIP;
+        this.nwDst = dstIP;
+        this.protocol = proto;
+        this.tpSrc = srcPort;
+        this.tpDst = dstPort;
+    }
+
 
     public ContainerFlowConfig(ContainerFlowConfig containerFlowConfig) {
         this.name = containerFlowConfig.name;
@@ -707,6 +718,9 @@ public class ContainerFlowConfig implements Serializable {
         List<Match> matches = new ArrayList<Match>();
         Match match = new Match();
 
+        if (this.dlVlan != null && !this.dlVlan.isEmpty()) {
+            match.setField(MatchType.DL_VLAN, this.getVlanId());
+        }
         if (this.nwSrc != null && !this.nwSrc.trim().isEmpty()) {
             String parts[] = this.nwSrc.split("/");
             InetAddress ip = NetUtils.parseInetAddress(parts[0]);
@@ -760,7 +774,7 @@ public class ContainerFlowConfig implements Serializable {
      */
     @Override
     public String toString() {
-        return "Container Flow={name:" + name + " nwSrc:" + nwSrc + " nwDst:" + nwDst + " " + "protocol:" + protocol
+        return "Container Flow={name:" + name + " dlVlan:" + dlVlan + " nwSrc:" + nwSrc + " nwDst:" + nwDst + " " + "protocol:" + protocol
                 + " tpSrc:" + tpSrc + " tpDst:" + tpDst + "}";
     }
 }