Remove deprecated FlowRuleExtPayLoad API

Change-Id: Id20e1e296670f8cc94b23c3fd2272a1c2de3990e
diff --git a/apps/flowanalyzer/src/test/java/org/onosproject/flowanalyzer/FlowAnalyzerTest.java b/apps/flowanalyzer/src/test/java/org/onosproject/flowanalyzer/FlowAnalyzerTest.java
index 0d725e9..804a27c 100644
--- a/apps/flowanalyzer/src/test/java/org/onosproject/flowanalyzer/FlowAnalyzerTest.java
+++ b/apps/flowanalyzer/src/test/java/org/onosproject/flowanalyzer/FlowAnalyzerTest.java
@@ -25,7 +25,6 @@
 import org.onosproject.net.flow.DefaultTrafficSelector;
 import org.onosproject.net.flow.DefaultTrafficTreatment;
 import org.onosproject.net.flow.FlowRule;
-import org.onosproject.net.flow.FlowRuleExtPayLoad;
 import org.onosproject.net.flow.FlowRuleService;
 import org.onosproject.net.flow.TrafficSelector;
 import org.onosproject.net.flow.TrafficTreatment;
@@ -105,16 +104,30 @@
         TrafficSelector ts = DefaultTrafficSelector.builder().matchInPort(PortNumber.portNumber(inPort)).build();
         TrafficTreatment tt = DefaultTrafficTreatment.builder()
                 .add(Instructions.createOutput(PortNumber.portNumber(outPort))).build();
-        return new DefaultFlowRule(device, ts, tt, 1, new DefaultApplicationId(5000, "of"),
-                                   50000, true, FlowRuleExtPayLoad.flowRuleExtPayLoad(new byte[5]));
+        return DefaultFlowRule.builder()
+            .forDevice(device)
+            .withSelector(ts)
+            .withTreatment(tt)
+            .withPriority(1)
+            .fromApp(new DefaultApplicationId(5000, "of"))
+            .withHardTimeout(50000)
+            .makePermanent()
+            .build();
     }
     public FlowRule genFlow(String d, long outPort) {
         DeviceId device = DeviceId.deviceId(d);
         TrafficSelector ts = DefaultTrafficSelector.builder().build();
         TrafficTreatment tt = DefaultTrafficTreatment.builder()
                 .add(Instructions.createOutput(PortNumber.portNumber(outPort))).build();
-        return new DefaultFlowRule(device, ts, tt, 1, new DefaultApplicationId(5000, "of"),
-                                   50000, true, FlowRuleExtPayLoad.flowRuleExtPayLoad(new byte[5]));
+        return DefaultFlowRule.builder()
+            .forDevice(device)
+            .withSelector(ts)
+            .withTreatment(tt)
+            .withPriority(1)
+            .fromApp(new DefaultApplicationId(5000, "of"))
+            .withHardTimeout(50000)
+            .makePermanent()
+            .build();
     }
 
 }
diff --git a/apps/test/flow-perf/src/main/java/org/onosproject/flowperf/FlowPerfApp.java b/apps/test/flow-perf/src/main/java/org/onosproject/flowperf/FlowPerfApp.java
index 9a6e3a7..61c4b42 100644
--- a/apps/test/flow-perf/src/main/java/org/onosproject/flowperf/FlowPerfApp.java
+++ b/apps/test/flow-perf/src/main/java/org/onosproject/flowperf/FlowPerfApp.java
@@ -211,14 +211,16 @@
                     .build();
             TrafficTreatment treatment = DefaultTrafficTreatment.builder()
                     .add(Instructions.createOutput(PortNumber.portNumber(3))).build();
-            FlowRule rule = new DefaultFlowRule(device.id(),
-                    selector,
-                    treatment,
-                    100,
-                    appId,
-                    50000,
-                    true,
-                    null);
+            FlowRule rule = DefaultFlowRule.builder()
+                .forDevice(device.id())
+                .withSelector(selector)
+                .withTreatment(treatment)
+                .withPriority(100)
+                .fromApp(appId)
+                .withHardTimeout(50000)
+                .makePermanent()
+                .build();
+
             rules.add(rule);
         }
         return rules;
