ONOS-7887 Rename action profile-related entities

Members can exist outside of a group. Previous naming was ambiguous
about this.

Action group -> action profile group
Action group member -> action profile member

Change-Id: I5097e92253353d355b864e689f9653df2d318230
diff --git a/core/common/src/main/java/org/onosproject/codec/impl/DecodeInstructionCodecHelper.java b/core/common/src/main/java/org/onosproject/codec/impl/DecodeInstructionCodecHelper.java
index 6753fae..2730c38 100644
--- a/core/common/src/main/java/org/onosproject/codec/impl/DecodeInstructionCodecHelper.java
+++ b/core/common/src/main/java/org/onosproject/codec/impl/DecodeInstructionCodecHelper.java
@@ -29,7 +29,6 @@
 import org.onlab.util.HexString;
 import org.onlab.util.ImmutableByteSequence;
 import org.onosproject.codec.CodecContext;
-import org.onosproject.net.flow.ExtensionTreatmentCodec;
 import org.onosproject.core.GroupId;
 import org.onosproject.net.ChannelSpacing;
 import org.onosproject.net.Device;
@@ -39,6 +38,7 @@
 import org.onosproject.net.OduSignalId;
 import org.onosproject.net.PortNumber;
 import org.onosproject.net.device.DeviceService;
+import org.onosproject.net.flow.ExtensionTreatmentCodec;
 import org.onosproject.net.flow.StatTriggerField;
 import org.onosproject.net.flow.StatTriggerFlag;
 import org.onosproject.net.flow.instructions.ExtensionTreatment;
@@ -53,9 +53,9 @@
 import org.onosproject.net.pi.model.PiActionId;
 import org.onosproject.net.pi.model.PiActionParamId;
 import org.onosproject.net.pi.runtime.PiAction;
-import org.onosproject.net.pi.runtime.PiActionGroupId;
-import org.onosproject.net.pi.runtime.PiActionGroupMemberId;
 import org.onosproject.net.pi.runtime.PiActionParam;
+import org.onosproject.net.pi.runtime.PiActionProfileGroupId;
+import org.onosproject.net.pi.runtime.PiActionProfileMemberId;
 import org.onosproject.net.pi.runtime.PiTableAction;
 import org.slf4j.Logger;
 
@@ -306,18 +306,18 @@
             }
 
             return Instructions.piTableAction(builder.withId(piActionId).build());
-        } else if (subType.equals(PiTableAction.Type.ACTION_GROUP_ID.name())) {
-            PiActionGroupId piActionGroupId = PiActionGroupId.of(nullIsIllegal(
-                    json.get(InstructionCodec.PI_ACTION_GROUP_ID),
-                    InstructionCodec.PI_ACTION_GROUP_ID + InstructionCodec.MISSING_MEMBER_MESSAGE).asInt());
+        } else if (subType.equals(PiTableAction.Type.ACTION_PROFILE_GROUP_ID.name())) {
+            PiActionProfileGroupId piActionGroupId = PiActionProfileGroupId.of(nullIsIllegal(
+                    json.get(InstructionCodec.PI_ACTION_PROFILE_GROUP_ID),
+                    InstructionCodec.PI_ACTION_PROFILE_GROUP_ID + InstructionCodec.MISSING_MEMBER_MESSAGE).asInt());
 
             return Instructions.piTableAction(piActionGroupId);
-        } else if (subType.equals(PiTableAction.Type.GROUP_MEMBER_ID.name())) {
-            PiActionGroupMemberId piActionGroupMemberId = PiActionGroupMemberId.of(nullIsIllegal(
-                    json.get(InstructionCodec.PI_ACTION_GROUP_MEMBER_ID),
-                    InstructionCodec.PI_ACTION_GROUP_MEMBER_ID + InstructionCodec.MISSING_MEMBER_MESSAGE).asInt());
+        } else if (subType.equals(PiTableAction.Type.ACTION_PROFILE_MEMBER_ID.name())) {
+            PiActionProfileMemberId piActionProfileMemberId = PiActionProfileMemberId.of(nullIsIllegal(
+                    json.get(InstructionCodec.PI_ACTION_PROFILE_MEMBER_ID),
+                    InstructionCodec.PI_ACTION_PROFILE_MEMBER_ID + InstructionCodec.MISSING_MEMBER_MESSAGE).asInt());
 
-            return Instructions.piTableAction(piActionGroupMemberId);
+            return Instructions.piTableAction(piActionProfileMemberId);
         }
         throw new IllegalArgumentException("Protocol-independent Instruction subtype "
                                                    + subType + " is not supported");
