@Immutable FlowEntity with FlowEntityBuilder 90/54390/8
authorMichael Vorburger <vorburger@redhat.com>
Wed, 5 Apr 2017 21:36:27 +0000 (23:36 +0200)
committerSam Hague <shague@redhat.com>
Thu, 27 Apr 2017 17:07:28 +0000 (17:07 +0000)
This is dependent on the genius change
https://git.opendaylight.org/gerrit/#/c/53763/, which must be merged
simultaneously.

The change in the Xtend re. flowId is because the FlowEntityBuilder does
not have a getFlowId() like FlowEntity, only a setter; see
https://github.com/immutables/immutables/issues/432

Change-Id: Iecbe1ccd2c1c6cb9c914b70c6e44590d748ad739
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Signed-off-by: Sam Hague <shague@redhat.com>
vpnservice/aclservice/impl/src/test/java/org/opendaylight/netvirt/aclservice/tests/FlowEntryObjectsBase.xtend
vpnservice/aclservice/impl/src/test/java/org/opendaylight/netvirt/aclservice/tests/FlowEntryObjectsStateful.xtend
vpnservice/aclservice/impl/src/test/java/org/opendaylight/netvirt/aclservice/tests/FlowEntryObjectsStatefulIPv6.xtend
vpnservice/aclservice/impl/src/test/java/org/opendaylight/netvirt/aclservice/tests/FlowEntryObjectsStateless.xtend
vpnservice/aclservice/impl/src/test/java/org/opendaylight/netvirt/aclservice/tests/IdHelper.java
vpnservice/elanmanager/elanmanager-impl/src/main/java/org/opendaylight/netvirt/elan/internal/ElanInterfaceManager.java
vpnservice/elanmanager/elanmanager-impl/src/main/java/org/opendaylight/netvirt/elan/utils/ElanUtils.java
vpnservice/natservice/natservice-impl/src/main/java/org/opendaylight/netvirt/natservice/internal/NaptEventHandler.java
vpnservice/natservice/natservice-impl/src/main/java/org/opendaylight/netvirt/natservice/internal/NatUtil.java
vpnservice/natservice/natservice-impl/src/test/java/org/opendaylight/netvirt/natservice/internal/test/NatUtilTest.java [new file with mode: 0644]
vpnservice/vpnmanager/vpnmanager-impl/src/main/java/org/opendaylight/netvirt/vpnmanager/VpnUtil.java

index 63ab3bcc9ac7f746b1d223bbf51d4deb83abb179..b6709c78b7e49248a76475eae769f48c64a92885 100644 (file)
@@ -7,24 +7,26 @@
  */
 package org.opendaylight.netvirt.aclservice.tests
 
+import org.opendaylight.genius.mdsalutil.FlowEntityBuilder
+import org.opendaylight.genius.mdsalutil.MetaDataUtil
 import org.opendaylight.genius.mdsalutil.actions.ActionNxResubmit
-import org.opendaylight.genius.mdsalutil.FlowEntity
 import org.opendaylight.genius.mdsalutil.instructions.InstructionApplyActions
-import org.opendaylight.genius.mdsalutil.instructions.InstructionWriteMetadata
 import org.opendaylight.genius.mdsalutil.instructions.InstructionGotoTable
+import org.opendaylight.genius.mdsalutil.instructions.InstructionWriteMetadata
 import org.opendaylight.genius.mdsalutil.matches.MatchArpSha
 import org.opendaylight.genius.mdsalutil.matches.MatchEthernetType
 import org.opendaylight.genius.mdsalutil.matches.MatchIcmpv6
 import org.opendaylight.genius.mdsalutil.matches.MatchIpProtocol
 import org.opendaylight.genius.mdsalutil.matches.MatchIpv4Destination
 import org.opendaylight.genius.mdsalutil.matches.MatchIpv4Source
+import org.opendaylight.genius.mdsalutil.matches.MatchMetadata
 import org.opendaylight.genius.mdsalutil.matches.MatchUdpDestinationPort
 import org.opendaylight.genius.mdsalutil.matches.MatchUdpSourcePort
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress
 import org.opendaylight.genius.mdsalutil.nxmatches.NxMatchRegister
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg6
-import org.opendaylight.genius.mdsalutil.MetaDataUtil
-import org.opendaylight.genius.mdsalutil.matches.MatchMetadata
+
+import static extension org.opendaylight.mdsal.binding.testutils.XtendBuilderExtensions.operator_doubleGreaterThan
 
 class FlowEntryObjectsBase {
 
@@ -34,15 +36,16 @@ class FlowEntryObjectsBase {
 
     protected def fixedIngressFlowsPort1() {
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Ingress_DHCP_Server_v4123_987__Permit_"
-            flowName = "ACL"
-            instructionInfoList = #[
-                new InstructionApplyActions(#[
-                    new ActionNxResubmit(220 as short)
-                    ])
-                ]
+                flowName = "ACL"
+                instructionInfoList = #[
+                    new InstructionApplyActions(#[
+                        new ActionNxResubmit(220 as short)
+                        ])
+                    ]
                 matchInfoList = #[
                     new MatchEthernetType(2048L),
                     new MatchIpProtocol(17 as short),
@@ -53,7 +56,8 @@ class FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 241 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Ingress_DHCP_Server_v6_123_987___Permit_"
             flowName = "ACL"
@@ -72,7 +76,8 @@ class FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 241 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Ingress_ICMPv6_123_987_130_Permit_"
             flowName = "ACL"
@@ -90,7 +95,8 @@ class FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 241 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Ingress_ICMPv6_123_987_135_Permit_"
             flowName = "ACL"
@@ -108,7 +114,8 @@ class FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 241 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Ingress_ICMPv6_123_987_136_Permit_"
             flowName = "ACL"
@@ -126,7 +133,8 @@ class FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 241 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Ingress_ARP_123_987"
             flowName = "ACL"