diff --git a/apps/virtual/app/src/main/java/org/onosproject/incubator/net/virtual/cli/VirtualFlowsListCommand.java b/apps/virtual/app/src/main/java/org/onosproject/incubator/net/virtual/cli/VirtualFlowsListCommand.java
index 05da804..e434a39 100644
--- a/apps/virtual/app/src/main/java/org/onosproject/incubator/net/virtual/cli/VirtualFlowsListCommand.java
+++ b/apps/virtual/app/src/main/java/org/onosproject/incubator/net/virtual/cli/VirtualFlowsListCommand.java
@@ -42,7 +42,6 @@
 import org.onosproject.utils.Comparators;
 
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
 import java.util.Map;
@@ -68,7 +67,7 @@
 
     private static final String LONG_FORMAT = "    id=%s, state=%s, bytes=%s, "
             + "packets=%s, duration=%s, liveType=%s, priority=%s, tableId=%s, appId=%s, "
-            + "payLoad=%s, selector=%s, treatment=%s";
+            + "selector=%s, treatment=%s";
 
     private static final String SHORT_FORMAT = "    %s, bytes=%s, packets=%s, "
             + "table=%s, priority=%s, selector=%s, treatment=%s";
@@ -247,7 +246,6 @@
                 print(LONG_FORMAT, Long.toHexString(f.id().value()), f.state(),
                         f.bytes(), f.packets(), f.life(), f.liveType(), f.priority(), f.tableId(),
                         appId != null ? appId.name() : "<none>",
-                        f.payLoad() == null ? null : Arrays.toString(f.payLoad().payLoad()),
                         f.selector().criteria(), f.treatment());
             }
         }
diff --git a/cli/src/main/java/org/onosproject/cli/net/FlowsListCommand.java b/cli/src/main/java/org/onosproject/cli/net/FlowsListCommand.java
index f7adc0a..098c9f0 100644
--- a/cli/src/main/java/org/onosproject/cli/net/FlowsListCommand.java
+++ b/cli/src/main/java/org/onosproject/cli/net/FlowsListCommand.java
@@ -42,7 +42,6 @@
 import java.io.IOException;
 import java.io.InputStreamReader;
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
 import java.util.Map;
@@ -68,7 +67,7 @@
 
     private static final String LONG_FORMAT = "    id=%s, state=%s, bytes=%s, "
             + "packets=%s, duration=%s, liveType=%s, priority=%s, tableId=%s, appId=%s, "
-            + "payLoad=%s, selector=%s, treatment=%s";
+            + "selector=%s, treatment=%s";
 
     private static final String SHORT_FORMAT = "    %s, bytes=%s, packets=%s, "
             + "table=%s, priority=%s, selector=%s, treatment=%s";
@@ -327,7 +326,6 @@
                 print(LONG_FORMAT, Long.toHexString(f.id().value()), f.state(),
                         f.bytes(), f.packets(), f.life(), f.liveType(), f.priority(), f.table(),
                         appId != null ? appId.name() : "<none>",
-                        f.payLoad() == null ? null : Arrays.toString(f.payLoad().payLoad()),
                         f.selector().criteria(), f.treatment());
             }
         }
diff --git a/core/api/src/main/java/org/onosproject/net/flow/DefaultFlowRule.java b/core/api/src/main/java/org/onosproject/net/flow/DefaultFlowRule.java
index ed0a3ab..273c3d1 100644
--- a/core/api/src/main/java/org/onosproject/net/flow/DefaultFlowRule.java
+++ b/core/api/src/main/java/org/onosproject/net/flow/DefaultFlowRule.java
@@ -52,7 +52,6 @@
     private final GroupId groupId;
 
     private final TableId tableId;