diff --git a/core/common/src/main/java/org/onosproject/codec/impl/EncodeInstructionCodecHelper.java b/core/common/src/main/java/org/onosproject/codec/impl/EncodeInstructionCodecHelper.java
index 7e2f2df..0f3c125 100644
--- a/core/common/src/main/java/org/onosproject/codec/impl/EncodeInstructionCodecHelper.java
+++ b/core/common/src/main/java/org/onosproject/codec/impl/EncodeInstructionCodecHelper.java
@@ -20,12 +20,12 @@
 import org.onlab.osgi.ServiceDirectory;
 import org.onlab.util.HexString;
 import org.onosproject.codec.CodecContext;
-import org.onosproject.net.flow.ExtensionTreatmentCodec;
 import org.onosproject.net.Device;
 import org.onosproject.net.DeviceId;
 import org.onosproject.net.OchSignal;
 import org.onosproject.net.OduSignalId;
 import org.onosproject.net.device.DeviceService;
+import org.onosproject.net.flow.ExtensionTreatmentCodec;
 import org.onosproject.net.flow.instructions.Instruction;
 import org.onosproject.net.flow.instructions.Instructions;
 import org.onosproject.net.flow.instructions.L0ModificationInstruction;
@@ -35,9 +35,9 @@
 import org.onosproject.net.flow.instructions.L4ModificationInstruction;
 import org.onosproject.net.flow.instructions.PiInstruction;
 import org.onosproject.net.pi.runtime.PiAction;
-import org.onosproject.net.pi.runtime.PiActionGroupId;
-import org.onosproject.net.pi.runtime.PiActionGroupMemberId;
 import org.onosproject.net.pi.runtime.PiActionParam;
+import org.onosproject.net.pi.runtime.PiActionProfileGroupId;
+import org.onosproject.net.pi.runtime.PiActionProfileMemberId;
 import org.slf4j.Logger;
 
 import static org.onlab.util.Tools.toHexWithPrefix;
@@ -264,13 +264,13 @@
                 }
                 result.set(InstructionCodec.PI_ACTION_PARAMS, jsonActionParams);
                 break;
-            case ACTION_GROUP_ID:
-                final PiActionGroupId piActionGroupId = (PiActionGroupId) piInstruction.action();
-                result.put(InstructionCodec.PI_ACTION_GROUP_ID, piActionGroupId.id());
+            case ACTION_PROFILE_GROUP_ID:
+                final PiActionProfileGroupId groupId = (PiActionProfileGroupId) piInstruction.action();
+                result.put(InstructionCodec.PI_ACTION_PROFILE_GROUP_ID, groupId.id());
                 break;