@@ -149,7 +157,8 @@ class FlowEntryObjectsBase {
      protected def fixedEgressFlowsPort1() {
         #[
 
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_DHCP_Client_v4123_987__Permit_"
                 flowName = "ACL"
@@ -168,7 +177,8 @@ class FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_DHCP_Client_v6_123_987__Permit_"
                 flowName = "ACL"
@@ -187,7 +197,8 @@ class FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_DHCP_Server_v4123_987__Drop_"
                 flowName = "ACL"
@@ -203,7 +214,8 @@ class FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_DHCP_Server_v6_123_987__Drop_"
                 flowName = "ACL"
@@ -219,7 +231,8 @@ class FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_ICMPv6_123_987_134_Drop_"
                 flowName = "ACL"
@@ -234,7 +247,8 @@ class FlowEntryObjectsBase {
                 priority = 63020
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_ICMPv6_123_987_133_Permit_"
                 flowName = "ACL"
@@ -252,7 +266,8 @@ class FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_ICMPv6_123_987_135_Permit_"
                 flowName = "ACL"
@@ -270,7 +285,8 @@ class FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_ICMPv6_123_987_136_Permit_"
                 flowName = "ACL"
@@ -288,7 +304,8 @@ class FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_ARP_123_987_0D:AA:D8:42:30:F3"
                 flowName = "ACL"
@@ -311,7 +328,8 @@ class FlowEntryObjectsBase {
 
      protected def fixedIngressFlowsPort2() {
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Ingress_DHCP_Server_v4123_987__Permit_"
                 flowName = "ACL"
@@ -330,7 +348,8 @@ class FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 241 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Ingress_DHCP_Server_v6_123_987___Permit_"
                 flowName = "ACL"
@@ -349,7 +368,8 @@ class FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 241 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Ingress_ICMPv6_123_987_130_Permit_"
                 flowName = "ACL"
@@ -367,7 +387,8 @@ class FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 241 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Ingress_ICMPv6_123_987_135_Permit_"
                 flowName = "ACL"
@@ -385,7 +406,8 @@ class FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 241 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Ingress_ICMPv6_123_987_136_Permit_"
                 flowName = "ACL"
@@ -403,7 +425,8 @@ class FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 241 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Ingress_ARP_123_987"
                 flowName = "ACL"
@@ -424,7 +447,8 @@ class FlowEntryObjectsBase {
 
      protected def fixedEgressFlowsPort2 () {
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_DHCP_Client_v4123_987__Permit_"
                 flowName = "ACL"
@@ -443,7 +467,8 @@ class FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_DHCP_Client_v6_123_987__Permit_"
                 flowName = "ACL"
@@ -462,7 +487,8 @@ class FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_DHCP_Server_v4123_987__Drop_"
                 flowName = "ACL"
@@ -478,7 +504,8 @@ class FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_DHCP_Server_v6_123_987__Drop_"
                 flowName = "ACL"
@@ -494,7 +521,8 @@ class FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_ICMPv6_123_987_134_Drop_"
                 flowName = "ACL"
@@ -509,7 +537,8 @@ class FlowEntryObjectsBase {
                 priority = 63020
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_ICMPv6_123_987_133_Permit_"
                 flowName = "ACL"
@@ -527,7 +556,8 @@ class FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_ICMPv6_123_987_135_Permit_"
                 flowName = "ACL"
@@ -545,7 +575,8 @@ class FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_ICMPv6_123_987_136_Permit_"
                 flowName = "ACL"
@@ -563,7 +594,8 @@ class FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_ARP_123_987_0D:AA:D8:42:30:F4"
                 flowName = "ACL"
@@ -586,7 +618,8 @@ class FlowEntryObjectsBase {
 
      protected def fixedIngressFlowsPort3() {
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Ingress_DHCP_Server_v4123_987__Permit_"
                 flowName = "ACL"
@@ -605,7 +638,8 @@ class FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 241 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Ingress_DHCP_Server_v6_123_987___Permit_"
                 flowName = "ACL"
@@ -624,7 +658,8 @@ class FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 241 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Ingress_ICMPv6_123_987_130_Permit_"
                 flowName = "ACL"
@@ -642,7 +677,8 @@ class FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 241 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Ingress_ICMPv6_123_987_135_Permit_"
                 flowName = "ACL"
@@ -660,7 +696,8 @@ class FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 241 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Ingress_ICMPv6_123_987_136_Permit_"
                 flowName = "ACL"
@@ -678,7 +715,8 @@ class FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 241 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Ingress_ARP_123_987"
                 flowName = "ACL"
@@ -699,7 +737,8 @@ class FlowEntryObjectsBase {
 
      protected def fixedEgressFlowsPort3 () {
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_DHCP_Client_v4123_987__Permit_"
                 flowName = "ACL"
@@ -718,7 +757,8 @@ class FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_DHCP_Client_v6_123_987__Permit_"
                 flowName = "ACL"
@@ -737,7 +777,8 @@ class FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_DHCP_Server_v4123_987__Drop_"
                 flowName = "ACL"
@@ -753,7 +794,8 @@ class FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_DHCP_Server_v6_123_987__Drop_"
                 flowName = "ACL"
@@ -769,7 +811,8 @@ class FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_ICMPv6_123_987_134_Drop_"
                 flowName = "ACL"
@@ -784,7 +827,8 @@ class FlowEntryObjectsBase {
                 priority = 63020
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_ICMPv6_123_987_133_Permit_"
                 flowName = "ACL"
@@ -802,7 +846,8 @@ class FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_ICMPv6_123_987_135_Permit_"
                 flowName = "ACL"
@@ -820,7 +865,8 @@ class FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_ICMPv6_123_987_136_Permit_"
                 flowName = "ACL"
@@ -838,7 +884,8 @@ class FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_ARP_123_987_0D:AA:D8:42:30:F5"
                 flowName = "ACL"
@@ -860,7 +907,8 @@ class FlowEntryObjectsBase {
 
     static def fixedIngressFlowsPort4() {
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Ingress_DHCP_Server_v4123_987__Permit_"
                 flowName = "ACL"
@@ -879,7 +927,8 @@ class FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 241 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Ingress_DHCP_Server_v6_123_987___Permit_"
                 flowName = "ACL"
@@ -898,7 +947,8 @@ class FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 241 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Ingress_ICMPv6_123_987_130_Permit_"
                 flowName = "ACL"
@@ -916,7 +966,8 @@ class FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 241 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Ingress_ICMPv6_123_987_135_Permit_"
                 flowName = "ACL"
@@ -934,7 +985,8 @@ class FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 241 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Ingress_ICMPv6_123_987_136_Permit_"
                 flowName = "ACL"
@@ -952,7 +1004,8 @@ class FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 241 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Ingress_ARP_123_987"
                 flowName = "ACL"
@@ -973,7 +1026,8 @@ class FlowEntryObjectsBase {
 
     static def fixedEgressFlowsPort4 () {
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_DHCP_Client_v4123_987__Permit_"
                 flowName = "ACL"
@@ -992,7 +1046,8 @@ class FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_DHCP_Client_v6_123_987__Permit_"
                 flowName = "ACL"
@@ -1011,7 +1066,8 @@ class FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_DHCP_Server_v4123_987__Drop_"
                 flowName = "ACL"
@@ -1027,7 +1083,8 @@ class FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_DHCP_Server_v6_123_987__Drop_"
                 flowName = "ACL"
@@ -1043,7 +1100,8 @@ class FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_ICMPv6_123_987_134_Drop_"
                 flowName = "ACL"
@@ -1058,7 +1116,8 @@ class FlowEntryObjectsBase {
                 priority = 63020
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_ICMPv6_123_987_133_Permit_"
                 flowName = "ACL"
@@ -1076,7 +1135,8 @@ class FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_ICMPv6_123_987_135_Permit_"
                 flowName = "ACL"
@@ -1094,7 +1154,8 @@ class FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_ICMPv6_123_987_136_Permit_"
                 flowName = "ACL"
@@ -1112,7 +1173,8 @@ class FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_ARP_123_987_0D:AA:D8:42:30:F6"
                 flowName = "ACL"
@@ -1129,7 +1191,8 @@ class FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_ARP_123_987_0D:AA:D8:42:30:F6"
                 flowName = "ACL"
@@ -1187,7 +1250,8 @@ class FlowEntryObjectsBase {
     }
 
     protected def remoteIngressFlowsPort(String ip) {
-        new FlowEntity(123bi) => [
+        new FlowEntityBuilder >> [
+                dpnId = 123bi
             cookie = 110100480bi
             flowId = "Acl_Filter_Ingress_" + ip + "/32_5000"
             flowName = "ACL"
@@ -1206,7 +1270,8 @@ class FlowEntryObjectsBase {
     }
 
     protected def remoteEgressFlowsPort(String ip) {
-        new FlowEntity(123bi) => [
+        new FlowEntityBuilder >> [
+                dpnId = 123bi
             cookie = 110100480bi
             flowId = "Acl_Filter_Egress_" + ip + "/32_5000"
             flowName = "ACL"
@@ -1227,7 +1292,8 @@ class FlowEntryObjectsBase {
     protected def expectedFlows(String mac) {
         // Code auto. generated by https://github.com/vorburger/xtendbeans
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Ingress_DHCP_Server_v4123_987__Permit_"
                 flowName = "ACL"
@@ -1246,7 +1312,8 @@ class FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 241 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Ingress_DHCP_Server_v6_123_987___Permit_"
                 flowName = "ACL"
@@ -1265,7 +1332,8 @@ class FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 241 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Ingress_ICMPv6_123_987_130_Permit_"
                 flowName = "ACL"
@@ -1283,7 +1351,8 @@ class FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 241 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Ingress_ICMPv6_123_987_135_Permit_"
                 flowName = "ACL"
@@ -1301,7 +1370,8 @@ class FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 241 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Ingress_ICMPv6_123_987_136_Permit_"
                 flowName = "ACL"
@@ -1319,7 +1389,8 @@ class FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 241 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Ingress_ARP_123_987"
                 flowName = "ACL"
@@ -1335,7 +1406,8 @@ class FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 241 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_DHCP_Client_v4123_987__Permit_"
                 flowName = "ACL"
@@ -1354,7 +1426,8 @@ class FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_DHCP_Client_v6_123_987__Permit_"
                 flowName = "ACL"
@@ -1373,7 +1446,8 @@ class FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_DHCP_Server_v4123_987__Drop_"
                 flowName = "ACL"
@@ -1389,7 +1463,8 @@ class FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_DHCP_Server_v6_123_987__Drop_"
                 flowName = "ACL"
@@ -1405,7 +1480,8 @@ class FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_ICMPv6_123_987_134_Drop_"
                 flowName = "ACL"
@@ -1420,7 +1496,8 @@ class FlowEntryObjectsBase {
                 priority = 63020
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_ICMPv6_123_987_133_Permit_"
                 flowName = "ACL"
@@ -1438,7 +1515,8 @@ class FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_ICMPv6_123_987_135_Permit_"
                 flowName = "ACL"
@@ -1456,7 +1534,8 @@ class FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_ICMPv6_123_987_136_Permit_"
                 flowName = "ACL"
@@ -1474,7 +1553,8 @@ class FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_ARP_123_987_" + mac
                 flowName = "ACL"
index 268ac6c1543845bb1d423ba35a0f497a62e558c4..90becf3d0b3fc15f82d00ab4beeca0675b975ec5 100644 (file)
@@ -7,12 +7,12 @@
  */
 package org.opendaylight.netvirt.aclservice.tests
 
-import org.opendaylight.genius.mdsalutil.FlowEntity
 import org.opendaylight.genius.mdsalutil.MetaDataUtil
 import org.opendaylight.genius.mdsalutil.NwConstants
 import org.opendaylight.genius.mdsalutil.actions.ActionDrop
 import org.opendaylight.genius.mdsalutil.actions.ActionNxConntrack
 import org.opendaylight.genius.mdsalutil.actions.ActionNxResubmit
+import org.opendaylight.genius.mdsalutil.actions.ActionDrop
 import org.opendaylight.genius.mdsalutil.instructions.InstructionApplyActions
 import org.opendaylight.genius.mdsalutil.matches.MatchArpSha
 import org.opendaylight.genius.mdsalutil.matches.MatchEthernetDestination
@@ -30,8 +30,15 @@ import org.opendaylight.genius.mdsalutil.nxmatches.NxMatchCtState
 import org.opendaylight.genius.mdsalutil.nxmatches.NxMatchRegister
 import org.opendaylight.genius.mdsalutil.nxmatches.NxMatchTcpDestinationPort
 import org.opendaylight.genius.mdsalutil.nxmatches.NxMatchUdpDestinationPort
+import org.opendaylight.genius.mdsalutil.FlowEntityBuilder
+import org.opendaylight.genius.mdsalutil.MetaDataUtil
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress
+import org.opendaylight.genius.mdsalutil.NwConstants
+import org.opendaylight.genius.mdsalutil.nxmatches.NxMatchRegister
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg6
+import org.opendaylight.genius.mdsalutil.matches.MatchMetadata
+
+import static extension org.opendaylight.mdsal.binding.testutils.XtendBuilderExtensions.operator_doubleGreaterThan
 
 class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
 
@@ -145,7 +152,8 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
 
     protected def aapIpv4AllFlowsPort2() {
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_Fixed_Conntrk_123_0D:AA:D8:42:30:F4_0.0.0.0/0_Recirc"
                 flowName = "ACL"
@@ -161,7 +169,8 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                 priority = 61010
                 tableId = NwConstants.INGRESS_ACL_TABLE
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Ingress_Fixed_Conntrk_123_0D:AA:D8:42:30:F4_0.0.0.0/0_Recirc"
                 flowName = "ACL"
@@ -178,7 +187,8 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                 priority = 61010
                 tableId = NwConstants.EGRESS_ACL_TABLE
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_ARP_123_987_0D:AA:D8:42:30:F4"
                 flowName = "ACL"
@@ -210,7 +220,8 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
 
     protected def aapFlowsPort2() {
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_Fixed_Conntrk_123_0D:AA:D8:42:30:F4_10.0.0.100/32_Recirc"
                 flowName = "ACL"
@@ -227,7 +238,8 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                 priority = 61010
                 tableId = NwConstants.INGRESS_ACL_TABLE
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Ingress_Fixed_Conntrk_123_0D:AA:D8:42:30:F4_10.0.0.100/32_Recirc"
                 flowName = "ACL"
@@ -245,7 +257,8 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                 priority = 61010
                 tableId = NwConstants.EGRESS_ACL_TABLE
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_Fixed_Conntrk_123_0D:AA:D8:42:30:A4_10.0.0.101/32_Recirc"
                 flowName = "ACL"
@@ -262,7 +275,8 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                 priority = 61010
                 tableId = NwConstants.INGRESS_ACL_TABLE
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Ingress_Fixed_Conntrk_123_0D:AA:D8:42:30:A4_10.0.0.101/32_Recirc"
                 flowName = "ACL"
@@ -280,7 +294,8 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                 priority = 61010
                 tableId = NwConstants.EGRESS_ACL_TABLE
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_ARP_123_987_0D:AA:D8:42:30:A4"
                 flowName = "ACL"
@@ -302,7 +317,8 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
 
     protected def fixedConntrackIngressFlowsPort1() {
         #[
-           new FlowEntity(123bi) => [
+           new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Ingress_Fixed_Conntrk_123_0D:AA:D8:42:30:F3_10.0.0.1/32_Recirc"
             flowName = "ACL"
@@ -320,7 +336,8 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                 priority = 61010
                 tableId = 241 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100481bi
                 flowId = "Ingress_Fixed_Conntrk_Drop123_987_Tracked_New"
                 flowName = "ACL"
@@ -336,7 +353,8 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                 priority = 50
                 tableId = 213 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100481bi
                 flowId = "Ingress_Fixed_Conntrk_Drop123_987_Tracked_Invalid"
                 flowName = "ACL"
@@ -356,11 +374,12 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
     }
 
     protected def etherIngressFlowsPort2() {
+        val theFlowId = "ETHERnull_remoteACL_id_85cc3048-abc3-43cc-89b3-377341426ac5Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "ETHERnull_remoteACL_id_85cc3048-abc3-43cc-89b3-377341426ac5"
-                        +"Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
+                flowId = theFlowId
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -375,7 +394,7 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L),
                     new NxMatchCtState(33L, 33L)
                 ]
-                priority = IdHelper.getId(flowId)
+                priority = IdHelper.getId(theFlowId)
                 tableId = 243 as short
             ]
         ]
@@ -383,7 +402,8 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
 
     protected def fixedConntrackEgressFlowsPort1() {
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_Fixed_Conntrk_123_0D:AA:D8:42:30:F3_10.0.0.1/32_Recirc"
                 flowName = "ACL"
@@ -400,7 +420,8 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                 priority = 61010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100481bi
                 flowId = "Egress_Fixed_Conntrk_Drop123_987_Tracked_New"
                 flowName = "ACL"
@@ -416,7 +437,8 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                 priority = 50
                 tableId = 243 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100481bi
                 flowId = "Egress_Fixed_Conntrk_Drop123_987_Tracked_Invalid"
                 flowName = "ACL"
@@ -437,7 +459,8 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
 
     protected def fixedConntrackIngressFlowsPort2() {
         #[
-             new FlowEntity(123bi) => [
+             new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Ingress_Fixed_Conntrk_123_0D:AA:D8:42:30:F4_10.0.0.2/32_Recirc"
                 flowName = "ACL"
@@ -455,7 +478,8 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                 priority = 61010
                 tableId = 241 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100481bi
                 flowId = "Ingress_Fixed_Conntrk_Drop123_987_Tracked_New"
                 flowName = "ACL"
@@ -471,7 +495,8 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                 priority = 50
                 tableId = 213 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100481bi
                 flowId = "Ingress_Fixed_Conntrk_Drop123_987_Tracked_Invalid"
                 flowName = "ACL"
@@ -492,7 +517,8 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
 
     protected def fixedConntrackEgressFlowsPort2() {
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_Fixed_Conntrk_123_0D:AA:D8:42:30:F4_10.0.0.2/32_Recirc"
                 flowName = "ACL"
@@ -509,7 +535,8 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                 priority = 61010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100481bi
                 flowId = "Egress_Fixed_Conntrk_Drop123_987_Tracked_New"
                 flowName = "ACL"
@@ -525,7 +552,8 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                 priority = 50
                 tableId = 243 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100481bi
                 flowId = "Egress_Fixed_Conntrk_Drop123_987_Tracked_Invalid"
                 flowName = "ACL"
@@ -546,7 +574,8 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
 
     protected def fixedConntrackIngressFlowsPort3() {
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Ingress_Fixed_Conntrk_123_0D:AA:D8:42:30:F5_10.0.0.3/32_Recirc"
                 flowName = "ACL"
@@ -564,7 +593,8 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                 priority = 61010
                 tableId = 241 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100481bi
                 flowId = "Ingress_Fixed_Conntrk_Drop123_987_Tracked_New"
                 flowName = "ACL"
@@ -580,7 +610,8 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                 priority = 50
                 tableId = 213 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100481bi
                 flowId = "Ingress_Fixed_Conntrk_Drop123_987_Tracked_Invalid"
                 flowName = "ACL"
@@ -601,7 +632,8 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
 
     protected def fixedConntrackEgressFlowsPort3() {
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_Fixed_Conntrk_123_0D:AA:D8:42:30:F5_10.0.0.3/32_Recirc"
                 flowName = "ACL"
@@ -618,7 +650,8 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                 priority = 61010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100481bi
                 flowId = "Egress_Fixed_Conntrk_Drop123_987_Tracked_New"
                 flowName = "ACL"
@@ -634,7 +667,8 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                 priority = 50
                 tableId = 243 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100481bi
                 flowId = "Egress_Fixed_Conntrk_Drop123_987_Tracked_Invalid"
                 flowName = "ACL"
@@ -655,7 +689,8 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
 
     static def fixedConntrackIngressFlowsPort4() {
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Ingress_Fixed_Conntrk_123_0D:AA:D8:42:30:F6_10.0.0.4/32_Recirc"
                 flowName = "ACL"
@@ -673,7 +708,8 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                 priority = 61010
                 tableId = 241 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Ingress_Fixed_Conntrk_123_0D:AA:D8:42:30:F6_0.0.0.0/0_Recirc"
                 flowName = "ACL"
@@ -690,7 +726,8 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                 priority = 61010
                 tableId = 241 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100481bi
                 flowId = "Ingress_Fixed_Conntrk_Drop123_987_Tracked_New"
                 flowName = "ACL"
@@ -706,7 +743,8 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                 priority = 50
                 tableId = 213 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100481bi
                 flowId = "Ingress_Fixed_Conntrk_Drop123_987_Tracked_Invalid"
                 flowName = "ACL"
@@ -727,7 +765,8 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
 
     static def fixedConntrackEgressFlowsPort4() {
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_Fixed_Conntrk_123_0D:AA:D8:42:30:F6_10.0.0.4/32_Recirc"
                 flowName = "ACL"
@@ -744,7 +783,8 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                 priority = 61010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_Fixed_Conntrk_123_0D:AA:D8:42:30:F6_0.0.0.0/0_Recirc"
                 flowName = "ACL"
@@ -760,7 +800,8 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                 priority = 61010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100481bi
                 flowId = "Egress_Fixed_Conntrk_Drop123_987_Tracked_New"
                 flowName = "ACL"
@@ -776,7 +817,8 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                 priority = 50
                 tableId = 243 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100481bi
                 flowId = "Egress_Fixed_Conntrk_Drop123_987_Tracked_Invalid"
                 flowName = "ACL"
@@ -796,10 +838,12 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
     }
 
     protected def etherEgressFlowsPort1() {
+        val theFlowId = "ETHERnullEgress98785cc3048-abc3-43cc-89b3-377341426ac6"
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "ETHERnullEgress98785cc3048-abc3-43cc-89b3-377341426ac6"
+                flowId = theFlowId
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -813,17 +857,19 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
                     new NxMatchCtState(33L, 33L)
                 ]
-                priority = IdHelper.getId(flowId)
+                priority = IdHelper.getId(theFlowId)
                 tableId = 213 as short
             ]
         ]
     }
 
     protected def etheregressFlowPort2() {
+        val theFlowId = "ETHERnullEgress98785cc3048-abc3-43cc-89b3-377341426ac6"
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "ETHERnullEgress98785cc3048-abc3-43cc-89b3-377341426ac6"
+                flowId = theFlowId
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -837,17 +883,19 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
                     new NxMatchCtState(33L, 33L)
                 ]
-                priority = IdHelper.getId(flowId)
+                priority = IdHelper.getId(theFlowId)
                 tableId = 213 as short
             ]
         ]
     }
 
     protected def tcpIngressFlowPort1() {
+        val theFlowId = "TCP_DESTINATION_80_65535Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "TCP_DESTINATION_80_65535Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
+                flowId = theFlowId
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -863,17 +911,19 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L),
                     new NxMatchCtState(33L, 33L)
                 ]
-                priority = IdHelper.getId(flowId)
+                priority = IdHelper.getId(theFlowId)
                 tableId = 243 as short
             ]
         ]
     }
 
     protected def tcpIngressFlowPort2() {
+        val theFlowId = "TCP_DESTINATION_80_65535Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "TCP_DESTINATION_80_65535Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
+                flowId = theFlowId
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -889,18 +939,19 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L),
                     new NxMatchCtState(33L, 33L)
                 ]
-                priority = IdHelper.getId(flowId)
+                priority = IdHelper.getId(theFlowId)
                 tableId = 243 as short
             ]
         ]
     }
 
     protected def tcpEgressFlowPort2() {
+        val theFlowId = "TCP_DESTINATION_80_65535_remoteACL_id_85cc3048-abc3-43cc-89b3-377341426ac5Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "TCP_DESTINATION_80_65535_remoteACL_id_85cc3048-abc3-43cc-89b3-377341426ac5"
-                        +"Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
+                flowId = theFlowId
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -917,17 +968,19 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
                     new NxMatchCtState(33L, 33L)
                 ]
-                priority = IdHelper.getId(flowId)
+                priority = IdHelper.getId(theFlowId)
                 tableId = 213 as short
             ]
         ]
     }
 
     protected def udpEgressFlowsPort1() {
+        val theFlowId = "UDP_DESTINATION_80_65535Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
         #[
-             new FlowEntity(123bi) => [
+             new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "UDP_DESTINATION_80_65535Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
+                flowId = theFlowId
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -943,18 +996,19 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
                     new NxMatchCtState(33L, 33L)
                 ]
-                priority = IdHelper.getId(flowId)
+                priority = IdHelper.getId(theFlowId)
                 tableId = 213 as short
             ]
         ]
     }
 
     protected def udpIngressFlowsPort2() {
+        val theFlowId = "UDP_DESTINATION_80_65535_remoteACL_id_85cc3048-abc3-43cc-89b3-377341426ac5Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "UDP_DESTINATION_80_65535_remoteACL_id_85cc3048-abc3-43cc-89b3-377341426ac5"
-                        +"Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
+                flowId = theFlowId
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -971,17 +1025,19 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L),
                     new NxMatchCtState(33L, 33L)
                 ]
-                priority = IdHelper.getId(flowId)
+                priority = IdHelper.getId(theFlowId)
                 tableId = 243 as short
             ]
         ]
     }
 
     protected def udpEgressFlowsPort2() {
+        val theFlowId = "UDP_DESTINATION_80_65535Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "UDP_DESTINATION_80_65535Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
+                flowId = theFlowId
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -997,17 +1053,19 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
                     new NxMatchCtState(33L, 33L)
                 ]
-                priority = IdHelper.getId(flowId)
+                priority = IdHelper.getId(theFlowId)
                 tableId = 213 as short
             ]
         ]
     }
 
     protected def icmpIngressFlowsPort1() {
+        val theFlowId = "ICMP_V4_DESTINATION_23_Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "ICMP_V4_DESTINATION_23_Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
+                flowId = theFlowId
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -1023,17 +1081,19 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L),
                     new NxMatchCtState(33L, 33L)
                 ]
-                priority = IdHelper.getId(flowId)
+                priority = IdHelper.getId(theFlowId)
                 tableId = 243 as short
             ]
         ]
     }
 
     protected def icmpIngressFlowsPort2() {
+        val theFlowId = "ICMP_V4_DESTINATION_23_Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "ICMP_V4_DESTINATION_23_Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
+                flowId = theFlowId
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -1049,18 +1109,19 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L),
                     new NxMatchCtState(33L, 33L)
                 ]
-                priority = IdHelper.getId(flowId)
+                priority = IdHelper.getId(theFlowId)
                 tableId = 243 as short
             ]
         ]
     }
 
     protected def icmpEgressFlowsPort2() {
+        val theFlowId = "ICMP_V4_DESTINATION_23__remoteACL_id_85cc3048-abc3-43cc-89b3-377341426ac5Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "ICMP_V4_DESTINATION_23__remoteACL_id_85cc3048-abc3-43cc-89b3-377341426ac5"
-                        +"Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
+                flowId = theFlowId
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -1077,17 +1138,19 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
                     new NxMatchCtState(33L, 33L)
                 ]