-    private final FlowRuleExtPayLoad payLoad;
 
     /**
      * Creates a new flow rule from an existing rule.
@@ -73,7 +72,6 @@
         this.permanent = rule.isPermanent();
         this.created = System.currentTimeMillis();
         this.tableId = rule.table();
-        this.payLoad = rule.payLoad();
     }
 
     private DefaultFlowRule(DeviceId deviceId, TrafficSelector selector,
@@ -97,154 +95,6 @@
 
         //FIXME: fields below will be removed.
         this.groupId = new GroupId(0);
-        this.payLoad = null;
-    }
-
-    /**
-     * Support for the third party flow rule. Creates a flow rule of flow table.
-     *
-     * @param deviceId the identity of the device where this rule applies
-     * @param selector the traffic selector that identifies what traffic this
-     *            rule
-     * @param treatment the traffic treatment that applies to selected traffic
-     * @param priority the flow rule priority given in natural order
-     * @param appId the application id of this flow
-     * @param timeout the timeout for this flow requested by an application
-     * @param permanent whether the flow is permanent i.e. does not time out
-     * @param payLoad 3rd-party origin private flow
-     * @deprecated in Junco release. Use FlowRule.Builder instead.
-     */
-    @Deprecated
-    public DefaultFlowRule(DeviceId deviceId, TrafficSelector selector,
-                           TrafficTreatment treatment, int priority,
-                           ApplicationId appId, int timeout, boolean permanent,
-                           FlowRuleExtPayLoad payLoad) {
-        this(deviceId, selector, treatment, priority, appId, timeout, 0, permanent, payLoad);
-    }
-
-
-    /**
-     * Support for the third party flow rule. Creates a flow rule of flow table.
-     *
-     * @param deviceId the identity of the device where this rule applies
-     * @param selector the traffic selector that identifies what traffic this
-     *            rule
-     * @param treatment the traffic treatment that applies to selected traffic
-     * @param priority the flow rule priority given in natural order
-     * @param appId the application id of this flow
-     * @param timeout the timeout for this flow requested by an application
-     * @param hardTimeout the hard timeout located switch's flow table for this flow requested by an application
-     * @param permanent whether the flow is permanent i.e. does not time out
-     * @param payLoad 3rd-party origin private flow
-     * @deprecated in Junco release. Use FlowRule.Builder instead.
-     */
-    @Deprecated
-    public DefaultFlowRule(DeviceId deviceId, TrafficSelector selector,
-                           TrafficTreatment treatment, int priority,
-                           ApplicationId appId, int timeout, int hardTimeout, boolean permanent,
-                           FlowRuleExtPayLoad payLoad) {
-
-        checkArgument(priority >= MIN_PRIORITY, "Priority cannot be less than " +
-                MIN_PRIORITY);
-        checkArgument(priority <= MAX_PRIORITY, "Priority cannot be greater than " +
-                MAX_PRIORITY);
-
-        this.deviceId = deviceId;
-        this.priority = priority;
-        this.selector = selector;
-        this.treatment = treatment;
-        this.appId = appId.id();
-        this.groupId = new GroupId(0);
-        this.timeout = timeout;
-        this.reason = FlowRemoveReason.NO_REASON;
-        this.hardTimeout = hardTimeout;
-        this.permanent = permanent;
-        this.tableId = DEFAULT_TABLE;
-        this.created = System.currentTimeMillis();
-        this.payLoad = payLoad;
-
-        /*
-         * id consists of the following. | appId (16 bits) | groupId (16 bits) |
-         * flowId (32 bits) |
-         */
-        this.id = FlowId.valueOf((((long) this.appId) << 48)
-                | (((long) this.groupId.id()) << 32)
-                | (this.hash() & 0xffffffffL));
-    }
-
-    /**
-     * Support for the third party flow rule. Creates a flow rule of group
-     * table.
-     *
-     * @param deviceId the identity of the device where this rule applies
-     * @param selector the traffic selector that identifies what traffic this
-     *            rule
-     * @param treatment the traffic treatment that applies to selected traffic
-     * @param priority the flow rule priority given in natural order
-     * @param appId the application id of this flow
-     * @param groupId the group id of this flow
-     * @param timeout the timeout for this flow requested by an application
-     * @param permanent whether the flow is permanent i.e. does not time out
-     * @param payLoad 3rd-party origin private flow
-     * @deprecated in Junco release. Use FlowRule.Builder instead.
-     */
-    @Deprecated
-    public DefaultFlowRule(DeviceId deviceId, TrafficSelector selector,
-                           TrafficTreatment treatment, int priority,
-                           ApplicationId appId, GroupId groupId, int timeout,
-                           boolean permanent, FlowRuleExtPayLoad payLoad) {
-        this(deviceId, selector, treatment, priority, appId, groupId, timeout, 0, permanent, payLoad);
-    }
-
-    /**
-     * Support for the third party flow rule. Creates a flow rule of group
-     * table.
-     *
-     * @param deviceId the identity of the device where this rule applies
-     * @param selector the traffic selector that identifies what traffic this
-     *            rule
-     * @param treatment the traffic treatment that applies to selected traffic
-     * @param priority the flow rule priority given in natural order
-     * @param appId the application id of this flow
-     * @param groupId the group id of this flow
-     * @param timeout the timeout for this flow requested by an application
-     * @param hardTimeout the hard timeout located switch's flow table for this flow requested by an application
-     * @param permanent whether the flow is permanent i.e. does not time out
-     * @param payLoad 3rd-party origin private flow
-     * @deprecated in Junco release. Use FlowRule.Builder instead.
-     */
-    @Deprecated
-    public DefaultFlowRule(DeviceId deviceId, TrafficSelector selector,
-                           TrafficTreatment treatment, int priority,
-                           ApplicationId appId, GroupId groupId, int timeout, int hardTimeout,
-                           boolean permanent, FlowRuleExtPayLoad payLoad) {
-
-        checkArgument(priority >= MIN_PRIORITY, "Priority cannot be less than " +
-                MIN_PRIORITY);
-        checkArgument(priority <= MAX_PRIORITY, "Priority cannot be greater than " +
-                MAX_PRIORITY);
-
-        this.deviceId = deviceId;
-        this.priority = priority;
-        this.selector = selector;
-        this.treatment = treatment;
-        this.appId = appId.id();
-        this.groupId = groupId;
-        this.timeout = timeout;
-        this.reason = FlowRemoveReason.NO_REASON;
-        this.hardTimeout = hardTimeout;
-        this.permanent = permanent;
-        this.created = System.currentTimeMillis();
-        this.tableId = DEFAULT_TABLE;
-        this.payLoad = payLoad;
-
-        /*
-         * id consists of the following. | appId (16 bits) | groupId (16 bits) |
-         * flowId (32 bits) |
-         */
-        this.id = FlowId.valueOf((((long) this.appId) << 48)
-                | (((long) this.groupId.id()) << 32)
-                | (this.hash() & 0xffffffffL));
     }
 
     @Override