-            case GROUP_MEMBER_ID:
-                final PiActionGroupMemberId piActionGroupMemberId = (PiActionGroupMemberId) piInstruction.action();
-                result.put(InstructionCodec.PI_ACTION_GROUP_MEMBER_ID, piActionGroupMemberId.id());
+            case ACTION_PROFILE_MEMBER_ID:
+                final PiActionProfileMemberId memberId = (PiActionProfileMemberId) piInstruction.action();
+                result.put(InstructionCodec.PI_ACTION_PROFILE_MEMBER_ID, memberId.id());
                 break;
             default:
                 throw new IllegalArgumentException("Cannot convert protocol-independent subtype of" +
diff --git a/core/common/src/main/java/org/onosproject/codec/impl/InstructionCodec.java b/core/common/src/main/java/org/onosproject/codec/impl/InstructionCodec.java
index 75192a0..df7ff1c 100644
--- a/core/common/src/main/java/org/onosproject/codec/impl/InstructionCodec.java
+++ b/core/common/src/main/java/org/onosproject/codec/impl/InstructionCodec.java
@@ -66,8 +66,8 @@
     static final String STAT_DURATION = "duration";
 
     static final String PI_ACTION_ID = "actionId";
-    static final String PI_ACTION_GROUP_ID = "groupId";
-    static final String PI_ACTION_GROUP_MEMBER_ID = "memberId";
+    static final String PI_ACTION_PROFILE_GROUP_ID = "groupId";
+    static final String PI_ACTION_PROFILE_MEMBER_ID = "memberId";
     static final String PI_ACTION_PARAMS = "actionParams";
 
     static final String MISSING_MEMBER_MESSAGE =
diff --git a/core/common/src/test/java/org/onosproject/codec/impl/InstructionCodecTest.java b/core/common/src/test/java/org/onosproject/codec/impl/InstructionCodecTest.java
index 832a420..1647c8e 100644
--- a/core/common/src/test/java/org/onosproject/codec/impl/InstructionCodecTest.java
+++ b/core/common/src/test/java/org/onosproject/codec/impl/InstructionCodecTest.java
@@ -44,9 +44,9 @@
 import org.onosproject.net.pi.model.PiActionId;
 import org.onosproject.net.pi.model.PiActionParamId;
 import org.onosproject.net.pi.runtime.PiAction;
-import org.onosproject.net.pi.runtime.PiActionGroupId;
-import org.onosproject.net.pi.runtime.PiActionGroupMemberId;
 import org.onosproject.net.pi.runtime.PiActionParam;
+import org.onosproject.net.pi.runtime.PiActionProfileGroupId;
+import org.onosproject.net.pi.runtime.PiActionProfileMemberId;
 import org.onosproject.net.pi.runtime.PiTableAction;
 
 import java.io.IOException;
@@ -264,17 +264,17 @@
                 instructionCodec.encode(actionInstruction, context);
         assertThat(actionInstructionJson, matchesInstruction(actionInstruction));
 
-        PiTableAction actionGroupId = PiActionGroupId.of(10);
+        PiTableAction actionGroupId = PiActionProfileGroupId.of(10);
         final PiInstruction actionGroupIdInstruction = Instructions.piTableAction(actionGroupId);
         final ObjectNode actionGroupIdInstructionJson =
                 instructionCodec.encode(actionGroupIdInstruction, context);
         assertThat(actionGroupIdInstructionJson, matchesInstruction(actionGroupIdInstruction));
 
-        PiTableAction actionGroupMemberId = PiActionGroupMemberId.of(10);
-        final PiInstruction actionGroupMemberIdInstruction = Instructions.piTableAction(actionGroupMemberId);
-        final ObjectNode actionGroupMemberIdInstructionJson =
-                instructionCodec.encode(actionGroupMemberIdInstruction, context);
-        assertThat(actionGroupMemberIdInstructionJson, matchesInstruction(actionGroupMemberIdInstruction));
+        PiTableAction actionProfileMemberId = PiActionProfileMemberId.of(10);
+        final PiInstruction actionProfileMemberIdInstruction = Instructions.piTableAction(actionProfileMemberId);
+        final ObjectNode actionProfileMemberIdInstructionJson =
+                instructionCodec.encode(actionProfileMemberIdInstruction, context);
+        assertThat(actionProfileMemberIdInstructionJson, matchesInstruction(actionProfileMemberIdInstruction));
     }
 
     /**
@@ -294,17 +294,17 @@
         Assert.assertThat(actionParam.id().id(), is("port"));
         Assert.assertThat(actionParam.value(), is(copyFrom((byte) 0x1)));
 
-        Instruction actionGroupIdInstruction = getInstruction("PiActionGroupIdInstruction.json");
+        Instruction actionGroupIdInstruction = getInstruction("PiActionProfileGroupIdInstruction.json");
         Assert.assertThat(actionInstruction.type(), is(Instruction.Type.PROTOCOL_INDEPENDENT));
         PiTableAction actionGroupId = ((PiInstruction) actionGroupIdInstruction).action();
-        Assert.assertThat(actionGroupId.type(), is(PiTableAction.Type.ACTION_GROUP_ID));
-        Assert.assertThat(((PiActionGroupId) actionGroupId).id(), is(100));
+        Assert.assertThat(actionGroupId.type(), is(PiTableAction.Type.ACTION_PROFILE_GROUP_ID));
+        Assert.assertThat(((PiActionProfileGroupId) actionGroupId).id(), is(100));
 
-        Instruction actionMemberIdInstruction = getInstruction("PiActionMemberIdInstruction.json");
+        Instruction actionMemberIdInstruction = getInstruction("PiActionProfileMemberIdInstruction.json");
         Assert.assertThat(actionInstruction.type(), is(Instruction.Type.PROTOCOL_INDEPENDENT));
         PiTableAction actionMemberId = ((PiInstruction) actionMemberIdInstruction).action();
-        Assert.assertThat(actionMemberId.type(), is(PiTableAction.Type.GROUP_MEMBER_ID));
-        Assert.assertThat(((PiActionGroupMemberId) actionMemberId).id(), is(100));
+        Assert.assertThat(actionMemberId.type(), is(PiTableAction.Type.ACTION_PROFILE_MEMBER_ID));
+        Assert.assertThat(((PiActionProfileMemberId) actionMemberId).id(), is(100));
     }
 
     /**
diff --git a/core/common/src/test/java/org/onosproject/codec/impl/InstructionJsonMatcher.java b/core/common/src/test/java/org/onosproject/codec/impl/InstructionJsonMatcher.java
index 9911a4f..66f8473 100644
--- a/core/common/src/test/java/org/onosproject/codec/impl/InstructionJsonMatcher.java
+++ b/core/common/src/test/java/org/onosproject/codec/impl/InstructionJsonMatcher.java
@@ -37,9 +37,9 @@
 import org.onosproject.net.flow.instructions.L3ModificationInstruction.ModIPv6FlowLabelInstruction;
 import org.onosproject.net.flow.instructions.PiInstruction;
 import org.onosproject.net.pi.runtime.PiAction;
-import org.onosproject.net.pi.runtime.PiActionGroupId;
-import org.onosproject.net.pi.runtime.PiActionGroupMemberId;
 import org.onosproject.net.pi.runtime.PiActionParam;
+import org.onosproject.net.pi.runtime.PiActionProfileGroupId;
+import org.onosproject.net.pi.runtime.PiActionProfileMemberId;
 
 import java.util.Collection;
 import java.util.Objects;
@@ -554,19 +554,19 @@
                     }
                 }
                 break;
-            case ACTION_GROUP_ID:
+            case ACTION_PROFILE_GROUP_ID:
                 if (!Objects.equals(instructionJson.get("groupId").asInt(),
-                                    ((PiActionGroupId) instructionToMatch.action()).id())) {
-                    description.appendText("action group id was " +
-                                                   ((PiActionGroupId) instructionToMatch.action()).id());
+                                    ((PiActionProfileGroupId) instructionToMatch.action()).id())) {
+                    description.appendText("action profile group id was " +
+                                                   ((PiActionProfileGroupId) instructionToMatch.action()).id());
                     return false;
                 }
                 break;
-            case GROUP_MEMBER_ID:
+            case ACTION_PROFILE_MEMBER_ID:
                 if (!Objects.equals(instructionJson.get("memberId").asInt(),
-                                    ((PiActionGroupMemberId) instructionToMatch.action()).id())) {
-                    description.appendText("action member id was " +
-                                                   ((PiActionGroupMemberId) instructionToMatch.action()).id());
+                                    ((PiActionProfileMemberId) instructionToMatch.action()).id())) {
+                    description.appendText("action profile member id was " +
+                                                   ((PiActionProfileMemberId) instructionToMatch.action()).id());
                     return false;
                 }
                 break;
diff --git a/core/common/src/test/resources/org/onosproject/codec/impl/PiActionGroupIdInstruction.json b/core/common/src/test/resources/org/onosproject/codec/impl/PiActionGroupIdInstruction.json
deleted file mode 100644
index 50a7d30..0000000
--- a/core/common/src/test/resources/org/onosproject/codec/impl/PiActionGroupIdInstruction.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
-  "type":"PROTOCOL_INDEPENDENT",
-  "subtype":"ACTION_GROUP_ID",
-  "groupId": 100
-}
diff --git a/core/common/src/test/resources/org/onosproject/codec/impl/PiActionMemberIdInstruction.json b/core/common/src/test/resources/org/onosproject/codec/impl/PiActionMemberIdInstruction.json
deleted file mode 100644
index c3fce67..0000000
--- a/core/common/src/test/resources/org/onosproject/codec/impl/PiActionMemberIdInstruction.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
-  "type":"PROTOCOL_INDEPENDENT",
-  "subtype":"GROUP_MEMBER_ID",
-  "memberId": 100
-}
\ No newline at end of file
diff --git a/core/common/src/test/resources/org/onosproject/codec/impl/PiActionProfileGroupIdInstruction.json b/core/common/src/test/resources/org/onosproject/codec/impl/PiActionProfileGroupIdInstruction.json
new file mode 100644
index 0000000..c7b4446
--- /dev/null
+++ b/core/common/src/test/resources/org/onosproject/codec/impl/PiActionProfileGroupIdInstruction.json
@@ -0,0 +1,5 @@
+{
+  "type":"PROTOCOL_INDEPENDENT",
+  "subtype": "ACTION_PROFILE_GROUP_ID",
+  "groupId": 100
+}
diff --git a/core/common/src/test/resources/org/onosproject/codec/impl/PiActionProfileMemberIdInstruction.json b/core/common/src/test/resources/org/onosproject/codec/impl/PiActionProfileMemberIdInstruction.json
new file mode 100644
index 0000000..c7383a2
--- /dev/null
+++ b/core/common/src/test/resources/org/onosproject/codec/impl/PiActionProfileMemberIdInstruction.json
@@ -0,0 +1,5 @@
+{
+  "type":"PROTOCOL_INDEPENDENT",
+  "subtype": "ACTION_PROFILE_MEMBER_ID",
+  "memberId": 100
+}