-                priority = IdHelper.getId(flowId)
+                priority = IdHelper.getId(theFlowId)
                 tableId = 213 as short
             ]
         ]
     }
 
     protected def udpIngressPortRangeFlows() {
+        val theFlowId = "UDP_DESTINATION_2000_65532Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "UDP_DESTINATION_2000_65532Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
+                flowId = theFlowId
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -1103,17 +1166,26 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L),
                     new NxMatchCtState(33L, 33L)
                 ]
-                priority = IdHelper.getId(flowId)
+                priority = IdHelper.getId(theFlowId)
                 tableId = 243 as short
             ]
         ]
     }
 
     protected def tcpEgressRangeFlows() {
+        val flowId1 = "TCP_DESTINATION_776_65534Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
+        val flowId2 = "TCP_DESTINATION_512_65280Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
+        val flowId3 = "TCP_DESTINATION_334_65534Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
+        val flowId4 = "TCP_DESTINATION_333_65535Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
+        val flowId5 = "TCP_DESTINATION_336_65520Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
+        val flowId6 = "TCP_DESTINATION_352_65504Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
+        val flowId7 = "TCP_DESTINATION_384_65408Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
+        val flowId8 = "TCP_DESTINATION_768_65528Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "TCP_DESTINATION_776_65534Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
+                flowId = flowId1
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -1129,12 +1201,13 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
                     new NxMatchCtState(33L, 33L)
                 ]
-                priority = IdHelper.getId(flowId)
+                priority = IdHelper.getId(flowId1)
                 tableId = 213 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "TCP_DESTINATION_512_65280Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
+                flowId = flowId2
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -1150,12 +1223,13 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
                     new NxMatchCtState(33L, 33L)
                 ]
-                priority = IdHelper.getId(flowId)
+                priority = IdHelper.getId(flowId2)
                 tableId = 213 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "TCP_DESTINATION_334_65534Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
+                flowId = flowId3
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -1171,12 +1245,13 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
                     new NxMatchCtState(33L, 33L)
                 ]
-                priority = IdHelper.getId(flowId)
+                priority = IdHelper.getId(flowId3)
                 tableId = 213 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "TCP_DESTINATION_333_65535Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
+                flowId = flowId4
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -1192,12 +1267,13 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
                     new NxMatchCtState(33L, 33L)
                 ]
-                priority = IdHelper.getId(flowId)
+                priority = IdHelper.getId(flowId4)
                 tableId = 213 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "TCP_DESTINATION_336_65520Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
+                flowId = flowId5
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -1213,12 +1289,13 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
                     new NxMatchCtState(33L, 33L)
                 ]
-                priority = IdHelper.getId(flowId)
+                priority = IdHelper.getId(flowId5)
                 tableId = 213 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "TCP_DESTINATION_352_65504Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
+                flowId = flowId6
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -1234,12 +1311,13 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
                     new NxMatchCtState(33L, 33L)
                 ]
-                priority = IdHelper.getId(flowId)
+                priority = IdHelper.getId(flowId6)
                 tableId = 213 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "TCP_DESTINATION_384_65408Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
+                flowId = flowId7
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -1255,12 +1333,13 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
                     new NxMatchCtState(33L, 33L)
                 ]
-                priority = IdHelper.getId(flowId)
+                priority = IdHelper.getId(flowId7)
                 tableId = 213 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "TCP_DESTINATION_768_65528Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
+                flowId = flowId8
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -1276,17 +1355,19 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
                     new NxMatchCtState(33L, 33L)
                 ]
-                priority = IdHelper.getId(flowId)
+                priority = IdHelper.getId(flowId8)
                 tableId = 213 as short
             ]
         ]
     }
 
     protected def udpIngressAllFlows() {
+        val theFlowId = "UDP_DESTINATION_1_0Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "UDP_DESTINATION_1_0Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
+                flowId = theFlowId
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -1301,17 +1382,19 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L),
                     new NxMatchCtState(33L, 33L)
                 ]
-                priority = IdHelper.getId(flowId)
+                priority = IdHelper.getId(theFlowId)
                 tableId = 243 as short
             ]
         ]
     }
 
     protected def tcpEgressAllFlows() {
+        val theFlowId = "TCP_DESTINATION_1_0Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
          #[
-             new FlowEntity(123bi) => [
+             new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "TCP_DESTINATION_1_0Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
+                flowId = theFlowId
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -1326,7 +1409,7 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
                     new NxMatchCtState(33L, 33L)
                 ]
-                priority = IdHelper.getId(flowId)
+                priority = IdHelper.getId(theFlowId)
                 tableId = 213 as short
             ]
          ]
@@ -1334,10 +1417,13 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
      }
 
     protected def icmpIngressFlowsPort3() {
+        val flowId1 = "ICMP_V4_DESTINATION_23_Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
+        val flowId2 = "ICMP_V4_DESTINATION_23_Ingress98785cc3048-abc3-43cc-89b3-377341426a22"
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "ICMP_V4_DESTINATION_23_Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
+                flowId = flowId1
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -1353,12 +1439,13 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L),
                     new NxMatchCtState(33L, 33L)
                 ]
-                priority = IdHelper.getId(flowId)
+                priority = IdHelper.getId(flowId1)
                 tableId = 243 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "ICMP_V4_DESTINATION_23_Ingress98785cc3048-abc3-43cc-89b3-377341426a22"
+                flowId = flowId2
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -1374,17 +1461,20 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L),
                     new NxMatchCtState(33L, 33L)
                 ]
-                priority = IdHelper.getId(flowId)
+                priority = IdHelper.getId(flowId2)
                 tableId = 243 as short
             ]
         ]
     }
 
     protected def icmpEgressFlowsPort3() {
+        val flowId1 = "ICMP_V4_DESTINATION_23_Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
+        val flowId2 = "ICMP_V4_DESTINATION_23_Egress98785cc3048-abc3-43cc-89b3-377341426a21"
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "ICMP_V4_DESTINATION_23_Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
+                flowId = flowId1
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -1400,12 +1490,13 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
                     new NxMatchCtState(33L, 33L)
                 ]
-                priority = IdHelper.getId(flowId)
+                priority = IdHelper.getId(flowId1)
                 tableId = 213 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "ICMP_V4_DESTINATION_23_Egress98785cc3048-abc3-43cc-89b3-377341426a21"
+                flowId = flowId2
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -1421,7 +1512,7 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
                     new NxMatchCtState(33L, 33L)
                 ]
-                priority = IdHelper.getId(flowId)
+                priority = IdHelper.getId(flowId2)
                 tableId = 213 as short
             ]
         ]