@@ -291,12 +141,12 @@
      */
     @Override
     public int hashCode() {
-        return Objects.hash(deviceId, selector, tableId, payLoad);
+        return Objects.hash(deviceId, selector, tableId);
     }
 
     //FIXME do we need this method in addition to hashCode()?
     private int hash() {
-        return Objects.hash(deviceId, selector, tableId, payLoad);
+        return Objects.hash(deviceId, selector, tableId);
     }
 
     /*
@@ -316,8 +166,7 @@
             return Objects.equals(deviceId, that.deviceId) &&
                     Objects.equals(priority, that.priority) &&
                     Objects.equals(selector, that.selector) &&
-                    Objects.equals(tableId, that.tableId)
-                     && Objects.equals(payLoad, that.payLoad);
+                    Objects.equals(tableId, that.tableId);
         }
         return false;
     }
@@ -339,7 +188,6 @@
                 .add("treatment", treatment == null ? "N/A" : treatment)
                 .add("tableId", tableId)
                 .add("created", created)
-                .add("payLoad", payLoad)
                 .toString();
     }
 
@@ -534,10 +382,4 @@
             return hashCode.asInt();
         }
     }
-
-    @Override
-    public FlowRuleExtPayLoad payLoad() {
-        return payLoad;
-    }
-
 }
diff --git a/core/api/src/main/java/org/onosproject/net/flow/FlowRule.java b/core/api/src/main/java/org/onosproject/net/flow/FlowRule.java
index b62007f..750376a 100644
--- a/core/api/src/main/java/org/onosproject/net/flow/FlowRule.java
+++ b/core/api/src/main/java/org/onosproject/net/flow/FlowRule.java
@@ -328,13 +328,4 @@
         FlowRule build();
 
     }
-
-    /**
-     * Returns the third party original flow rule.
-     *
-     * @return FlowRuleExtPayLoad
-     * @deprecated in Junco release
-     */
-    @Deprecated
-    FlowRuleExtPayLoad payLoad();
 }
diff --git a/core/api/src/main/java/org/onosproject/net/flow/FlowRuleExtPayLoad.java b/core/api/src/main/java/org/onosproject/net/flow/FlowRuleExtPayLoad.java
deleted file mode 100644
index 02ee7ac..0000000
--- a/core/api/src/main/java/org/onosproject/net/flow/FlowRuleExtPayLoad.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright 2015-present Open Networking Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.onosproject.net.flow;
-
-import java.util.Arrays;
-
-import static com.google.common.base.MoreObjects.toStringHelper;
-
-/**
- * Represents for 3rd-party private original flow.
- *
- * @deprecated in Junco release
- */
-@Deprecated
-public final class FlowRuleExtPayLoad {
-    private final byte[] payLoad;
-
-    /**
-     * private constructor.
-     *
-     * @param payLoad private flow
-     */
-    private FlowRuleExtPayLoad(byte[] payLoad) {
-        this.payLoad = payLoad;
-    }
-
-    /**
-     * Creates a FlowRuleExtPayLoad.
-     *
-     * @param payLoad payload byte data
-     * @return FlowRuleExtPayLoad payLoad
-     */
-    public static FlowRuleExtPayLoad flowRuleExtPayLoad(byte[] payLoad) {
-        return new FlowRuleExtPayLoad(payLoad);
-    }
-
-    /**
-     * Returns private flow.
-     *
-     * @return payLoad private flow
-     */
-    public byte[] payLoad() {
-        return payLoad;
-    }
-
-    @Override
-    public int hashCode() {
-        return Arrays.hashCode(payLoad);
-    }
-
-    public int hash() {
-        return Arrays.hashCode(payLoad);
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (obj instanceof FlowRuleExtPayLoad) {
-            FlowRuleExtPayLoad that = (FlowRuleExtPayLoad) obj;
-            return Arrays.equals(payLoad, that.payLoad);
-
-        }
-        return false;
-    }
-
-    @Override
-    public String toString() {
-        return toStringHelper(this).add("payLoad", payLoad).toString();
-    }
-}
diff --git a/core/api/src/test/java/org/onosproject/net/flow/DefaultFlowRuleTest.java b/core/api/src/test/java/org/onosproject/net/flow/DefaultFlowRuleTest.java
index 6c8bff5..c0a2d44 100644
--- a/core/api/src/test/java/org/onosproject/net/flow/DefaultFlowRuleTest.java
+++ b/core/api/src/test/java/org/onosproject/net/flow/DefaultFlowRuleTest.java
@@ -38,9 +38,8 @@
             new IntentTestsMocks.MockTreatment();
 
     private static byte[] b = new byte[3];
-    private static FlowRuleExtPayLoad payLoad = FlowRuleExtPayLoad.flowRuleExtPayLoad(b);
-    final FlowRule flowRule1 = new IntentTestsMocks.MockFlowRule(1, payLoad);
-    final FlowRule sameAsFlowRule1 = new IntentTestsMocks.MockFlowRule(1, payLoad);
+    final FlowRule flowRule1 = new IntentTestsMocks.MockFlowRule(1);
+    final FlowRule sameAsFlowRule1 = new IntentTestsMocks.MockFlowRule(1);
     final DefaultFlowRule defaultFlowRule1 = new DefaultFlowRule(flowRule1);
     final DefaultFlowRule sameAsDefaultFlowRule1 = new DefaultFlowRule(sameAsFlowRule1);
 
@@ -76,7 +75,6 @@
         assertThat(defaultFlowRule1.selector(), is(flowRule1.selector()));
         assertThat(defaultFlowRule1.treatment(), is(flowRule1.treatment()));
         assertThat(defaultFlowRule1.timeout(), is(flowRule1.timeout()));