@@ -1430,7 +1521,8 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
     override def expectedFlows(String mac) {
         // Code auto. generated by https://github.com/vorburger/xtendbeans
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Ingress_DHCP_Server_v4123_987__Permit_"
                 flowName = "ACL"
@@ -1449,7 +1541,8 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 241 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Ingress_DHCP_Server_v6_123_987___Permit_"
                 flowName = "ACL"
@@ -1468,7 +1561,8 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 241 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Ingress_ICMPv6_123_987_130_Permit_"
                 flowName = "ACL"
@@ -1486,7 +1580,8 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 241 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Ingress_ICMPv6_123_987_135_Permit_"
                 flowName = "ACL"
@@ -1504,7 +1599,8 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 241 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Ingress_ICMPv6_123_987_136_Permit_"
                 flowName = "ACL"
@@ -1522,7 +1618,8 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 241 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Ingress_ARP_123_987"
                 flowName = "ACL"
@@ -1538,7 +1635,8 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 241 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100481bi
                 flowId = "Ingress_Fixed_Conntrk_Drop123_987_Tracked_New"
                 flowName = "ACL"
@@ -1554,7 +1652,8 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                 priority = 50
                 tableId = 213 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100481bi
                 flowId = "Ingress_Fixed_Conntrk_Drop123_987_Tracked_Invalid"
                 flowName = "ACL"
@@ -1570,7 +1669,8 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                 priority = 62015
                 tableId = 213 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_DHCP_Client_v4123_987__Permit_"
                 flowName = "ACL"
@@ -1589,7 +1689,8 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_DHCP_Client_v6_123_987__Permit_"
                 flowName = "ACL"
@@ -1608,7 +1709,8 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_DHCP_Server_v4123_987__Drop_"
                 flowName = "ACL"
@@ -1624,7 +1726,8 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_DHCP_Server_v6_123_987__Drop_"
                 flowName = "ACL"
@@ -1640,7 +1743,8 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_ICMPv6_123_987_134_Drop_"
                 flowName = "ACL"
@@ -1655,7 +1759,8 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                 priority = 63020
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_ICMPv6_123_987_133_Permit_"
                 flowName = "ACL"
@@ -1673,7 +1778,8 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_ICMPv6_123_987_135_Permit_"
                 flowName = "ACL"
@@ -1691,7 +1797,8 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_ICMPv6_123_987_136_Permit_"
                 flowName = "ACL"
@@ -1709,7 +1816,8 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100481bi
                 flowId = "Egress_Fixed_Conntrk_Drop123_987_Tracked_New"
                 flowName = "ACL"
@@ -1725,7 +1833,8 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                 priority = 50
                 tableId = 243 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100481bi
                 flowId = "Egress_Fixed_Conntrk_Drop123_987_Tracked_Invalid"
                 flowName = "ACL"
@@ -1741,7 +1850,8 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                 priority = 62015
                 tableId = 243 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Ingress_Fixed_Conntrk_123_" + mac + "_10.0.0.1/32_Recirc"
             flowName = "ACL"
@@ -1759,7 +1869,8 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                 priority = 61010
                 tableId = 241 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_Fixed_Conntrk_123_" + mac + "_10.0.0.1/32_Recirc"
                 flowName = "ACL"
@@ -1776,7 +1887,8 @@ class FlowEntryObjectsStateful extends FlowEntryObjectsBase {
                 priority = 61010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_ARP_123_987_" + mac
                 flowName = "ACL"
index 945435ad72b095218456ca336d22608ff46c124d..1649599aca0d1d1f20c56510dadda4f41a2adc99 100644 (file)
@@ -7,11 +7,11 @@
  */
 package org.opendaylight.netvirt.aclservice.tests
 
-import org.opendaylight.genius.mdsalutil.FlowEntity
 import org.opendaylight.genius.mdsalutil.MetaDataUtil
 import org.opendaylight.genius.mdsalutil.actions.ActionDrop
 import org.opendaylight.genius.mdsalutil.actions.ActionNxConntrack
 import org.opendaylight.genius.mdsalutil.actions.ActionNxResubmit
+import org.opendaylight.genius.mdsalutil.FlowEntityBuilder
 import org.opendaylight.genius.mdsalutil.instructions.InstructionApplyActions
 import org.opendaylight.genius.mdsalutil.matches.MatchEthernetDestination
 import org.opendaylight.genius.mdsalutil.matches.MatchEthernetSource
@@ -28,11 +28,14 @@ import org.opendaylight.genius.mdsalutil.nxmatches.NxMatchUdpDestinationPort
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg6
 
+import static extension org.opendaylight.mdsal.binding.testutils.XtendBuilderExtensions.operator_doubleGreaterThan
+
 class FlowEntryObjectsStatefulIPv6 extends FlowEntryObjectsStateful {
 
     override fixedConntrackIngressFlowsPort1() {
         #[
-           new FlowEntity(123bi) => [
+           new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Ingress_Fixed_Conntrk_123_0D:AA:D8:42:30:F3_2001:db8:1::/64_Recirc"
             flowName = "ACL"
@@ -50,7 +53,8 @@ class FlowEntryObjectsStatefulIPv6 extends FlowEntryObjectsStateful {
                 priority = 61010
                 tableId = 241 as short
             ],
-           new FlowEntity(123bi) => [
+           new FlowEntityBuilder >> [
+                dpnId = 123bi
                cookie = 110100481bi
                flowId = "Ingress_Fixed_Conntrk_Drop123_987_Tracked_New"
                flowName = "ACL"
@@ -66,7 +70,8 @@ class FlowEntryObjectsStatefulIPv6 extends FlowEntryObjectsStateful {
                priority = 50
                tableId = 213 as short
            ],
-           new FlowEntity(123bi) => [
+           new FlowEntityBuilder >> [
+                dpnId = 123bi
                cookie = 110100481bi
                flowId = "Ingress_Fixed_Conntrk_Drop123_987_Tracked_Invalid"
                flowName = "ACL"
@@ -86,11 +91,13 @@ class FlowEntryObjectsStatefulIPv6 extends FlowEntryObjectsStateful {
     }
 
     override etherIngressFlowsPort2() {
+        val flowId1 = "ETHERnull_ipv6_remoteACL_interface_aap_0D:AA:D8:42:30:F3_2001:db8:1::/64Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
+        val flowId2 = "ETHERnull_ipv6_remoteACL_interface_aap_0D:AA:D8:42:30:F4_2001:db8:2::/64Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "ETHERnull_ipv6_remoteACL_interface_aap_0D:AA:D8:42:30:F3_2001:db8:1::/64"
-                        +"Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
+                flowId = flowId1
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -107,13 +114,13 @@ class FlowEntryObjectsStatefulIPv6 extends FlowEntryObjectsStateful {
                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L),
                     new NxMatchCtState(33, 33)
                 ]
-                priority = IdHelper.getId(flowId)
+                priority = IdHelper.getId(flowId1)
                 tableId = 243 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "ETHERnull_ipv6_remoteACL_interface_aap_0D:AA:D8:42:30:F4_2001:db8:2::/64"
-                        +"Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
+                flowId = flowId2
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -130,7 +137,7 @@ class FlowEntryObjectsStatefulIPv6 extends FlowEntryObjectsStateful {
                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L),
                     new NxMatchCtState(33, 33)
                 ]
-                priority = IdHelper.getId(flowId)
+                priority = IdHelper.getId(flowId2)
                 tableId = 243 as short
             ]
         ]
@@ -138,7 +145,8 @@ class FlowEntryObjectsStatefulIPv6 extends FlowEntryObjectsStateful {
 
     override fixedConntrackEgressFlowsPort1() {
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_Fixed_Conntrk_123_0D:AA:D8:42:30:F3_2001:db8:1::/64_Recirc"
                 flowName = "ACL"
@@ -155,7 +163,8 @@ class FlowEntryObjectsStatefulIPv6 extends FlowEntryObjectsStateful {
                 priority = 61010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100481bi
                 flowId = "Egress_Fixed_Conntrk_Drop123_987_Tracked_New"
                 flowName = "ACL"
@@ -171,7 +180,8 @@ class FlowEntryObjectsStatefulIPv6 extends FlowEntryObjectsStateful {
                 priority = 50
                 tableId = 243 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100481bi
                 flowId = "Egress_Fixed_Conntrk_Drop123_987_Tracked_Invalid"
                 flowName = "ACL"
@@ -192,7 +202,8 @@ class FlowEntryObjectsStatefulIPv6 extends FlowEntryObjectsStateful {
 
     override fixedConntrackIngressFlowsPort2() {
         #[
-             new FlowEntity(123bi) => [
+             new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Ingress_Fixed_Conntrk_123_0D:AA:D8:42:30:F4_2001:db8:2::/64_Recirc"
                 flowName = "ACL"
@@ -210,7 +221,8 @@ class FlowEntryObjectsStatefulIPv6 extends FlowEntryObjectsStateful {
                 priority = 61010
                 tableId = 241 as short
              ],
-             new FlowEntity(123bi) => [
+             new FlowEntityBuilder >> [
+                dpnId = 123bi
                  cookie = 110100481bi
                  flowId = "Ingress_Fixed_Conntrk_Drop123_987_Tracked_New"
                  flowName = "ACL"
@@ -226,7 +238,8 @@ class FlowEntryObjectsStatefulIPv6 extends FlowEntryObjectsStateful {
                  priority = 50
                  tableId = 213 as short
              ],
-             new FlowEntity(123bi) => [
+             new FlowEntityBuilder >> [
+                dpnId = 123bi
                  cookie = 110100481bi
                  flowId = "Ingress_Fixed_Conntrk_Drop123_987_Tracked_Invalid"
                  flowName = "ACL"
@@ -248,7 +261,8 @@ class FlowEntryObjectsStatefulIPv6 extends FlowEntryObjectsStateful {
 
     override fixedConntrackEgressFlowsPort2() {
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_Fixed_Conntrk_123_0D:AA:D8:42:30:F4_2001:db8:2::/64_Recirc"
                 flowName = "ACL"
@@ -265,7 +279,8 @@ class FlowEntryObjectsStatefulIPv6 extends FlowEntryObjectsStateful {
                 priority = 61010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100481bi
                 flowId = "Egress_Fixed_Conntrk_Drop123_987_Tracked_New"
                 flowName = "ACL"
@@ -281,7 +296,8 @@ class FlowEntryObjectsStatefulIPv6 extends FlowEntryObjectsStateful {
                 priority = 50
                 tableId = 243 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100481bi
                 flowId = "Egress_Fixed_Conntrk_Drop123_987_Tracked_Invalid"
                 flowName = "ACL"
@@ -302,7 +318,8 @@ class FlowEntryObjectsStatefulIPv6 extends FlowEntryObjectsStateful {
 
     override fixedConntrackIngressFlowsPort3() {
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Ingress_Fixed_Conntrk_123_0D:AA:D8:42:30:F5_2001:db8:3::/64_Recirc"
                 flowName = "ACL"
@@ -320,7 +337,8 @@ class FlowEntryObjectsStatefulIPv6 extends FlowEntryObjectsStateful {
                 priority = 61010
                 tableId = 241 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100481bi
                 flowId = "Ingress_Fixed_Conntrk_Drop123_987_Tracked_New"
                 flowName = "ACL"
@@ -336,7 +354,8 @@ class FlowEntryObjectsStatefulIPv6 extends FlowEntryObjectsStateful {
                 priority = 50
                 tableId = 213 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100481bi
                 flowId = "Ingress_Fixed_Conntrk_Drop123_987_Tracked_Invalid"
                 flowName = "ACL"
@@ -357,7 +376,8 @@ class FlowEntryObjectsStatefulIPv6 extends FlowEntryObjectsStateful {
 
     override fixedConntrackEgressFlowsPort3() {
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_Fixed_Conntrk_123_0D:AA:D8:42:30:F5_2001:db8:3::/64_Recirc"
                 flowName = "ACL"
@@ -374,7 +394,8 @@ class FlowEntryObjectsStatefulIPv6 extends FlowEntryObjectsStateful {
                 priority = 61010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100481bi
                 flowId = "Egress_Fixed_Conntrk_Drop123_987_Tracked_New"
                 flowName = "ACL"
@@ -390,7 +411,8 @@ class FlowEntryObjectsStatefulIPv6 extends FlowEntryObjectsStateful {
                 priority = 50
                 tableId = 243 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100481bi
                 flowId = "Egress_Fixed_Conntrk_Drop123_987_Tracked_Invalid"
                 flowName = "ACL"
@@ -411,10 +433,12 @@ class FlowEntryObjectsStatefulIPv6 extends FlowEntryObjectsStateful {
     }
 
     override etherEgressFlowsPort1() {
+        val theFlowId = "ETHERnullEgress98785cc3048-abc3-43cc-89b3-377341426ac6"
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "ETHERnullEgress98785cc3048-abc3-43cc-89b3-377341426ac6"
+                flowId = theFlowId
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -429,17 +453,19 @@ class FlowEntryObjectsStatefulIPv6 extends FlowEntryObjectsStateful {
                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
                     new NxMatchCtState(33, 33)
                 ]
-                priority = IdHelper.getId(flowId)
+                priority = IdHelper.getId(theFlowId)
                 tableId = 213 as short
             ]
         ]
     }
 
     override etheregressFlowPort2() {
+        val theFlowId = "ETHERnullEgress98785cc3048-abc3-43cc-89b3-377341426ac6"
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "ETHERnullEgress98785cc3048-abc3-43cc-89b3-377341426ac6"
+                flowId = theFlowId
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -454,17 +480,19 @@ class FlowEntryObjectsStatefulIPv6 extends FlowEntryObjectsStateful {
                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
                     new NxMatchCtState(33, 33)
                 ]
-                priority = IdHelper.getId(flowId)
+                priority = IdHelper.getId(theFlowId)
                 tableId = 213 as short
             ]
         ]
     }
 
     override tcpIngressFlowPort1() {
+        val theFlowId = "TCP_DESTINATION_80_65535Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "TCP_DESTINATION_80_65535Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
+                flowId = theFlowId
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -481,17 +509,19 @@ class FlowEntryObjectsStatefulIPv6 extends FlowEntryObjectsStateful {
                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
                     new NxMatchCtState(33, 33)
                 ]
-                priority = IdHelper.getId(flowId)
+                priority = IdHelper.getId(theFlowId)
                 tableId = 243 as short
             ]
         ]
     }
 
     override tcpIngressFlowPort2() {
+        val theFlowId = "TCP_DESTINATION_80_65535Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "TCP_DESTINATION_80_65535Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
+                flowId = theFlowId
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -508,18 +538,20 @@ class FlowEntryObjectsStatefulIPv6 extends FlowEntryObjectsStateful {
                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L),
                     new NxMatchCtState(33, 33)
                 ]
-                priority = IdHelper.getId(flowId)
+                priority = IdHelper.getId(theFlowId)
                 tableId = 243 as short
             ]
         ]
     }
 
     override tcpEgressFlowPort2() {
+        val flowId1 = "TCP_DESTINATION_80_65535_ipv6_remoteACL_interface_aap_0D:AA:D8:42:30:F3_2001:db8:1::/64Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
+        val flowId2 = "TCP_DESTINATION_80_65535_ipv6_remoteACL_interface_aap_0D:AA:D8:42:30:F4_2001:db8:2::/64Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "TCP_DESTINATION_80_65535_ipv6_remoteACL_interface_aap_0D:AA:D8:42:30:F3_2001:db8:1::/64"
-                        +"Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
+                flowId = flowId1
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -538,12 +570,13 @@ class FlowEntryObjectsStatefulIPv6 extends FlowEntryObjectsStateful {
                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
                     new NxMatchCtState(33, 33)
                 ]
-                priority = IdHelper.getId(flowId)
+                priority = IdHelper.getId(flowId1)
                 tableId = 213 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "TCP_DESTINATION_80_65535_ipv6_remoteACL_interface_aap_0D:AA:D8:42:30:F4_2001:db8:2::/64Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
+                flowId = flowId1
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -562,17 +595,19 @@ class FlowEntryObjectsStatefulIPv6 extends FlowEntryObjectsStateful {
                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
                     new NxMatchCtState(33, 33)
                 ]
-                priority = IdHelper.getId(flowId)
+                priority = IdHelper.getId(flowId2)
                 tableId = 213 as short
             ]
         ]
     }
 
     override udpEgressFlowsPort1() {
+        val theFlowId = "UDP_DESTINATION_80_65535Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
         #[
-             new FlowEntity(123bi) => [
+             new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "UDP_DESTINATION_80_65535Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
+                flowId = theFlowId
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -589,18 +624,20 @@ class FlowEntryObjectsStatefulIPv6 extends FlowEntryObjectsStateful {
                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
                     new NxMatchCtState(33, 33)
                 ]
-                priority = IdHelper.getId(flowId)
+                priority = IdHelper.getId(theFlowId)
                 tableId = 213 as short
             ]
         ]
     }
 
     override udpIngressFlowsPort2() {
+        val flowId1 = "UDP_DESTINATION_80_65535_ipv6_remoteACL_interface_aap_0D:AA:D8:42:30:F3_2001:db8:1::/64Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
+        val flowId2 = "UDP_DESTINATION_80_65535_ipv6_remoteACL_interface_aap_0D:AA:D8:42:30:F4_2001:db8:2::/64Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "UDP_DESTINATION_80_65535_ipv6_remoteACL_interface_aap_0D:AA:D8:42:30:F3_2001:db8:1::/64"
-                        +"Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
+                flowId = flowId1
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -619,12 +656,13 @@ class FlowEntryObjectsStatefulIPv6 extends FlowEntryObjectsStateful {
                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L),
                     new NxMatchCtState(33, 33)
                 ]
-                priority = IdHelper.getId(flowId)
+                priority = IdHelper.getId(flowId1)
                 tableId = 243 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "UDP_DESTINATION_80_65535_ipv6_remoteACL_interface_aap_0D:AA:D8:42:30:F4_2001:db8:2::/64Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
+                flowId = flowId2
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -643,17 +681,19 @@ class FlowEntryObjectsStatefulIPv6 extends FlowEntryObjectsStateful {
                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L),
                     new NxMatchCtState(33, 33)
                 ]
-                priority = IdHelper.getId(flowId)
+                priority = IdHelper.getId(flowId2)
                 tableId = 243 as short
             ]
         ]
     }
 
     override udpEgressFlowsPort2() {
+        val theFlowId = "UDP_DESTINATION_80_65535Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "UDP_DESTINATION_80_65535Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
+                flowId = theFlowId
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -670,17 +710,19 @@ class FlowEntryObjectsStatefulIPv6 extends FlowEntryObjectsStateful {
                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
                     new NxMatchCtState(33, 33)
                 ]
-                priority = IdHelper.getId(flowId)
+                priority = IdHelper.getId(theFlowId)
                 tableId = 213 as short
             ]
         ]
     }
 
     override icmpIngressFlowsPort1() {
+        val theFlowId = "ICMP_V6_DESTINATION_23_Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "ICMP_V6_DESTINATION_23_Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
+                flowId = theFlowId
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -697,17 +739,19 @@ class FlowEntryObjectsStatefulIPv6 extends FlowEntryObjectsStateful {
                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L),
                     new NxMatchCtState(33, 33)
                 ]
-                priority = IdHelper.getId(flowId)
+                priority = IdHelper.getId(theFlowId)
                 tableId = 243 as short
             ]
         ]
     }
 
     override icmpIngressFlowsPort2() {
+        val theFlowId = "ICMP_V6_DESTINATION_23_Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "ICMP_V6_DESTINATION_23_Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
+                flowId = theFlowId
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -724,18 +768,20 @@ class FlowEntryObjectsStatefulIPv6 extends FlowEntryObjectsStateful {
                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L),
                     new NxMatchCtState(33, 33)
                 ]
-                priority = IdHelper.getId(flowId)
+                priority = IdHelper.getId(theFlowId)
                 tableId = 243 as short
             ]
         ]
     }
 
     override icmpEgressFlowsPort2() {
+        val flowId1 = "ICMP_V6_DESTINATION_23__ipv6_remoteACL_interface_aap_0D:AA:D8:42:30:F3_2001:db8:1::/64Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
+        val flowId2 = "ICMP_V6_DESTINATION_23__ipv6_remoteACL_interface_aap_0D:AA:D8:42:30:F4_2001:db8:2::/64Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "ICMP_V6_DESTINATION_23__ipv6_remoteACL_interface_aap_0D:AA:D8:42:30:F3_2001:db8:1::/64"
-                        +"Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
+                flowId = flowId1
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -754,13 +800,13 @@ class FlowEntryObjectsStatefulIPv6 extends FlowEntryObjectsStateful {
                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
                     new NxMatchCtState(33, 33)
                 ]
-                priority = IdHelper.getId(flowId)
+                priority = IdHelper.getId(flowId1)
                 tableId = 213 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "ICMP_V6_DESTINATION_23__ipv6_remoteACL_interface_aap_0D:AA:D8:42:30:F4_2001:db8:2::/64"
-                        +"Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
+                flowId = flowId2
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -779,17 +825,19 @@ class FlowEntryObjectsStatefulIPv6 extends FlowEntryObjectsStateful {
                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
                     new NxMatchCtState(33, 33)
                 ]
-                priority = IdHelper.getId(flowId)
+                priority = IdHelper.getId(flowId2)
                 tableId = 213 as short
             ]
         ]
     }
 
     override udpIngressPortRangeFlows() {
+        val theFlowId = "UDP_DESTINATION_2000_65532Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "UDP_DESTINATION_2000_65532Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
+                flowId = theFlowId
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -806,17 +854,26 @@ class FlowEntryObjectsStatefulIPv6 extends FlowEntryObjectsStateful {
                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L),
                     new NxMatchCtState(33, 33)
                 ]
-                priority = IdHelper.getId(flowId)
+                priority = IdHelper.getId(theFlowId)
                 tableId = 243 as short
             ]
         ]
     }
 
     override tcpEgressRangeFlows() {
+        val flowId1 = "TCP_DESTINATION_776_65534Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
+        val flowId2 = "TCP_DESTINATION_512_65280Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
+        val flowId3 = "TCP_DESTINATION_334_65534Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
+        val flowId4 = "TCP_DESTINATION_333_65535Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
+        val flowId5 = "TCP_DESTINATION_336_65520Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
+        val flowId6 = "TCP_DESTINATION_352_65504Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
+        val flowId7 = "TCP_DESTINATION_384_65408Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
+        val flowId8 = "TCP_DESTINATION_768_65528Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "TCP_DESTINATION_776_65534Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
+                flowId = flowId1
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -833,12 +890,13 @@ class FlowEntryObjectsStatefulIPv6 extends FlowEntryObjectsStateful {
                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
                     new NxMatchCtState(33, 33)
                 ]
-                priority = IdHelper.getId(flowId)
+                priority = IdHelper.getId(flowId1)
                 tableId = 213 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "TCP_DESTINATION_512_65280Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
+                flowId = flowId2
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -855,12 +913,13 @@ class FlowEntryObjectsStatefulIPv6 extends FlowEntryObjectsStateful {
                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
                     new NxMatchCtState(33, 33)
                 ]
-                priority = IdHelper.getId(flowId)
+                priority = IdHelper.getId(flowId2)
                 tableId = 213 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "TCP_DESTINATION_334_65534Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
+                flowId = flowId3
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -877,12 +936,13 @@ class FlowEntryObjectsStatefulIPv6 extends FlowEntryObjectsStateful {
                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
                     new NxMatchCtState(33, 33)
                 ]
-                priority = IdHelper.getId(flowId)
+                priority = IdHelper.getId(flowId3)
                 tableId = 213 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "TCP_DESTINATION_333_65535Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
+                flowId = flowId4
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -899,12 +959,13 @@ class FlowEntryObjectsStatefulIPv6 extends FlowEntryObjectsStateful {
                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
                     new NxMatchCtState(33, 33)
                 ]
-                priority = IdHelper.getId(flowId)
+                priority = IdHelper.getId(flowId4)
                 tableId = 213 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "TCP_DESTINATION_336_65520Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
+                flowId = flowId5
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -921,12 +982,13 @@ class FlowEntryObjectsStatefulIPv6 extends FlowEntryObjectsStateful {
                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
                     new NxMatchCtState(33, 33)
                 ]
-                priority = IdHelper.getId(flowId)
+                priority = IdHelper.getId(flowId5)
                 tableId = 213 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "TCP_DESTINATION_352_65504Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
+                flowId = flowId6
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -943,12 +1005,13 @@ class FlowEntryObjectsStatefulIPv6 extends FlowEntryObjectsStateful {
                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
                     new NxMatchCtState(33, 33)
                 ]
-                priority = IdHelper.getId(flowId)
+                priority = IdHelper.getId(flowId6)
                 tableId = 213 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "TCP_DESTINATION_384_65408Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
+                flowId = flowId7
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -965,12 +1028,13 @@ class FlowEntryObjectsStatefulIPv6 extends FlowEntryObjectsStateful {
                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
                     new NxMatchCtState(33, 33)
                 ]
-                priority = IdHelper.getId(flowId)
+                priority = IdHelper.getId(flowId7)
                 tableId = 213 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "TCP_DESTINATION_768_65528Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
+                flowId = flowId8
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -987,17 +1051,19 @@ class FlowEntryObjectsStatefulIPv6 extends FlowEntryObjectsStateful {
                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
                     new NxMatchCtState(33, 33)
                 ]
-                priority = IdHelper.getId(flowId)
+                priority = IdHelper.getId(flowId8)
                 tableId = 213 as short
             ]
         ]
     }
 
     override udpIngressAllFlows() {
+        val theFlowId = "UDP_DESTINATION_1_0Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "UDP_DESTINATION_1_0Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
+                flowId = theFlowId
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -1013,17 +1079,19 @@ class FlowEntryObjectsStatefulIPv6 extends FlowEntryObjectsStateful {
                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L),
                     new NxMatchCtState(33, 33)
                 ]