-        assertThat(defaultFlowRule1.payLoad(), is(flowRule1.payLoad()));
     }
 
     /**
@@ -109,15 +107,17 @@
      */
     @Test
     public void testCreationWithPayLoadByFlowTable() {
-        final DefaultFlowRule rule =
-                new DefaultFlowRule(did("1"), null,
-                        null, 22, APP_ID,
-                44, false, payLoad);
+        final FlowRule rule =
+            DefaultFlowRule.builder()
+                .forDevice(did("1"))
+                .withPriority(22)
+                .fromApp(APP_ID)
+                .makeTemporary(44)
+                .build();
         assertThat(rule.deviceId(), is(did("1")));
         assertThat(rule.isPermanent(), is(false));
         assertThat(rule.priority(), is(22));
         assertThat(rule.timeout(), is(44));
-        assertThat(defaultFlowRule1.payLoad(), is(payLoad));
     }
 
     /**
@@ -125,16 +125,18 @@
      */
     @Test
     public void testCreationWithPayLoadByGroupTable() {
-        final DefaultFlowRule rule =
-                new DefaultFlowRule(did("1"), null,
-                        null, 22, APP_ID, new GroupId(0),
-                44, false, payLoad);
+        final FlowRule rule =
+            DefaultFlowRule.builder()
+                .forDevice(did("1"))
+                .withPriority(22)
+                .fromApp(APP_ID)
+                .makeTemporary(44)
+                .build();
         assertThat(rule.deviceId(), is(did("1")));
         assertThat(rule.isPermanent(), is(false));
         assertThat(rule.priority(), is(22));
         assertThat(rule.timeout(), is(44));
         assertThat(rule.groupId(), is(new GroupId(0)));
-        assertThat(defaultFlowRule1.payLoad(), is(payLoad));
     }
     /**
      * Tests the creation of a DefaultFlowRule using an AppId constructor.
diff --git a/core/api/src/test/java/org/onosproject/net/flow/FlowEntryAdapter.java b/core/api/src/test/java/org/onosproject/net/flow/FlowEntryAdapter.java
index 265ebe6..1831c88 100644
--- a/core/api/src/test/java/org/onosproject/net/flow/FlowEntryAdapter.java
+++ b/core/api/src/test/java/org/onosproject/net/flow/FlowEntryAdapter.java
@@ -142,10 +142,4 @@
     public boolean exactMatch(FlowRule rule) {
         return false;
     }
-
-    @Override
-    public FlowRuleExtPayLoad payLoad() {
-        return null;
-    }
-
 }
diff --git a/core/api/src/test/java/org/onosproject/net/flow/FlowRuleExtPayLoadTest.java b/core/api/src/test/java/org/onosproject/net/flow/FlowRuleExtPayLoadTest.java
deleted file mode 100644
index 26a743a..0000000
--- a/core/api/src/test/java/org/onosproject/net/flow/FlowRuleExtPayLoadTest.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright 2015-present Open Networking Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.onosproject.net.flow;
-
-import static org.onlab.junit.ImmutableClassChecker.assertThatClassIsImmutable;
-
-import org.junit.Test;
-
-import com.google.common.testing.EqualsTester;
-/**
- * Test for FlowRuleExtPayLoad.
- */
-public class FlowRuleExtPayLoadTest {
-    final byte[] b = new byte[3];
-    final byte[] b1 = new byte[5];
-    final FlowRuleExtPayLoad payLoad1 = FlowRuleExtPayLoad.flowRuleExtPayLoad(b);
-    final FlowRuleExtPayLoad sameAsPayLoad1 = FlowRuleExtPayLoad.flowRuleExtPayLoad(b);
-    final FlowRuleExtPayLoad payLoad2 = FlowRuleExtPayLoad.flowRuleExtPayLoad(b1);
-
-    /**
-     * Checks that the FlowRuleExtPayLoad class is immutable.
-     */
-    @Test
-    public void testImmutability() {
-        assertThatClassIsImmutable(FlowRuleExtPayLoad.class);
-    }
-
-    /**
-     * Checks the operation of equals(), hashCode() and toString() methods.
-     */
-    @Test
-    public void testEquals() {
-        new EqualsTester()
-                .addEqualityGroup(payLoad1, sameAsPayLoad1)
-                .addEqualityGroup(payLoad2)
-                .testEquals();
-    }
-}
diff --git a/core/api/src/test/java/org/onosproject/net/intent/IntentTestsMocks.java b/core/api/src/test/java/org/onosproject/net/intent/IntentTestsMocks.java
index 2b8c6d7..642830e 100644
--- a/core/api/src/test/java/org/onosproject/net/intent/IntentTestsMocks.java
+++ b/core/api/src/test/java/org/onosproject/net/intent/IntentTestsMocks.java
@@ -33,7 +33,6 @@
 import org.onosproject.net.device.DeviceServiceAdapter;
 import org.onosproject.net.flow.FlowId;
 import org.onosproject.net.flow.FlowRule;
-import org.onosproject.net.flow.FlowRuleExtPayLoad;
 import org.onosproject.net.flow.IndexTableId;
 import org.onosproject.net.flow.TableId;
 import org.onosproject.net.flow.TrafficSelector;
@@ -450,21 +449,12 @@
         IndexTableId tableId;
         long timestamp;
         int id;
-        FlowRuleExtPayLoad payLoad;
 
         public MockFlowRule(int priority) {
             this.priority = priority;
             this.tableId = DEFAULT_TABLE;
             this.timestamp = System.currentTimeMillis();
             this.id = nextId++;
-            this.payLoad = null;
-        }
-
-        public MockFlowRule(int priority, FlowRuleExtPayLoad payLoad) {
-            this.priority = priority;
-            this.timestamp = System.currentTimeMillis();
-            this.id = nextId++;
-            this.payLoad = payLoad;
         }
 
         @Override
@@ -554,11 +544,6 @@
         public TableId table() {
             return tableId;
         }
-
-        @Override
-        public FlowRuleExtPayLoad payLoad() {
-            return payLoad;
-        }
     }
 
     public static class MockIntent extends Intent {
diff --git a/core/store/serializers/src/main/java/org/onosproject/store/serializers/KryoNamespaces.java b/core/store/serializers/src/main/java/org/onosproject/store/serializers/KryoNamespaces.java
index 5437a4c..7dc903a 100644
--- a/core/store/serializers/src/main/java/org/onosproject/store/serializers/KryoNamespaces.java
+++ b/core/store/serializers/src/main/java/org/onosproject/store/serializers/KryoNamespaces.java
@@ -101,7 +101,6 @@
 import org.onosproject.net.flow.FlowId;
 import org.onosproject.net.flow.FlowRule;
 import org.onosproject.net.flow.FlowRuleEvent;
-import org.onosproject.net.flow.FlowRuleExtPayLoad;
 import org.onosproject.net.flow.IndexTableId;
 import org.onosproject.net.flow.StatTriggerField;
 import org.onosproject.net.flow.StatTriggerFlag;
@@ -584,7 +583,6 @@
                     BooleanConstraint.class,
                     PartialFailureConstraint.class,
                     IntentOperation.class,
-                    FlowRuleExtPayLoad.class,
                     DefaultAnnotations.class,
                     PortStatistics.class,
                     DefaultPortStatistics.class,
diff --git a/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/OpenFlowRuleProvider.java b/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/OpenFlowRuleProvider.java
index d1867e2..2fafb8c 100644
--- a/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/OpenFlowRuleProvider.java
+++ b/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/OpenFlowRuleProvider.java
@@ -46,7 +46,6 @@
 import org.onosproject.net.flow.FlowRule;
 import org.onosproject.net.flow.oldbatch.FlowRuleBatchEntry;
 import org.onosproject.net.flow.oldbatch.FlowRuleBatchOperation;
-import org.onosproject.net.flow.FlowRuleExtPayLoad;
 import org.onosproject.net.flow.FlowRuleProvider;
 import org.onosproject.net.flow.FlowRuleProviderRegistry;
 import org.onosproject.net.flow.FlowRuleProviderService;
@@ -61,7 +60,6 @@
 import org.onosproject.openflow.controller.OpenFlowSwitch;
 import org.onosproject.openflow.controller.OpenFlowSwitchListener;
 import org.onosproject.openflow.controller.RoleState;
-import org.onosproject.openflow.controller.ThirdPartyMessage;
 import org.onosproject.provider.of.flow.util.FlowEntryBuilder;
 import org.osgi.service.component.ComponentContext;
 import org.projectfloodlight.openflow.protocol.OFBadRequestCode;
@@ -309,12 +307,6 @@
             return;
         }
 