-                priority = IdHelper.getId(flowId)
+                priority = IdHelper.getId(theFlowId)
                 tableId = 243 as short
             ]
         ]
     }
 
     override tcpEgressAllFlows() {
+        val theFlowId = "TCP_DESTINATION_1_0Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
          #[
-             new FlowEntity(123bi) => [
+             new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "TCP_DESTINATION_1_0Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
+                flowId = theFlowId
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -1039,7 +1107,7 @@ class FlowEntryObjectsStatefulIPv6 extends FlowEntryObjectsStateful {
                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
                     new NxMatchCtState(33, 33)
                 ]
-                priority = IdHelper.getId(flowId)
+                priority = IdHelper.getId(theFlowId)
                 tableId = 213 as short
             ]
          ]
@@ -1047,10 +1115,13 @@ class FlowEntryObjectsStatefulIPv6 extends FlowEntryObjectsStateful {
      }
 
     override icmpIngressFlowsPort3() {
+        val flowId1 = "ICMP_V6_DESTINATION_23_Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
+        val flowId2 = "ICMP_V6_DESTINATION_23_Ingress98785cc3048-abc3-43cc-89b3-377341426a22"
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "ICMP_V6_DESTINATION_23_Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
+                flowId = flowId1
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -1067,12 +1138,13 @@ class FlowEntryObjectsStatefulIPv6 extends FlowEntryObjectsStateful {
                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L),
                     new NxMatchCtState(33, 33)
                 ]