-        FlowRuleExtPayLoad flowRuleExtPayLoad = flowRule.payLoad();
-        if (hasPayload(flowRuleExtPayLoad)) {
-            OFMessage msg = new ThirdPartyMessage(flowRuleExtPayLoad.payLoad());
-            sw.sendMsg(msg);
-            return;
-        }
         sw.sendMsg(FlowModBuilder.builder(flowRule, sw.factory(),
                 Optional.empty(), Optional.of(driverService)).buildFlowAdd());
     }
@@ -334,12 +326,6 @@
             return;
         }
 
-        FlowRuleExtPayLoad flowRuleExtPayLoad = flowRule.payLoad();
-        if (hasPayload(flowRuleExtPayLoad)) {
-            OFMessage msg = new ThirdPartyMessage(flowRuleExtPayLoad.payLoad());
-            sw.sendMsg(msg);
-            return;
-        }
         sw.sendMsg(FlowModBuilder.builder(flowRule, sw.factory(),
                                           Optional.empty(), Optional.of(driverService)).buildFlowDel());
     }
@@ -367,14 +353,6 @@
         pendingBatches.put(batch.id(), new InternalCacheEntry(batch));
         OFFlowMod mod;
         for (FlowRuleBatchEntry fbe : batch.getOperations()) {
-            // flow is the third party privacy flow
-
-            FlowRuleExtPayLoad flowRuleExtPayLoad = fbe.target().payLoad();
-            if (hasPayload(flowRuleExtPayLoad)) {
-                OFMessage msg = new ThirdPartyMessage(flowRuleExtPayLoad.payLoad());
-                sw.sendMsg(msg);
-                continue;
-            }
             FlowModBuilder builder =
                     FlowModBuilder.builder(fbe.target(), sw.factory(),
                             Optional.of(batch.id()), Optional.of(driverService));
@@ -400,12 +378,6 @@
         sw.sendMsg(builder.build());
     }
 
-    private boolean hasPayload(FlowRuleExtPayLoad flowRuleExtPayLoad) {
-        return flowRuleExtPayLoad != null &&
-                flowRuleExtPayLoad.payLoad() != null &&
-                flowRuleExtPayLoad.payLoad().length > 0;
-    }
-
     private class InternalFlowProvider
             implements OpenFlowSwitchListener, OpenFlowEventListener {
 
diff --git a/web/api/src/test/java/org/onosproject/rest/resources/IntentsResourceTest.java b/web/api/src/test/java/org/onosproject/rest/resources/IntentsResourceTest.java
index e57af12..318f90d 100644
--- a/web/api/src/test/java/org/onosproject/rest/resources/IntentsResourceTest.java
+++ b/web/api/src/test/java/org/onosproject/rest/resources/IntentsResourceTest.java
@@ -48,7 +48,6 @@
 import org.onosproject.net.flow.FlowEntryAdapter;
 import org.onosproject.net.flow.FlowId;
 import org.onosproject.net.flow.FlowRule;
-import org.onosproject.net.flow.FlowRuleExtPayLoad;
 import org.onosproject.net.flow.FlowRuleService;
 import org.onosproject.net.flow.TableId;
 import org.onosproject.net.flow.TrafficSelector;
@@ -357,11 +356,6 @@
         public boolean exactMatch(FlowRule rule) {
             return false;
         }
-
-        @Override
-        public FlowRuleExtPayLoad payLoad() {
-            return null;
-        }
     }
 
     /**