-                priority = IdHelper.getId(flowId)
+                priority = IdHelper.getId(flowId1)
                 tableId = 243 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "ICMP_V6_DESTINATION_23_Ingress98785cc3048-abc3-43cc-89b3-377341426a22"
+                flowId = flowId2
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -1089,17 +1161,20 @@ class FlowEntryObjectsStatefulIPv6 extends FlowEntryObjectsStateful {
                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L),
                     new NxMatchCtState(33, 33)
                 ]
-                priority = IdHelper.getId(flowId)
+                priority = IdHelper.getId(flowId2)
                 tableId = 243 as short
             ]
         ]
     }
 
     override icmpEgressFlowsPort3() {
+        val flowId1 = "ICMP_V6_DESTINATION_23_Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
+        val flowId2 = "ICMP_V6_DESTINATION_23_Egress98785cc3048-abc3-43cc-89b3-377341426a21"
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "ICMP_V6_DESTINATION_23_Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
+                flowId = flowId1
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -1116,12 +1191,13 @@ class FlowEntryObjectsStatefulIPv6 extends FlowEntryObjectsStateful {
                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
                     new NxMatchCtState(33, 33)
                 ]
-                priority = IdHelper.getId(flowId)
+                priority = IdHelper.getId(flowId1)
                 tableId = 213 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "ICMP_V6_DESTINATION_23_Egress98785cc3048-abc3-43cc-89b3-377341426a21"
+                flowId = flowId2
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -1138,7 +1214,7 @@ class FlowEntryObjectsStatefulIPv6 extends FlowEntryObjectsStateful {
                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
                     new NxMatchCtState(33, 33)
                 ]
-                priority = IdHelper.getId(flowId)
+                priority = IdHelper.getId(flowId2)
                 tableId = 213 as short
             ]
         ]
index bc8bbf42982edeffc85cdd05c6c5bad6de18e3d7..ceee307c326d4f6fc73d5b42ed45e2797511cf92 100644 (file)
@@ -7,10 +7,10 @@
  */
 package org.opendaylight.netvirt.aclservice.tests
 
-import org.opendaylight.genius.mdsalutil.FlowEntity
 import org.opendaylight.genius.mdsalutil.MetaDataUtil
 import org.opendaylight.genius.mdsalutil.actions.ActionNxConntrack
 import org.opendaylight.genius.mdsalutil.actions.ActionNxResubmit
+import org.opendaylight.genius.mdsalutil.FlowEntityBuilder
 import org.opendaylight.genius.mdsalutil.instructions.InstructionApplyActions
 import org.opendaylight.genius.mdsalutil.matches.MatchArpSha
 import org.opendaylight.genius.mdsalutil.matches.MatchEthernetType
@@ -29,6 +29,9 @@ import org.opendaylight.genius.mdsalutil.nxmatches.NxMatchTcpDestinationPort
 import org.opendaylight.genius.mdsalutil.nxmatches.NxMatchUdpDestinationPort
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg6
+import org.opendaylight.genius.mdsalutil.matches.MatchMetadata
+
+import static extension org.opendaylight.mdsal.binding.testutils.XtendBuilderExtensions.operator_doubleGreaterThan
 
 class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
 
@@ -90,7 +93,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
 
     protected def etherFlowIngressPort1() {
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
             cookie = 110100480bi
             flowId = "SYN_ETHERnullIngress98785cc3048-abc3-43cc-89b3-377341426ac7"
             flowName = "ACL_SYN_"
@@ -111,7 +115,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
  }
     protected def etherFlowEgressPort1() {
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "SYN_ETHERnullEgress98785cc3048-abc3-43cc-89b3-377341426ac6"
                 flowName = "ACL_SYN_"
@@ -132,7 +137,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
     }
     protected def etherIngressFlowsPort2() {
         #[
-               new FlowEntity(123bi) => [
+               new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "SYN_ETHERnullIngress98785cc3048-abc3-43cc-89b3-377341426ac7"
                 flowName = "ACL_SYN_"
@@ -149,7 +155,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                 priority = 61005
                 tableId = 241 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "SYN_ETHERnullIngress98785cc3048-abc3-43cc-89b3-377341426ac7"
                 flowName = "ACL_SYN_"
@@ -171,7 +178,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
 
     protected def etherEgressFlowsPort1() {
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "[SYN_ETHERnullIngress98785cc3048-abc3-43cc-89b3-377341426ac7"
         flowName = "ACL_SYN_"
@@ -193,7 +201,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
 
     protected def etheregressFlowPort2() {
         #[
-           new FlowEntity(123bi) => [
+           new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "SYN_ETHERnullEgress98785cc3048-abc3-43cc-89b3-377341426ac6"
                 flowName = "ACL_SYN_"
@@ -215,7 +224,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
 
     protected def tcpIngressFlowPort1() {
         #[
-                new FlowEntity(123bi) => [
+                new FlowEntityBuilder >> [
+                dpnId = 123bi
                     cookie = 110100480bi
                     flowId = "SYN_TCP_DESTINATION_80_65535Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
                     flowName = "ACL_SYN_"
@@ -240,7 +250,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
 
     protected def tcpIngressFlowPort2() {
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "SYN_TCP_DESTINATION_80_65535Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
                 flowName = "ACL_SYN_"
@@ -265,7 +276,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
 
     protected def tcpEgressFlowPort1() {
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "SYN_TCP_DESTINATION_80_65535Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
                 flowName = "ACL_SYN_"
@@ -290,7 +302,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
 
     protected def tcpEgressFlowPort2() {
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "SYN_TCP_DESTINATION_80_65535Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
                 flowName = "ACL_SYN_"
@@ -310,7 +323,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                 priority = 61005
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "SYN_TCP_DESTINATION_80_65535Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
                 flowName = "ACL_SYN_"
@@ -335,7 +349,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
 
     protected def udpEgressFlowsPort1() {
         #[
-             new FlowEntity(123bi) => [
+             new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "UDP_DESTINATION_80_65535Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
                 flowName = "ACL"
@@ -361,7 +376,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
 
     protected def udpIngressFlowsPort2() {
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "UDP_DESTINATION_80_65535_ipv4_remoteACL_interface_aap_AllowedAddressPairsKey "
                         +"[_macAddress=MacAddress [_value=0D:AA:D8:42:30:F3], _ipAddress=IpPrefixOrAddress "
@@ -387,7 +403,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                 priority = 61010
                 tableId = 243 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "UDP_DESTINATION_80_65535_ipv4_remoteACL_interface_aap_AllowedAddressPairsKey [_macAddress=MacAddress [_value=0D:AA:D8:42:30:F4], _ipAddress=IpPrefixOrAddress [_ipPrefix=IpPrefix [_ipv4Prefix=Ipv4Prefix [_value=10.0.0.2/24]]]]Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
                 flowName = "ACL"
@@ -415,7 +432,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
 
     protected def udpEgressFlowsPort2() {
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "UDP_DESTINATION_80_65535Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
                 flowName = "ACL"
@@ -441,7 +459,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
 
     protected def icmpIngressFlowsPort1() {
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "ICMP_V4_DESTINATION_23_Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
                 flowName = "ACL"
@@ -467,7 +486,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
 
     protected def icmpIngressFlowsPort2() {
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "ICMP_V4_DESTINATION_23_Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
                 flowName = "ACL"
@@ -493,7 +513,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
 
     protected def icmpEgressFlowsPort2() {
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "ICMP_V4_DESTINATION_23__ipv4_remoteACL_interface_aap_AllowedAddressPairsKey "
                         +"[_macAddress=MacAddress [_value=0D:AA:D8:42:30:F3], _ipAddress=IpPrefixOrAddress "
@@ -519,7 +540,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                 priority = 61010
                 tableId = 213 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "ICMP_V4_DESTINATION_23__ipv4_remoteACL_interface_aap_AllowedAddressPairsKey "
                         +"[_macAddress=MacAddress [_value=0D:AA:D8:42:30:F4], _ipAddress=IpPrefixOrAddress "
@@ -550,7 +572,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
 
     protected def udpIngressPortRangeFlows() {
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "UDP_DESTINATION_2000_65532Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
                 flowName = "ACL"
@@ -576,7 +599,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
 
     protected def tcpEgressRangeFlows() {
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "SYN_TCP_DESTINATION_776_65534Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
                 flowName = "ACL_SYN_"
@@ -596,7 +620,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                 priority = 61005
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "SYN_TCP_DESTINATION_512_65280Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
                 flowName = "ACL_SYN_"
@@ -616,7 +641,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                 priority = 61005
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "SYN_TCP_DESTINATION_334_65534Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
                 flowName = "ACL_SYN_"
@@ -636,7 +662,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                 priority = 61005
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "SYN_TCP_DESTINATION_333_65535Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
                 flowName = "ACL_SYN_"
@@ -656,7 +683,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                 priority = 61005
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "SYN_TCP_DESTINATION_336_65520Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
                 flowName = "ACL_SYN_"
@@ -676,7 +704,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                 priority = 61005
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "SYN_TCP_DESTINATION_352_65504Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
                 flowName = "ACL_SYN_"
@@ -696,7 +725,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                 priority = 61005
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "SYN_TCP_DESTINATION_384_65408Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
                 flowName = "ACL_SYN_"
@@ -716,7 +746,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                 priority = 61005
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "SYN_TCP_DESTINATION_768_65528Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
                 flowName = "ACL_SYN_"
@@ -740,10 +771,13 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
     }
 
    protected def icmpIngressFlowsPort3() {
+       val flowId1 = "ICMP_V4_DESTINATION_23_Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
+       val flowId2 = "ICMP_V4_DESTINATION_23_Ingress98785cc3048-abc3-43cc-89b3-377341426a22"
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "ICMP_V4_DESTINATION_23_Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
+                flowId = flowId1
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -759,12 +793,13 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L),
                     new NxMatchCtState(33L, 33L)
                 ]
-                priority = IdHelper.getId(flowId)
+                priority = IdHelper.getId(flowId1)
                 tableId = 243 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "ICMP_V4_DESTINATION_23_Ingress98785cc3048-abc3-43cc-89b3-377341426a22"
+                flowId = flowId2
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -780,17 +815,20 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L),
                     new NxMatchCtState(33L, 33L)
                 ]
-                priority = IdHelper.getId(flowId)
+                priority = IdHelper.getId(flowId2)
                 tableId = 243 as short
             ]
         ]
     }
 
     protected def icmpEgressFlowsPort3() {
+        val flowId1 = "ICMP_V4_DESTINATION_23_Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
+        val flowId2 = "ICMP_V4_DESTINATION_23_Egress98785cc3048-abc3-43cc-89b3-377341426a21"
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "ICMP_V4_DESTINATION_23_Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
+                flowId = flowId1
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -806,12 +844,13 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
                     new NxMatchCtState(33L, 33L)
                 ]
-                priority = IdHelper.getId(flowId)
+                priority = IdHelper.getId(flowId1)
                 tableId = 213 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "ICMP_V4_DESTINATION_23_Egress98785cc3048-abc3-43cc-89b3-377341426a21"
+                flowId = flowId2
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -827,7 +866,7 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
                     new NxMatchCtState(33L, 33L)
                 ]
-                priority = IdHelper.getId(flowId)
+                priority = IdHelper.getId(flowId2)
                 tableId = 213 as short
             ]
         ]
@@ -836,7 +875,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
     override def expectedFlows(String mac) {
         // Code auto. generated by https://github.com/vorburger/xtendbeans
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Ingress_DHCP_Server_v4123_987__Permit_"
                 flowName = "ACL"
@@ -855,7 +895,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 241 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Ingress_DHCP_Server_v6_123_987___Permit_"
                 flowName = "ACL"
@@ -874,7 +915,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 241 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Ingress_ICMPv6_123_987_130_Permit_"
                 flowName = "ACL"
@@ -892,7 +934,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 241 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Ingress_ICMPv6_123_987_135_Permit_"
                 flowName = "ACL"
@@ -910,7 +953,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 241 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Ingress_ICMPv6_123_987_136_Permit_"
                 flowName = "ACL"
@@ -928,7 +972,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 241 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Ingress_ARP_123_987"
                 flowName = "ACL"
@@ -944,7 +989,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 241 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_DHCP_Client_v4123_987__Permit_"
                 flowName = "ACL"
@@ -963,7 +1009,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_DHCP_Client_v6_123_987__Permit_"
                 flowName = "ACL"
@@ -982,7 +1029,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_DHCP_Server_v4123_987__Drop_"
                 flowName = "ACL"
@@ -998,7 +1046,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_DHCP_Server_v6_123_987__Drop_"
                 flowName = "ACL"
@@ -1014,7 +1063,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_ICMPv6_123_987_134_Drop_"
                 flowName = "ACL"
@@ -1029,7 +1079,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                 priority = 63020
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_ICMPv6_123_987_133_Permit_"
                 flowName = "ACL"
@@ -1047,7 +1098,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_ICMPv6_123_987_135_Permit_"
                 flowName = "ACL"
@@ -1065,7 +1117,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_ICMPv6_123_987_136_Permit_"
                 flowName = "ACL"
@@ -1083,7 +1136,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_ARP_123_987_" + mac
                 flowName = "ACL"
index 146f463c2aa3a4ba318c0722d63b2f04ec0c71a1..b31e3ff5ed68f86a3c08da404fc5fa0c52163b11 100644 (file)
@@ -12,11 +12,9 @@ import java.util.HashMap;
 import java.util.Map;
 
 /**
- * The Id Helper class.
- * <p>
- * Disabling checkstyle:linelength for readability purpose.
- * </p>
+ * Id Helper.
  */
+// Disabling checkstyle:linelength for readability purpose.
 @SuppressWarnings("checkstyle:linelength")
 public class IdHelper {
     private static Map<String, Integer> idCacheMap = new HashMap<>();
index 2e9bf03f4a018cff9efc75d9aa52a1198bd25081..20096f587dd25cae0361fe6604403284f582b88f 100644 (file)
@@ -40,6 +40,7 @@ import org.opendaylight.genius.interfacemanager.globals.InterfaceInfo;
 import org.opendaylight.genius.interfacemanager.interfaces.IInterfaceManager;
 import org.opendaylight.genius.itm.globals.ITMConstants;
 import org.opendaylight.genius.mdsalutil.FlowEntity;
+import org.opendaylight.genius.mdsalutil.FlowEntityBuilder;
 import org.opendaylight.genius.mdsalutil.InstructionInfo;
 import org.opendaylight.genius.mdsalutil.MDSALUtil;
 import org.opendaylight.genius.mdsalutil.MatchInfo;
@@ -1314,9 +1315,11 @@ public class ElanInterfaceManager extends AsyncDataTreeChangeListenerBase<ElanIn
         // exact order
 
         String flowId = getFlowRef(NwConstants.EXTERNAL_TUNNEL_TABLE, elanInfo.getElanTag());
-        FlowEntity flowEntity = new FlowEntity(dpnId);
-        flowEntity.setTableId(NwConstants.EXTERNAL_TUNNEL_TABLE);
-        flowEntity.setFlowId(flowId);
+        FlowEntity flowEntity = new FlowEntityBuilder()
+            .setDpnId(dpnId)
+            .setTableId(NwConstants.EXTERNAL_TUNNEL_TABLE)
+            .setFlowId(flowId)
+            .build();
         mdsalManager.removeFlow(flowEntity);
     }
 
index 6db22faf478ba64812da116133df8e2792380944..1e8fd629272d6cb7e5155d55626f5e23c2dbe305 100755 (executable)
@@ -43,6 +43,7 @@ import org.opendaylight.genius.interfacemanager.interfaces.IInterfaceManager;
 import org.opendaylight.genius.itm.globals.ITMConstants;
 import org.opendaylight.genius.mdsalutil.ActionInfo;
 import org.opendaylight.genius.mdsalutil.FlowEntity;
+import org.opendaylight.genius.mdsalutil.FlowEntityBuilder;
 import org.opendaylight.genius.mdsalutil.InstructionInfo;
 import org.opendaylight.genius.mdsalutil.MDSALUtil;
 import org.opendaylight.genius.mdsalutil.MDSALUtil.MdsalOp;
@@ -732,17 +733,21 @@ public class ElanUtils {
         mkInstructions.add(new InstructionGotoTable(NwConstants.ELAN_DMAC_TABLE));
         BigInteger dpId = interfaceInfo.getDpId();
         long elanTag = getElanTag(broker, elanInfo, interfaceInfo);
-        FlowEntity flowEntity = MDSALUtil.buildFlowEntity(dpId, NwConstants.ELAN_SMAC_TABLE,
-                getKnownDynamicmacFlowRef(NwConstants.ELAN_SMAC_TABLE, dpId, lportTag, macAddress, elanTag), 20,
-                elanInfo.getDescription(), (int) macTimeout, 0,
-                ElanConstants.COOKIE_ELAN_KNOWN_SMAC.add(BigInteger.valueOf(elanTag)), mkMatches, mkInstructions);
-        flowEntity.setStrictFlag(true);
-        flowEntity.setSendFlowRemFlag(macTimeout != 0); // If Mac timeout is 0,
-                                                        // the flow wont be
-                                                        // deleted
-                                                        // automatically, so no
-                                                        // need to get notified
-        return flowEntity;
+        return new FlowEntityBuilder()
+            .setDpnId(dpId)
+            .setTableId(NwConstants.ELAN_SMAC_TABLE)
+            .setFlowId(getKnownDynamicmacFlowRef(NwConstants.ELAN_SMAC_TABLE, dpId, lportTag, macAddress, elanTag))
+            .setPriority(20)
+            .setFlowName(elanInfo.getDescription())
+            .setIdleTimeOut((int) macTimeout)
+            .setHardTimeOut(0)
+            .setCookie(ElanConstants.COOKIE_ELAN_KNOWN_SMAC.add(BigInteger.valueOf(elanTag)))
+            .setMatchInfoList(mkMatches)
+            .setInstructionInfoList(mkInstructions)
+            .setStrictFlag(true)
+            // If Mac timeout is 0, the flow won't be deleted automatically, so no need to get notified
+            .setSendFlowRemFlag(macTimeout != 0)
+            .build();
     }
 
     private static Long getElanTag(DataBroker broker, ElanInstance elanInfo, InterfaceInfo interfaceInfo) {
@@ -1921,9 +1926,9 @@ public class ElanUtils {
             List<ElanSegments> elanSegments = elanInstance.getElanSegments();
             if (elanSegments != null) {
                 for (ElanSegments segment : elanSegments) {
-                    if (segment != null && (segment.getSegmentType().isAssignableFrom(SegmentTypeVxlan.class)
+                    if (segment != null && segment.getSegmentType().isAssignableFrom(SegmentTypeVxlan.class)
                             && segment.getSegmentationId() != null
-                            && segment.getSegmentationId().longValue() != 0)) {
+                            && segment.getSegmentationId().longValue() != 0) {
                         return true;
                     }
                 }
@@ -2147,7 +2152,7 @@ public class ElanUtils {
     }
 
     public static boolean isNotEmpty(Collection collection) {
-        return (!isEmpty(collection));
+        return !isEmpty(collection);
     }
 
     public static void setElanInstancToDpnsCache(Map<String, Set<DpnInterfaces>> elanInstancToDpnsCache) {
@@ -2163,7 +2168,7 @@ public class ElanUtils {
     }
 
     public static void removeDPNInterfaceFromElanInCache(String elanName, DpnInterfaces dpnInterfaces) {
-        elanInstancToDpnsCache.computeIfAbsent(elanName, key -> new HashSet<DpnInterfaces>()).remove(dpnInterfaces);
+        elanInstancToDpnsCache.computeIfAbsent(elanName, key -> new HashSet<>()).remove(dpnInterfaces);
     }
 
     public Optional<IpAddress> getSourceIpAddress(Ethernet ethernet) {
index 2186ef109304df8d78b9b7300401d236457410a5..2c0d41013634d6c794ae2558e15911fa4616b507 100644 (file)
@@ -24,6 +24,7 @@ import org.opendaylight.genius.interfacemanager.globals.InterfaceInfo;
 import org.opendaylight.genius.interfacemanager.interfaces.IInterfaceManager;
 import org.opendaylight.genius.mdsalutil.ActionInfo;
 import org.opendaylight.genius.mdsalutil.FlowEntity;
+import org.opendaylight.genius.mdsalutil.FlowEntityBuilder;
 import org.opendaylight.genius.mdsalutil.InstructionInfo;
 import org.opendaylight.genius.mdsalutil.MDSALUtil;
 import org.opendaylight.genius.mdsalutil.MatchInfo;
@@ -85,7 +86,7 @@ public class NaptEventHandler {
     private final NaptManager naptManager;
     private final IElanService elanManager;
     private final IdManagerService idManager;
-    private IInterfaceManager interfaceManager;
+    private final IInterfaceManager interfaceManager;
 
     @Inject
     public NaptEventHandler(final DataBroker dataBroker, final IMdsalApiManager mdsalManager,
@@ -248,7 +249,7 @@ public class NaptEventHandler {
                 List<ActionInfo> actionInfos = new ArrayList<>();
                 if (ethPkt.getPayload() instanceof IPv4) {
                     IPv4 ipPkt = (IPv4) ethPkt.getPayload();
-                    if ((ipPkt.getPayload() instanceof TCP) || (ipPkt.getPayload() instanceof UDP)) {
+                    if (ipPkt.getPayload() instanceof TCP || ipPkt.getPayload() instanceof UDP) {
                         if (ethPkt.getEtherType() != (short) NwConstants.ETHTYPE_802_1Q) {
                             // VLAN Access port
                             if (infInfo != null) {
@@ -317,13 +318,21 @@ public class NaptEventHandler {
         int actualPort = actualSourceAddress.getPortNumber();
         String switchFlowRef =
             NatUtil.getNaptFlowRef(dpnId, tableId, String.valueOf(routerId), actualIp, actualPort);
-        FlowEntity snatFlowEntity = MDSALUtil.buildFlowEntity(dpnId, tableId, switchFlowRef,
-                NatConstants.DEFAULT_NAPT_FLOW_PRIORITY, NatConstants.NAPT_FLOW_NAME, idleTimeout, 0,
-                NatUtil.getCookieNaptFlow(routerId),
-                buildAndGetMatchInfo(actualIp, actualPort, tableId, protocol, intranetVpnId),
-                buildAndGetSetActionInstructionInfo(translatedIp, translatedPort, intranetVpnId, vpnId, tableId,
-                        protocol, extGwMacAddress));
-        snatFlowEntity.setSendFlowRemFlag(true);
+
+        FlowEntity snatFlowEntity = new FlowEntityBuilder()
+            .setDpnId(dpnId)
+            .setTableId(tableId)
+            .setFlowId(switchFlowRef)
+            .setPriority(NatConstants.DEFAULT_NAPT_FLOW_PRIORITY)
+            .setFlowName(NatConstants.NAPT_FLOW_NAME)
+            .setIdleTimeOut(idleTimeout)
+            .setHardTimeOut(0)
+            .setCookie(NatUtil.getCookieNaptFlow(routerId))
+            .setMatchInfoList(buildAndGetMatchInfo(actualIp, actualPort, tableId, protocol, intranetVpnId))
+            .setInstructionInfoList(buildAndGetSetActionInstructionInfo(translatedIp, translatedPort,
+                                            intranetVpnId, vpnId, tableId, protocol, extGwMacAddress))
+            .setSendFlowRemFlag(true)
+            .build();
 
         LOG.debug("NAT Service : Installing the NAPT flow in the table {} for the switch with the DPN ID {} ",
             tableId, dpnId);
@@ -457,7 +466,7 @@ public class NaptEventHandler {
         if (etherPkt.getPayload() instanceof IPv4) {
             byte[] rawPkt;
             IPv4 ipPkt = (IPv4) etherPkt.getPayload();
-            if ((ipPkt.getPayload() instanceof TCP) || (ipPkt.getPayload() instanceof UDP)) {
+            if (ipPkt.getPayload() instanceof TCP || ipPkt.getPayload() instanceof UDP) {
                 try {
                     rawPkt = etherPkt.serialize();
                     return rawPkt;
index a60d17a00dfa6f7c33e53acfc005a607a3dd6097..81b757d207ab161fefd29d1658f560a456417781 100644 (file)
@@ -33,6 +33,7 @@ import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFaile
 import org.opendaylight.genius.datastoreutils.SingleTransactionDataBroker;
 import org.opendaylight.genius.mdsalutil.ActionInfo;
 import org.opendaylight.genius.mdsalutil.FlowEntity;
+import org.opendaylight.genius.mdsalutil.FlowEntityBuilder;
 import org.opendaylight.genius.mdsalutil.InstructionInfo;
 import org.opendaylight.genius.mdsalutil.MDSALUtil;
 import org.opendaylight.genius.mdsalutil.MatchInfo;
@@ -380,7 +381,7 @@ public class NatUtil {
     public static ProviderTypes getProviderTypefromNetworkId(DataBroker broker, Uuid networkId) {
         InstanceIdentifier<Networks> id = buildNetworkIdentifier(networkId);
         Optional<Networks> networkData = read(broker, LogicalDatastoreType.CONFIGURATION, id);
-        if ((networkData.isPresent()) && (networkData.get() != null)) {
+        if (networkData.isPresent() && networkData.get() != null) {
             return networkData.get().getProviderNetworkType();
         }
         return null;
@@ -479,45 +480,26 @@ public class NatUtil {
         return vpnId;
     }
 
-    public static FlowEntity buildFlowEntity(BigInteger dpnId, short tableId, BigInteger cookie) {
-        FlowEntity flowEntity = new FlowEntity(dpnId);
-        flowEntity.setTableId(tableId);
-        flowEntity.setCookie(cookie);
-        return flowEntity;
-    }
-
-    public static FlowEntity buildFlowEntity(BigInteger dpnId, short tableId, String flowId,
-                                             int priority, String flowName,
-                                             BigInteger cookie, List<MatchInfo> listMatchInfo) {
-
-        FlowEntity flowEntity = new FlowEntity(dpnId);
-        flowEntity.setTableId(tableId);
-        flowEntity.setFlowId(flowId);
-        flowEntity.setPriority(priority);
-        flowEntity.setFlowName(flowName);
-        flowEntity.setCookie(cookie);
-        flowEntity.setMatchInfoList(listMatchInfo);
-        return flowEntity;
-    }
-
     public static FlowEntity buildFlowEntity(BigInteger dpnId, short tableId, BigInteger cookie, String flowId) {
-        FlowEntity flowEntity = new FlowEntity(dpnId);
-        flowEntity.setTableId(tableId);
-        flowEntity.setCookie(cookie);
-        flowEntity.setFlowId(flowId);
-        return flowEntity;
+        return new FlowEntityBuilder()
+                .setDpnId(dpnId)
+                .setTableId(tableId)
+                .setCookie(cookie)
+                .setFlowId(flowId)
+                .build();
     }
 
     public static FlowEntity buildFlowEntity(BigInteger dpnId, short tableId, String flowId) {
-        FlowEntity flowEntity = new FlowEntity(dpnId);
-        flowEntity.setTableId(tableId);
-        flowEntity.setFlowId(flowId);
-        return flowEntity;
+        return new FlowEntityBuilder()
+                .setDpnId(dpnId)
+                .setTableId(tableId)
+                .setFlowId(flowId)
+                .build();
     }
 
     public static long getIpAddress(byte[] rawIpAddress) {
-        return (((rawIpAddress[0] & 0xFF) << (3 * 8)) + ((rawIpAddress[1] & 0xFF) << (2 * 8))
-            + ((rawIpAddress[2] & 0xFF) << (1 * 8)) + (rawIpAddress[3] & 0xFF)) & 0xffffffffL;
+        return ((rawIpAddress[0] & 0xFF) << 3 * 8) + ((rawIpAddress[1] & 0xFF) << 2 * 8)
+            + ((rawIpAddress[2] & 0xFF) << 1 * 8) + (rawIpAddress[3] & 0xFF) & 0xffffffffL;
     }
 
     public static String getEndpointIpAddressForDPN(DataBroker broker, BigInteger dpnId) {
@@ -687,7 +669,7 @@ public class NatUtil {
             fibManager.addOrUpdateFibEntry(broker, rd, macAddress, prefix,
                     Collections.singletonList(nextHopIp), VrfEntry.EncapType.Mplsgre, (int)label, l3vni /*l3vni*/,
                     null /*gatewayMacAddress*/, parentVpnRd, origin, null /*writeTxn*/);
-            if ((rd != null) && (!rd.equalsIgnoreCase(vpnName))) {
+            if (rd != null && !rd.equalsIgnoreCase(vpnName)) {
             /* Publish to Bgp only if its an INTERNET VPN */
                 bgpManager.advertisePrefix(rd, null /*macAddress*/, prefix, Collections.singletonList(nextHopIp),
                         VrfEntry.EncapType.Mplsgre, (int) label, 0 /*l3vni*/, 0 /*l2vni*/, null /*gatewayMac*/);
@@ -1654,7 +1636,7 @@ public class NatUtil {
             long ipLo = ipToLong(InetAddress.getByName(start));
             long ipHi = ipToLong(InetAddress.getByName(end));
             long ipToTest = ipToLong(InetAddress.getByName(ipAddress));
-            return (ipToTest >= ipLo && ipToTest <= ipHi);
+            return ipToTest >= ipLo && ipToTest <= ipHi;
         } catch (UnknownHostException e) {
             LOG.error("NAT Service : isIpInSubnet failed for IP {}. Exception {}", ipAddress, e.getMessage());
             return false;
@@ -1668,7 +1650,7 @@ public class NatUtil {
 
         Set<Uuid> subnetsSet = externalIps.stream().map(externalIp -> externalIp.getSubnetId())
                 .collect(Collectors.toSet());
-        return new ArrayList<Uuid>(subnetsSet);
+        return new ArrayList<>(subnetsSet);
     }
 
     public static List<Uuid> getExternalSubnetIdsForRouter(DataBroker dataBroker, String routerName) {
@@ -1727,7 +1709,7 @@ public class NatUtil {
             Routers router) {
         List<ExternalIps> externalIps = router.getExternalIps();
         for (ExternalIps extIp : externalIps) {
-            String extIpString = extIp.getIpAddress().contains("/32") ? (extIp.getIpAddress() + "/32") :
+            String extIpString = extIp.getIpAddress().contains("/32") ? extIp.getIpAddress() + "/32" :
                 extIp.getIpAddress();
             if (extIpString.equals(externalIpAddress)) {
                 return extIp.getSubnetId();
diff --git a/vpnservice/natservice/natservice-impl/src/test/java/org/opendaylight/netvirt/natservice/internal/test/NatUtilTest.java b/vpnservice/natservice/natservice-impl/src/test/java/org/opendaylight/netvirt/natservice/internal/test/NatUtilTest.java
new file mode 100644 (file)
index 0000000..e99e76f
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2017 Red Hat, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.netvirt.natservice.internal.test;
+
+import java.math.BigInteger;
+import org.junit.Test;
+import org.opendaylight.genius.mdsalutil.FlowEntityBuilder;
+import org.opendaylight.netvirt.natservice.internal.NatUtil;
+
+public class NatUtilTest {
+
+    @Test
+    public void testFlowEntityBuilder() {
+        new FlowEntityBuilder()
+                .setDpnId(new BigInteger("123"))
+                .setTableId((short) 0)
+                .setFlowId("ID")
+                .build();
+    }
+
+    @Test
+    public void testBuildFlowEntity1() {
+        NatUtil.buildFlowEntity(new BigInteger("123"), (short) 0, "ID");
+    }
+
+    @Test
+    public void testBuildFlowEntity2() {
+        NatUtil.buildFlowEntity(new BigInteger("123"), (short) 0, new BigInteger("789"), "ID");
+    }
+
+}
index 645d2c8992d8f917ad8e256eceaf11af61d626e0..f79b0b9cd83c078ec09aef54d68ec3f158e2eff6 100755 (executable)
@@ -33,6 +33,7 @@ import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
 import org.opendaylight.genius.datastoreutils.DataStoreJobCoordinator;
 import org.opendaylight.genius.mdsalutil.FlowEntity;
+import org.opendaylight.genius.mdsalutil.FlowEntityBuilder;
 import org.opendaylight.genius.mdsalutil.InstructionInfo;
 import org.opendaylight.genius.mdsalutil.MDSALUtil;
 import org.opendaylight.genius.mdsalutil.MatchInfo;
@@ -198,7 +199,7 @@ public class VpnUtil {
     static VpnInterface getVpnInterface(DataBroker broker, String vpnInterfaceName) {
         InstanceIdentifier<VpnInterface> id = getVpnInterfaceIdentifier(vpnInterfaceName);
         Optional<VpnInterface> vpnInterface = read(broker, LogicalDatastoreType.CONFIGURATION, id);
-        return (vpnInterface.isPresent()) ? vpnInterface.get() : null;
+        return vpnInterface.isPresent() ? vpnInterface.get() : null;
     }
 
     static VpnInterface getVpnInterface(String intfName, String vpnName, Adjacencies aug, BigInteger dpnId,
@@ -288,7 +289,7 @@ public class VpnUtil {
      */
     public static List<VrfEntry> getAllVrfEntries(DataBroker broker, String rd) {
         VrfTables vrfTables = VpnUtil.getVrfTable(broker, rd);
-        return (vrfTables != null) ? vrfTables.getVrfEntry() : new ArrayList<>();
+        return vrfTables != null ? vrfTables.getVrfEntry() : new ArrayList<>();
     }
 
     //FIXME: Implement caches for DS reads
@@ -296,7 +297,7 @@ public class VpnUtil {
         InstanceIdentifier<VpnInstance> id = InstanceIdentifier.builder(VpnInstances.class).child(VpnInstance.class,
             new VpnInstanceKey(vpnInstanceName)).build();
         Optional<VpnInstance> vpnInstance = read(broker, LogicalDatastoreType.CONFIGURATION, id);
-        return (vpnInstance.isPresent()) ? vpnInstance.get() : null;
+        return vpnInstance.isPresent() ? vpnInstance.get() : null;
     }
 
     static List<VpnInstance> getAllVpnInstances(DataBroker broker) {
@@ -477,7 +478,7 @@ public class VpnUtil {
      */
     public static String getVpnNameFromRd(DataBroker broker, String rd) {
         VpnInstanceOpDataEntry vpnInstanceOpData = getVpnInstanceOpData(broker, rd);
-        return (vpnInstanceOpData != null) ? vpnInstanceOpData.getVpnInstanceName() : null;
+        return vpnInstanceOpData != null ? vpnInstanceOpData.getVpnInstanceName() : null;
     }
 
     /**
@@ -754,7 +755,7 @@ public class VpnUtil {
 
         if (optConfiguredVpnInterface.isPresent()) {
             String configuredVpnName = optConfiguredVpnInterface.get().getVpnInstanceName();
-            if ((configuredVpnName != null) && (configuredVpnName.equalsIgnoreCase(vpnName))) {
+            if (configuredVpnName != null && configuredVpnName.equalsIgnoreCase(vpnName)) {
                 return true;
             }
         }
@@ -870,7 +871,7 @@ public class VpnUtil {
     }
 
     public static long getRemoteBCGroup(long elanTag) {
-        return VpnConstants.ELAN_GID_MIN + ((elanTag % VpnConstants.ELAN_GID_MIN) * 2);
+        return VpnConstants.ELAN_GID_MIN + elanTag % VpnConstants.ELAN_GID_MIN * 2;
     }
 
     // interface-index-tag operational container
@@ -1120,7 +1121,7 @@ public class VpnUtil {
         InstanceIdentifier id = buildVpnPortipToPortIdentifier(vpnName, fixedIp);
         Optional<VpnPortipToPort> vpnPortipToPortData = read(broker, LogicalDatastoreType.CONFIGURATION, id);
         if (vpnPortipToPortData.isPresent()) {
-            return (vpnPortipToPortData.get());
+            return vpnPortipToPortData.get();
         }
         return null;
     }
@@ -1129,7 +1130,7 @@ public class VpnUtil {
         InstanceIdentifier id = buildLearntVpnVipToPortIdentifier(vpnName, fixedIp);
         Optional<LearntVpnVipToPort> learntVpnVipToPort = read(broker, LogicalDatastoreType.OPERATIONAL, id);
         if (learntVpnVipToPort.isPresent()) {
-            return (learntVpnVipToPort.get());
+            return learntVpnVipToPort.get();
         }
         return null;
     }
@@ -1286,7 +1287,7 @@ public class VpnUtil {
         Future<RpcResult<Void>> result = lockManager.tryLock(input);
         String errMsg = "Unable to getLock for subnet " + subnetId;
         try {
-            if ((result != null) && (result.get().isSuccessful())) {
+            if (result != null && result.get().isSuccessful()) {
                 LOG.debug("Acquired lock for {}", subnetId);
             } else {
                 throw new RuntimeException(errMsg);
@@ -1301,7 +1302,7 @@ public class VpnUtil {
         UnlockInput input = new UnlockInputBuilder().setLockName(subnetId).build();
         Future<RpcResult<Void>> result = lockManager.unlock(input);
         try {
-            if ((result != null) && (result.get().isSuccessful())) {
+            if (result != null && result.get().isSuccessful()) {
                 LOG.debug("Unlocked {}", subnetId);
             } else {
                 LOG.debug("Unable to unlock subnet {}", subnetId);
@@ -1470,7 +1471,7 @@ public class VpnUtil {
     }
 
     static InstanceIdentifier<Subnetmap> buildSubnetmapIdentifier(Uuid subnetId) {
-        return (InstanceIdentifier<Subnetmap>) InstanceIdentifier.builder(Subnetmaps.class)
+        return InstanceIdentifier.builder(Subnetmaps.class)
         .child(Subnetmap.class, new SubnetmapKey(subnetId)).build();
 
     }
@@ -1481,11 +1482,11 @@ public class VpnUtil {
     }
 
     static boolean isL3VpnOverVxLan(Long l3Vni) {
-        return (l3Vni != null && l3Vni != 0);
+        return l3Vni != null && l3Vni != 0;
     }
 
     static boolean isEvpnOverVxLan(Long l2Vni) { //To be used by RT2
-        return (l2Vni != null && l2Vni != 0);
+        return l2Vni != null && l2Vni != 0;
     }
 
     /**
@@ -1537,7 +1538,7 @@ public class VpnUtil {
                 .map(usedRd -> {
                     Optional<Routes> vpnExtraRoutes = VpnExtraRouteHelper.getVpnExtraroutes(dataBroker,
                             vpnName, usedRd, prefix);
-                    return vpnExtraRoutes.isPresent() ? new ImmutablePair<String, String>(
+                    return vpnExtraRoutes.isPresent() ? new ImmutablePair<>(
                             vpnExtraRoutes.get().getNexthopIpList().get(0),
                             usedRd) : new ImmutablePair<>("", "");
                 })
@@ -1670,10 +1671,11 @@ public class VpnUtil {
     }
 
     static FlowEntity buildFlowEntity(BigInteger dpnId, short tableId, String flowId) {
-        FlowEntity flowEntity = new FlowEntity(dpnId);
-        flowEntity.setTableId(tableId);
-        flowEntity.setFlowId(flowId);
-        return flowEntity;
+        return new FlowEntityBuilder()
+            .setDpnId(dpnId)
+            .setTableId(tableId)
+            .setFlowId(flowId)
+            .build();
     }
 
     static VrfEntryBase.EncapType getEncapType(boolean isVxLan) {