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/api/src/main/java/org/onosproject/net/flow/instructions/PiInstruction.java b/core/api/src/main/java/org/onosproject/net/flow/instructions/PiInstruction.java
index 180a521..87542bd 100644
--- a/core/api/src/main/java/org/onosproject/net/flow/instructions/PiInstruction.java
+++ b/core/api/src/main/java/org/onosproject/net/flow/instructions/PiInstruction.java
@@ -19,8 +19,8 @@
import com.google.common.annotations.Beta;
import com.google.common.base.Objects;
-import org.onosproject.net.pi.runtime.PiActionGroupId;
-import org.onosproject.net.pi.runtime.PiActionGroupMemberId;
+import org.onosproject.net.pi.runtime.PiActionProfileGroupId;
+import org.onosproject.net.pi.runtime.PiActionProfileMemberId;
import org.onosproject.net.pi.runtime.PiTableAction;
/**
@@ -74,10 +74,10 @@
@Override
public String toString() {
switch (tableAction.type()) {
- case ACTION_GROUP_ID:
- return "GROUP:0x" + Integer.toHexString(((PiActionGroupId) tableAction).id());
- case GROUP_MEMBER_ID:
- return "GROUP_MEMBER:0x" + Integer.toHexString(((PiActionGroupMemberId) tableAction).id());
+ case ACTION_PROFILE_GROUP_ID:
+ return "GROUP:0x" + Integer.toHexString(((PiActionProfileGroupId) tableAction).id());
+ case ACTION_PROFILE_MEMBER_ID:
+ return "GROUP_MEMBER:0x" + Integer.toHexString(((PiActionProfileMemberId) tableAction).id());
default:
return tableAction.toString();
}
diff --git a/core/api/src/main/java/org/onosproject/net/pi/runtime/PiActionGroup.java b/core/api/src/main/java/org/onosproject/net/pi/runtime/PiActionGroup.java
deleted file mode 100644
index a22e039..0000000
--- a/core/api/src/main/java/org/onosproject/net/pi/runtime/PiActionGroup.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- * Copyright 2017-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.pi.runtime;
-
-import com.google.common.annotations.Beta;
-import com.google.common.base.MoreObjects;
-import com.google.common.base.Objects;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Maps;
-import org.onosproject.net.pi.model.PiActionProfileId;
-
-import java.util.Collection;
-import java.util.Map;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-/**
- * Instance of an action group of a protocol-independent pipeline.
- */
-@Beta
-public final class PiActionGroup implements PiEntity {
-
- private final PiActionGroupId id;
- private final ImmutableSet<PiActionGroupMember> members;
- private final PiActionProfileId piActionProfileId;
-
- private PiActionGroup(PiActionGroupId id, ImmutableSet<PiActionGroupMember> members,
- PiActionProfileId piActionProfileId) {
- this.id = id;
- this.members = members;
- this.piActionProfileId = piActionProfileId;
- }
-
- /**
- * Returns the identifier of this action group.
- *
- * @return action group identifier
- */
- public PiActionGroupId id() {
- return id;
- }
-
- /**
- * Returns the members of this action group.
- *
- * @return collection of action members.
- */
- public Collection<PiActionGroupMember> members() {
- return members;
- }
-
- /**
- * Gets identifier of the action profile.
- *
- * @return action profile id
- */
- public PiActionProfileId actionProfileId() {
- return piActionProfileId;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || !(o instanceof PiActionGroup)) {
- return false;
- }
- PiActionGroup that = (PiActionGroup) o;
- return Objects.equal(id, that.id) &&
- Objects.equal(members, that.members) &&
- Objects.equal(piActionProfileId, that.piActionProfileId);
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(id, members);
- }
-
- @Override
- public String toString() {
- return MoreObjects.toStringHelper(this)
- .add("groupId", id)
- .add("members", members)
- .add("piActionProfileId", piActionProfileId)
- .toString();
- }
-
- /**
- * Returns a new builder of action groups.
- *
- * @return action group builder
- */
- public static Builder builder() {
- return new Builder();
- }
-
- @Override
- public PiEntityType piEntityType() {
- return PiEntityType.GROUP;
- }
-
- /**
- * Builder of action groups.
- */
- public static final class Builder {
-
- private PiActionGroupId id;
- private Map<PiActionGroupMemberId, PiActionGroupMember> members = Maps.newHashMap();
- private PiActionProfileId piActionProfileId;
-
- private Builder() {
- // hides constructor.
- }
-
- /**
- * Sets the identifier of this action group.
- *
- * @param id action group identifier
- * @return this
- */
- public Builder withId(PiActionGroupId id) {
- this.id = id;
- return this;
- }
-
- /**
- * Adds one member to this action group.
- *
- * @param member action group member
- * @return this
- */
- public Builder addMember(PiActionGroupMember member) {
- members.put(member.id(), member);
- return this;
- }
-
- /**
- * Adds many members to this action group.
- *
- * @param members action group members
- * @return this
- */
- public Builder addMembers(Collection<PiActionGroupMember> members) {
- members.forEach(this::addMember);
- return this;
- }
-
- /**
- * Sets the identifier of the action profile.
- *
- * @param piActionProfileId the identifier of the action profile
- * @return this
- */
- public Builder withActionProfileId(PiActionProfileId piActionProfileId) {
- this.piActionProfileId = piActionProfileId;
- return this;
- }
-
- /**
- * Creates a new action group.
- *
- * @return action group
- */
- public PiActionGroup build() {
- checkNotNull(id);
- checkNotNull(piActionProfileId);
- return new PiActionGroup(id, ImmutableSet.copyOf(members.values()),
- piActionProfileId);
- }
- }
-}
diff --git a/core/api/src/main/java/org/onosproject/net/pi/runtime/PiActionGroupId.java b/core/api/src/main/java/org/onosproject/net/pi/runtime/PiActionGroupId.java
deleted file mode 100644
index b604237..0000000
--- a/core/api/src/main/java/org/onosproject/net/pi/runtime/PiActionGroupId.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright 2017-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.pi.runtime;
-
-import com.google.common.annotations.Beta;
-import org.onlab.util.Identifier;
-
-/**
- * Identifier of an action group in a protocol-independent pipeline, unique within the scope of an action profile.
- */
-@Beta
-public final class PiActionGroupId extends Identifier<Integer> implements PiTableAction {
-
- private PiActionGroupId(int id) {
- super(id);
- }
-
- /**
- * Returns an action group identifier for the given integer value.
- *
- * @param id identifier
- * @return action group
- */
- public static PiActionGroupId of(int id) {
- return new PiActionGroupId(id);
- }
-
- /*
- In P4Runtime, groups can be referenced directly as table actions (i.e. without invoking the selector).
- In future we should consider having a more appropriate wrapper class for group IDs, instead of implementing
- the PiTableAction interface.
- */
- @Override
- public Type type() {
- return Type.ACTION_GROUP_ID;
- }
-}
diff --git a/core/api/src/main/java/org/onosproject/net/pi/runtime/PiActionGroupMemberId.java b/core/api/src/main/java/org/onosproject/net/pi/runtime/PiActionGroupMemberId.java
deleted file mode 100644
index 3b233a0..0000000
--- a/core/api/src/main/java/org/onosproject/net/pi/runtime/PiActionGroupMemberId.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright 2017-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.pi.runtime;
-
-import com.google.common.annotations.Beta;
-import org.onlab.util.Identifier;
-
-/**
- * Identifier of a member of an action group in a protocol-independent pipeline, unique withing the scope on an action
- * profile.
- */
-@Beta
-public final class PiActionGroupMemberId extends Identifier<Integer> implements PiTableAction {
-
- private PiActionGroupMemberId(int id) {
- super(id);
- }
-
- /**
- * Returns an action group identifier for the given integer value.
- *
- * @param id identifier
- * @return action group
- */
- public static PiActionGroupMemberId of(int id) {
- return new PiActionGroupMemberId(id);
- }
-
- /*
- In P4Runtime, group members can be referenced directly as table actions.
- In future we should consider having a more appropriate wrapper class for group member IDs, instead of implementing
- the PiTableAction interface.
- */
- @Override
- public Type type() {
- return Type.GROUP_MEMBER_ID;
- }
-}
diff --git a/core/api/src/main/java/org/onosproject/net/pi/runtime/PiActionProfileGroup.java b/core/api/src/main/java/org/onosproject/net/pi/runtime/PiActionProfileGroup.java
new file mode 100644
index 0000000..96168b9
--- /dev/null
+++ b/core/api/src/main/java/org/onosproject/net/pi/runtime/PiActionProfileGroup.java
@@ -0,0 +1,187 @@
+/*
+ * Copyright 2017-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.pi.runtime;
+
+import com.google.common.annotations.Beta;
+import com.google.common.base.MoreObjects;
+import com.google.common.base.Objects;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Maps;
+import org.onosproject.net.pi.model.PiActionProfileId;
+
+import java.util.Collection;
+import java.util.Map;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+/**
+ * Instance of an action profile group of a protocol-independent pipeline.
+ */
+@Beta
+public final class PiActionProfileGroup implements PiEntity {
+
+ private final PiActionProfileGroupId id;
+ private final ImmutableSet<PiActionProfileMember> members;
+ private final PiActionProfileId actionProfileId;
+
+ private PiActionProfileGroup(PiActionProfileGroupId id,
+ ImmutableSet<PiActionProfileMember> members,
+ PiActionProfileId actionProfileId) {
+ this.id = id;
+ this.members = members;
+ this.actionProfileId = actionProfileId;
+ }
+
+ /**
+ * Returns the identifier of this action profile group.
+ *
+ * @return action profile group identifier
+ */
+ public PiActionProfileGroupId id() {
+ return id;
+ }
+
+ /**
+ * Returns the members of this action profile group.
+ *
+ * @return collection of action profile members.
+ */
+ public Collection<PiActionProfileMember> members() {
+ return members;
+ }
+
+ /**
+ * Gets identifier of the action profile.
+ *
+ * @return action profile id
+ */
+ public PiActionProfileId actionProfileId() {
+ return actionProfileId;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || !(o instanceof PiActionProfileGroup)) {
+ return false;
+ }
+ PiActionProfileGroup that = (PiActionProfileGroup) o;
+ return Objects.equal(id, that.id) &&
+ Objects.equal(members, that.members) &&
+ Objects.equal(actionProfileId, that.actionProfileId);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(id, members);
+ }
+
+ @Override
+ public String toString() {
+ return MoreObjects.toStringHelper(this)
+ .add("groupId", id)
+ .add("members", members)
+ .add("piActionProfileId", actionProfileId)
+ .toString();
+ }
+
+ /**
+ * Returns a new builder of action profile groups.
+ *
+ * @return action profile group builder
+ */
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ @Override
+ public PiEntityType piEntityType() {
+ return PiEntityType.ACTION_PROFILE_GROUP;
+ }
+
+ /**
+ * Builder of action profile groups.
+ */
+ public static final class Builder {
+
+ private PiActionProfileGroupId id;
+ private Map<PiActionProfileMemberId, PiActionProfileMember> members = Maps.newHashMap();
+ private PiActionProfileId piActionProfileId;
+
+ private Builder() {
+ // hides constructor.
+ }
+
+ /**
+ * Sets the identifier of this action profile group.
+ *
+ * @param id action profile group identifier
+ * @return this
+ */
+ public Builder withId(PiActionProfileGroupId id) {
+ this.id = id;
+ return this;
+ }
+
+ /**
+ * Adds one member to this action profile group.
+ *
+ * @param member action profile member
+ * @return this
+ */
+ public Builder addMember(PiActionProfileMember member) {
+ members.put(member.id(), member);
+ return this;
+ }
+
+ /**
+ * Adds many members to this action profile group.
+ *
+ * @param members action profile members
+ * @return this
+ */
+ public Builder addMembers(Collection<PiActionProfileMember> members) {
+ members.forEach(this::addMember);
+ return this;
+ }
+
+ /**
+ * Sets the identifier of the action profile.
+ *
+ * @param piActionProfileId the identifier of the action profile
+ * @return this
+ */
+ public Builder withActionProfileId(PiActionProfileId piActionProfileId) {
+ this.piActionProfileId = piActionProfileId;
+ return this;
+ }
+
+ /**
+ * Creates a new action profile group.
+ *
+ * @return action profile group
+ */
+ public PiActionProfileGroup build() {
+ checkNotNull(id);
+ checkNotNull(piActionProfileId);
+ return new PiActionProfileGroup(
+ id, ImmutableSet.copyOf(members.values()), piActionProfileId);
+ }
+ }
+}
diff --git a/core/api/src/main/java/org/onosproject/net/pi/runtime/PiActionGroupHandle.java b/core/api/src/main/java/org/onosproject/net/pi/runtime/PiActionProfileGroupHandle.java
similarity index 72%
rename from core/api/src/main/java/org/onosproject/net/pi/runtime/PiActionGroupHandle.java
rename to core/api/src/main/java/org/onosproject/net/pi/runtime/PiActionProfileGroupHandle.java
index 6969714..42ed272 100644
--- a/core/api/src/main/java/org/onosproject/net/pi/runtime/PiActionGroupHandle.java
+++ b/core/api/src/main/java/org/onosproject/net/pi/runtime/PiActionProfileGroupHandle.java
@@ -23,36 +23,36 @@
import org.onosproject.net.pi.model.PiActionProfileId;
/**
- * Global identifier of a PI action group applied to a device, uniquely defined
- * by a device ID, action profile ID and group ID.
+ * Global identifier of a PI action profile group applied to a device, uniquely
+ * defined by a device ID, action profile ID and group ID.
*/
@Beta
-public final class PiActionGroupHandle extends PiHandle<PiActionGroup> {
+public final class PiActionProfileGroupHandle extends PiHandle<PiActionProfileGroup> {
private final PiActionProfileId actionProfileId;
- private final PiActionGroupId groupId;
+ private final PiActionProfileGroupId groupId;
- private PiActionGroupHandle(DeviceId deviceId, PiActionGroup group) {
+ private PiActionProfileGroupHandle(DeviceId deviceId, PiActionProfileGroup group) {
super(deviceId);
actionProfileId = group.actionProfileId();
groupId = group.id();
}
/**
- * Creates a new handle for the given device ID and PI action group.
+ * Creates a new handle for the given device ID and PI action profile group.
*
* @param deviceId device ID
- * @param group PI action group
- * @return PI action group handle
+ * @param group PI action profile group
+ * @return PI action profile group handle
*/
- public static PiActionGroupHandle of(DeviceId deviceId,
- PiActionGroup group) {
- return new PiActionGroupHandle(deviceId, group);
+ public static PiActionProfileGroupHandle of(DeviceId deviceId,
+ PiActionProfileGroup group) {
+ return new PiActionProfileGroupHandle(deviceId, group);
}
@Override
public PiEntityType entityType() {
- return PiEntityType.GROUP;
+ return PiEntityType.ACTION_PROFILE_GROUP;
}
@Override
@@ -70,7 +70,7 @@
if (o == null || getClass() != o.getClass()) {
return false;
}
- PiActionGroupHandle that = (PiActionGroupHandle) o;
+ PiActionProfileGroupHandle that = (PiActionProfileGroupHandle) o;
return Objects.equal(deviceId(), that.deviceId()) &&
Objects.equal(actionProfileId,
that.actionProfileId) &&
diff --git a/core/api/src/main/java/org/onosproject/net/pi/runtime/PiActionProfileGroupId.java b/core/api/src/main/java/org/onosproject/net/pi/runtime/PiActionProfileGroupId.java
new file mode 100644
index 0000000..206525a
--- /dev/null
+++ b/core/api/src/main/java/org/onosproject/net/pi/runtime/PiActionProfileGroupId.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2017-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.pi.runtime;
+
+import com.google.common.annotations.Beta;
+import org.onlab.util.Identifier;
+
+/**
+ * Identifier of an action profile group in a protocol-independent pipeline,
+ * unique within the scope of an action profile.
+ */
+@Beta
+public final class PiActionProfileGroupId extends Identifier<Integer> implements PiTableAction {
+
+ private PiActionProfileGroupId(int id) {
+ super(id);
+ }
+
+ /**
+ * Returns an action profile group identifier for the given integer value.
+ *
+ * @param id identifier
+ * @return action profile group
+ */
+ public static PiActionProfileGroupId of(int id) {
+ return new PiActionProfileGroupId(id);
+ }
+
+ /*
+ In P4Runtime, groups can be referenced directly as table actions (i.e.
+ without invoking the selector). In future we should consider having a more
+ appropriate wrapper class for group IDs, instead of implementing the
+ PiTableAction interface.
+ */
+ @Override
+ public Type type() {
+ return Type.ACTION_PROFILE_GROUP_ID;
+ }
+}
diff --git a/core/api/src/main/java/org/onosproject/net/pi/runtime/PiActionGroupMember.java b/core/api/src/main/java/org/onosproject/net/pi/runtime/PiActionProfileMember.java
similarity index 76%
rename from core/api/src/main/java/org/onosproject/net/pi/runtime/PiActionGroupMember.java
rename to core/api/src/main/java/org/onosproject/net/pi/runtime/PiActionProfileMember.java
index 690d118..92c3562 100644
--- a/core/api/src/main/java/org/onosproject/net/pi/runtime/PiActionGroupMember.java
+++ b/core/api/src/main/java/org/onosproject/net/pi/runtime/PiActionProfileMember.java
@@ -24,24 +24,25 @@
import static com.google.common.base.Preconditions.checkNotNull;
/**
- * Instance of a member of an action group in a protocol-independent pipeline.
+ * Instance of a member of an action profile in a protocol-independent pipeline.
*/
@Beta
-public final class PiActionGroupMember implements PiEntity {
+public final class PiActionProfileMember implements PiEntity {
private final PiActionProfileId actionProfileId;
- private final PiActionGroupMemberId id;
+ private final PiActionProfileMemberId memberId;
private final PiAction action;
// FIXME: in P4Runtime weight is an attribute of the member reference in a
// group. Either remove it from this class or define the containing group
// ID.
private final int weight;
- private PiActionGroupMember(
- PiActionProfileId actionProfileId, PiActionGroupMemberId id,
- PiAction action, int weight) {
+ private PiActionProfileMember(PiActionProfileId actionProfileId,
+ PiActionProfileMemberId memberId,
+ PiAction action,
+ int weight) {
this.actionProfileId = actionProfileId;
- this.id = id;
+ this.memberId = memberId;
this.action = action;
this.weight = weight;
}
@@ -51,8 +52,8 @@
*
* @return member identifier
*/
- public PiActionGroupMemberId id() {
- return id;
+ public PiActionProfileMemberId id() {
+ return memberId;
}
/**
@@ -84,7 +85,7 @@
@Override
public PiEntityType piEntityType() {
- return PiEntityType.GROUP_MEMBER;
+ return PiEntityType.ACTION_PROFILE_MEMBER;
}
@Override
@@ -92,33 +93,33 @@
if (this == o) {
return true;
}
- if (!(o instanceof PiActionGroupMember)) {
+ if (!(o instanceof PiActionProfileMember)) {
return false;
}
- PiActionGroupMember that = (PiActionGroupMember) o;
+ PiActionProfileMember that = (PiActionProfileMember) o;
return weight == that.weight &&
Objects.equal(actionProfileId, that.actionProfileId) &&
- Objects.equal(id, that.id) &&
+ Objects.equal(memberId, that.memberId) &&
Objects.equal(action, that.action);
}
@Override
public int hashCode() {
- return Objects.hashCode(actionProfileId, id, action, weight);
+ return Objects.hashCode(actionProfileId, memberId, action, weight);
}
@Override
public String toString() {
return MoreObjects.toStringHelper(this)
.add("actionProfile", actionProfileId)
- .add("id", id)
+ .add("id", memberId)
.add("action", action)
.add("weight", weight)
.toString();
}
/**
- * Returns a new builder of action group members.
+ * Returns a new builder of action profile members.
*
* @return member builder
*/
@@ -127,12 +128,12 @@
}
/**
- * Builder of action group members.
+ * Builder of action profile members.
*/
public static final class Builder {
private PiActionProfileId actionProfileId;
- private PiActionGroupMemberId id;
+ private PiActionProfileMemberId id;
private PiAction action;
private int weight;
@@ -157,7 +158,7 @@
* @param id member identifier
* @return this
*/
- public Builder withId(PiActionGroupMemberId id) {
+ public Builder withId(PiActionProfileMemberId id) {
this.id = id;
return this;
}
@@ -187,15 +188,15 @@
}
/**
- * Creates a new action group member.
+ * Creates a new action profile member.
*
- * @return action group member
+ * @return action profile member
*/
- public PiActionGroupMember build() {
+ public PiActionProfileMember build() {
checkNotNull(actionProfileId);
checkNotNull(id);
checkNotNull(action);
- return new PiActionGroupMember(actionProfileId, id, action, weight);
+ return new PiActionProfileMember(actionProfileId, id, action, weight);
}
}
}
diff --git a/core/api/src/main/java/org/onosproject/net/pi/runtime/PiActionGroupMemberHandle.java b/core/api/src/main/java/org/onosproject/net/pi/runtime/PiActionProfileMemberHandle.java
similarity index 81%
rename from core/api/src/main/java/org/onosproject/net/pi/runtime/PiActionGroupMemberHandle.java
rename to core/api/src/main/java/org/onosproject/net/pi/runtime/PiActionProfileMemberHandle.java
index 9ef8a31..8771650 100644
--- a/core/api/src/main/java/org/onosproject/net/pi/runtime/PiActionGroupMemberHandle.java
+++ b/core/api/src/main/java/org/onosproject/net/pi/runtime/PiActionProfileMemberHandle.java
@@ -27,14 +27,14 @@
* Global identifier of a PI action profile group member, uniquely defined by a
* device ID, action profile ID, and member ID.
*/
-public final class PiActionGroupMemberHandle extends PiHandle<PiActionGroupMember> {
+public final class PiActionProfileMemberHandle extends PiHandle<PiActionProfileMember> {
- private final PiActionGroupMemberId memberId;
+ private final PiActionProfileMemberId memberId;
private final PiActionProfileId actionProfileId;
- private PiActionGroupMemberHandle(DeviceId deviceId,
+ private PiActionProfileMemberHandle(DeviceId deviceId,
PiActionProfileId actionProfileId,
- PiActionGroupMemberId memberId) {
+ PiActionProfileMemberId memberId) {
super(deviceId);
this.actionProfileId = actionProfileId;
this.memberId = memberId;
@@ -49,11 +49,11 @@
* @param memberId member ID
* @return action profile group member handle
*/
- public static PiActionGroupMemberHandle of(
+ public static PiActionProfileMemberHandle of(
DeviceId deviceId,
PiActionProfileId actionProfileId,
- PiActionGroupMemberId memberId) {
- return new PiActionGroupMemberHandle(
+ PiActionProfileMemberId memberId) {
+ return new PiActionProfileMemberHandle(
deviceId, actionProfileId, memberId);
}
@@ -65,11 +65,11 @@
* @param member member instance
* @return action profile group member handle
*/
- public static PiActionGroupMemberHandle of(
+ public static PiActionProfileMemberHandle of(
DeviceId deviceId,
- PiActionGroupMember member) {
+ PiActionProfileMember member) {
checkNotNull(member);
- return new PiActionGroupMemberHandle(
+ return new PiActionProfileMemberHandle(
deviceId, member.actionProfile(), member.id());
}
@@ -78,7 +78,7 @@
*
* @return member ID
*/
- public PiActionGroupMemberId memberId() {
+ public PiActionProfileMemberId memberId() {
return memberId;
}
@@ -93,7 +93,7 @@
@Override
public PiEntityType entityType() {
- return PiEntityType.GROUP_MEMBER;
+ return PiEntityType.ACTION_PROFILE_MEMBER;
}
@Override
@@ -109,7 +109,7 @@
if (obj == null || getClass() != obj.getClass()) {
return false;
}
- final PiActionGroupMemberHandle other = (PiActionGroupMemberHandle) obj;
+ final PiActionProfileMemberHandle other = (PiActionProfileMemberHandle) obj;
return Objects.equal(this.deviceId(), other.deviceId())
&& Objects.equal(this.actionProfileId, other.actionProfileId)
&& Objects.equal(this.memberId, other.memberId);
diff --git a/core/api/src/main/java/org/onosproject/net/pi/runtime/PiActionProfileMemberId.java b/core/api/src/main/java/org/onosproject/net/pi/runtime/PiActionProfileMemberId.java
new file mode 100644
index 0000000..a813f6e
--- /dev/null
+++ b/core/api/src/main/java/org/onosproject/net/pi/runtime/PiActionProfileMemberId.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2017-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.pi.runtime;
+
+import com.google.common.annotations.Beta;
+import org.onlab.util.Identifier;
+
+/**
+ * Identifier of a member of an action profile in a protocol-independent
+ * pipeline, unique within the scope on an action profile.
+ */
+@Beta
+public final class PiActionProfileMemberId extends Identifier<Integer>
+ implements PiTableAction {
+
+ private PiActionProfileMemberId(int id) {
+ super(id);
+ }
+
+ /**
+ * Returns a member identifier for the given integer value.
+ *
+ * @param id identifier
+ * @return action profile group
+ */
+ public static PiActionProfileMemberId of(int id) {
+ return new PiActionProfileMemberId(id);
+ }
+
+ /*
+ In P4Runtime, action profile members can be referenced directly as table
+ actions. In future we should consider having a more appropriate wrapper
+ class for group member IDs, instead of implementing the PiTableAction
+ interface.
+ */
+ @Override
+ public Type type() {
+ return Type.ACTION_PROFILE_MEMBER_ID;
+ }
+}
diff --git a/core/api/src/main/java/org/onosproject/net/pi/runtime/PiEntityType.java b/core/api/src/main/java/org/onosproject/net/pi/runtime/PiEntityType.java
index 0569f99..4c31830 100644
--- a/core/api/src/main/java/org/onosproject/net/pi/runtime/PiEntityType.java
+++ b/core/api/src/main/java/org/onosproject/net/pi/runtime/PiEntityType.java
@@ -31,12 +31,12 @@
/**
* Action profile group.
*/
- GROUP,
+ ACTION_PROFILE_GROUP,
/**
- * Action profile group member.
+ * Action profile member.
*/
- GROUP_MEMBER,
+ ACTION_PROFILE_MEMBER,
/**
* Meter config.
diff --git a/core/api/src/main/java/org/onosproject/net/pi/runtime/PiTableAction.java b/core/api/src/main/java/org/onosproject/net/pi/runtime/PiTableAction.java
index 7d25e1a..284dde6 100644
--- a/core/api/src/main/java/org/onosproject/net/pi/runtime/PiTableAction.java
+++ b/core/api/src/main/java/org/onosproject/net/pi/runtime/PiTableAction.java
@@ -19,8 +19,8 @@
import com.google.common.annotations.Beta;
/**
- * Instance of an action that can be executed as a consequence of a match in a match+action table of a
- * protocol-independent pipeline.
+ * Instance of an action that can be executed as a consequence of a match in a
+ * match+action table of a protocol-independent pipeline.
*/
@Beta
public interface PiTableAction {
@@ -35,14 +35,15 @@
ACTION,
/**
- * Executes the action group specified by the given identifier.
+ * Executes the action profile group specified by the given identifier.
*/
- ACTION_GROUP_ID,
+ ACTION_PROFILE_GROUP_ID,
/**
- * Executes the action member group specified by the given identifier.
+ * Executes the action profile member specified by the given
+ * identifier.
*/
- GROUP_MEMBER_ID
+ ACTION_PROFILE_MEMBER_ID
}
/**
diff --git a/core/api/src/main/java/org/onosproject/net/pi/runtime/PiTableEntry.java b/core/api/src/main/java/org/onosproject/net/pi/runtime/PiTableEntry.java
index ac73bbe..b25ada5 100644
--- a/core/api/src/main/java/org/onosproject/net/pi/runtime/PiTableEntry.java
+++ b/core/api/src/main/java/org/onosproject/net/pi/runtime/PiTableEntry.java
@@ -179,10 +179,10 @@
return "null";
}
switch (tableAction.type()) {
- case ACTION_GROUP_ID:
- return "GROUP:" + ((PiActionGroupId) tableAction).id();
- case GROUP_MEMBER_ID:
- return "GROUP_MEMBER:" + ((PiActionGroupMemberId) tableAction).id();
+ case ACTION_PROFILE_GROUP_ID:
+ return "ACT_PROF_GROUP:" + ((PiActionProfileGroupId) tableAction).id();
+ case ACTION_PROFILE_MEMBER_ID:
+ return "ACT_PROF_MEMBER:" + ((PiActionProfileMemberId) tableAction).id();
case ACTION:
default:
return tableAction.toString();
diff --git a/core/api/src/main/java/org/onosproject/net/pi/service/PiGroupTranslationStore.java b/core/api/src/main/java/org/onosproject/net/pi/service/PiGroupTranslationStore.java
index 4fe526a..ed76c9e 100644
--- a/core/api/src/main/java/org/onosproject/net/pi/service/PiGroupTranslationStore.java
+++ b/core/api/src/main/java/org/onosproject/net/pi/service/PiGroupTranslationStore.java
@@ -18,13 +18,13 @@
import com.google.common.annotations.Beta;
import org.onosproject.net.group.Group;
-import org.onosproject.net.pi.runtime.PiActionGroup;
+import org.onosproject.net.pi.runtime.PiActionProfileGroup;
/**
* A PI translation store that keeps track of which groups have been
- * translated to which PI action groups.
+ * translated to which PI action profile groups.
*/
@Beta
public interface PiGroupTranslationStore
- extends PiTranslationStore<Group, PiActionGroup> {
+ extends PiTranslationStore<Group, PiActionProfileGroup> {
}
diff --git a/core/api/src/main/java/org/onosproject/net/pi/service/PiGroupTranslator.java b/core/api/src/main/java/org/onosproject/net/pi/service/PiGroupTranslator.java
index d5eb5af..5d7b6b3 100644
--- a/core/api/src/main/java/org/onosproject/net/pi/service/PiGroupTranslator.java
+++ b/core/api/src/main/java/org/onosproject/net/pi/service/PiGroupTranslator.java
@@ -18,12 +18,12 @@
import com.google.common.annotations.Beta;
import org.onosproject.net.group.Group;
-import org.onosproject.net.pi.runtime.PiActionGroup;
+import org.onosproject.net.pi.runtime.PiActionProfileGroup;
/**
- * A translator of groups to PI action groups.
+ * A translator of groups to PI action profile groups.
*/
@Beta
public interface PiGroupTranslator
- extends PiTranslator<Group, PiActionGroup> {
+ extends PiTranslator<Group, PiActionProfileGroup> {
}
diff --git a/core/api/src/test/java/org/onosproject/net/pi/runtime/PiActionGroupMemberIdTest.java b/core/api/src/test/java/org/onosproject/net/pi/runtime/PiActionGroupMemberIdTest.java
deleted file mode 100644
index 008a74e..0000000
--- a/core/api/src/test/java/org/onosproject/net/pi/runtime/PiActionGroupMemberIdTest.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright 2017-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.pi.runtime;
-
-import com.google.common.testing.EqualsTester;
-import org.junit.Test;
-
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.is;
-import static org.hamcrest.Matchers.notNullValue;
-import static org.onlab.junit.ImmutableClassChecker.assertThatClassIsImmutable;
-
-/**
- * Unit tests for PiActionGroupMemberId class.
- */
-public class PiActionGroupMemberIdTest {
-
- final PiActionGroupMemberId piActionGroupMemberId1 = PiActionGroupMemberId.of(10);
- final PiActionGroupMemberId sameAsPiActionGroupMemberId1 = PiActionGroupMemberId.of(10);
- final PiActionGroupMemberId piActionGroupMemberId2 = PiActionGroupMemberId.of(20);
-
- /**
- * Checks that the PiActionGroupMemberId class is immutable.
- */
- @Test
- public void testImmutability() {
-
- assertThatClassIsImmutable(PiActionGroupMemberId.class);
- }
-
- /**
- * Checks the operation of equals(), hashCode() and toString() methods.
- */
- @Test
- public void testEquals() {
-
- new EqualsTester()
- .addEqualityGroup(piActionGroupMemberId1, sameAsPiActionGroupMemberId1)
- .addEqualityGroup(piActionGroupMemberId2)
- .testEquals();
- }
-
- /**
- * Checks the methods of PiActionGroupMemberId.
- */
- @Test
- public void testMethods() {
-
- assertThat(piActionGroupMemberId1, is(notNullValue()));
- assertThat(piActionGroupMemberId1.type(), is(PiTableAction.Type.GROUP_MEMBER_ID));
- assertThat(piActionGroupMemberId1.id(), is(10));
- }
-}
diff --git a/core/api/src/test/java/org/onosproject/net/pi/runtime/PiActionGroupIdTest.java b/core/api/src/test/java/org/onosproject/net/pi/runtime/PiActionProfileGroupIdTest.java
similarity index 73%
rename from core/api/src/test/java/org/onosproject/net/pi/runtime/PiActionGroupIdTest.java
rename to core/api/src/test/java/org/onosproject/net/pi/runtime/PiActionProfileGroupIdTest.java
index 4c18f18..cffb9e9 100644
--- a/core/api/src/test/java/org/onosproject/net/pi/runtime/PiActionGroupIdTest.java
+++ b/core/api/src/test/java/org/onosproject/net/pi/runtime/PiActionProfileGroupIdTest.java
@@ -19,28 +19,27 @@
import com.google.common.testing.EqualsTester;
import org.junit.Test;
-
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.notNullValue;
import static org.onlab.junit.ImmutableClassChecker.assertThatClassIsImmutable;
/**
- * Unit tests for PiActionGroupId class.
+ * Unit tests for PiActionProfileGroupId class.
*/
-public class PiActionGroupIdTest {
+public class PiActionProfileGroupIdTest {
- final PiActionGroupId piActionGroupId1 = PiActionGroupId.of(10);
- final PiActionGroupId sameAsPiActionGroupId1 = PiActionGroupId.of(10);
- final PiActionGroupId piActionGroupId2 = PiActionGroupId.of(20);
+ final PiActionProfileGroupId piActionGroupId1 = PiActionProfileGroupId.of(10);
+ final PiActionProfileGroupId sameAsPiActionProfileGroupId1 = PiActionProfileGroupId.of(10);
+ final PiActionProfileGroupId piActionGroupId2 = PiActionProfileGroupId.of(20);
/**
- * Checks that the PiActionGroupId class is immutable.
+ * Checks that the PiActionProfileGroupId class is immutable.
*/
@Test
public void testImmutability() {
- assertThatClassIsImmutable(PiActionGroupId.class);
+ assertThatClassIsImmutable(PiActionProfileGroupId.class);
}
/**
@@ -50,19 +49,19 @@
public void testEquals() {
new EqualsTester()
- .addEqualityGroup(piActionGroupId1, sameAsPiActionGroupId1)
+ .addEqualityGroup(piActionGroupId1, sameAsPiActionProfileGroupId1)
.addEqualityGroup(piActionGroupId2)
.testEquals();
}
/**
- * Checks the methods of PiActionGroupId.
+ * Checks the methods of PiActionProfileGroupId.
*/
@Test
public void testMethods() {
assertThat(piActionGroupId1, is(notNullValue()));
- assertThat(piActionGroupId1.type(), is(PiTableAction.Type.ACTION_GROUP_ID));
+ assertThat(piActionGroupId1.type(), is(PiTableAction.Type.ACTION_PROFILE_GROUP_ID));
assertThat(piActionGroupId1.id(), is(10));
}
}
diff --git a/core/api/src/test/java/org/onosproject/net/pi/runtime/PiActionGroupTest.java b/core/api/src/test/java/org/onosproject/net/pi/runtime/PiActionProfileGroupTest.java
similarity index 68%
rename from core/api/src/test/java/org/onosproject/net/pi/runtime/PiActionGroupTest.java
rename to core/api/src/test/java/org/onosproject/net/pi/runtime/PiActionProfileGroupTest.java
index c3aca5a..0fecc72 100644
--- a/core/api/src/test/java/org/onosproject/net/pi/runtime/PiActionGroupTest.java
+++ b/core/api/src/test/java/org/onosproject/net/pi/runtime/PiActionProfileGroupTest.java
@@ -35,48 +35,48 @@
import static org.onosproject.net.pi.runtime.PiConstantsTest.MOD_NW_DST;
/**
- * Unit tests for PiActionGroup class.
+ * Unit tests for PiActionProfileGroup class.
*/
-public class PiActionGroupTest {
+public class PiActionProfileGroupTest {
- private final PiActionGroupMemberId piActionGroupMemberId = PiActionGroupMemberId.of(10);
+ private final PiActionProfileMemberId piActionProfileMemberId = PiActionProfileMemberId.of(10);
private final PiAction piAction = PiAction.builder().withId(PiActionId.of(MOD_NW_DST))
.withParameter(new PiActionParam(PiActionParamId.of(DST_ADDR), copyFrom(0x0a010101)))
.build();
- private final PiActionGroupMember piActionGroupMember = PiActionGroupMember.builder()
+ private final PiActionProfileMember piActionProfileMember = PiActionProfileMember.builder()
.forActionProfile(ACTION_PROF_ID)
- .withId(piActionGroupMemberId)
+ .withId(piActionProfileMemberId)
.withAction(piAction)
.withWeight(10)
.build();
- private PiActionGroupId piActionGroupId = PiActionGroupId.of(10);
- private PiActionGroup piActionGroup1 = PiActionGroup.builder()
- .addMember(piActionGroupMember)
+ private PiActionProfileGroupId piActionGroupId = PiActionProfileGroupId.of(10);
+ private PiActionProfileGroup piActionGroup1 = PiActionProfileGroup.builder()
+ .addMember(piActionProfileMember)
.withId(piActionGroupId)
.withActionProfileId(ACTION_PROF_ID)
.build();
- private PiActionGroup sameAsPiActionGroup1 = PiActionGroup.builder()
- .addMember(piActionGroupMember)
+ private PiActionProfileGroup sameAsPiActionProfileGroup1 = PiActionProfileGroup.builder()
+ .addMember(piActionProfileMember)
.withId(piActionGroupId)
.withActionProfileId(ACTION_PROF_ID)
.build();
- private PiActionGroupId piActionGroupId2 = PiActionGroupId.of(20);
- private PiActionGroup piActionGroup2 = PiActionGroup.builder()
- .addMember(piActionGroupMember)
+ private PiActionProfileGroupId piActionGroupId2 = PiActionProfileGroupId.of(20);
+ private PiActionProfileGroup piActionGroup2 = PiActionProfileGroup.builder()
+ .addMember(piActionProfileMember)
.withId(piActionGroupId2)
.withActionProfileId(ACTION_PROF_ID)
.build();
/**
- * Checks that the PiActionGroup class is immutable.
+ * Checks that the PiActionProfileGroup class is immutable.
*/
@Test
public void testImmutability() {
- assertThatClassIsImmutable(PiActionGroup.class);
+ assertThatClassIsImmutable(PiActionProfileGroup.class);
}
/**
@@ -86,23 +86,23 @@
public void testEquals() {
new EqualsTester()
- .addEqualityGroup(piActionGroup1, sameAsPiActionGroup1)
+ .addEqualityGroup(piActionGroup1, sameAsPiActionProfileGroup1)
.addEqualityGroup(piActionGroup2)
.testEquals();
}
/**
- * Checks the methods of PiActionGroup.
+ * Checks the methods of PiActionProfileGroup.
*/
@Test
public void testMethods() {
- Collection<PiActionGroupMember> piActionGroupMembers = Lists.newArrayList();
+ Collection<PiActionProfileMember> piActionProfileMembers = Lists.newArrayList();
- piActionGroupMembers.add(piActionGroupMember);
+ piActionProfileMembers.add(piActionProfileMember);
assertThat(piActionGroup1, is(notNullValue()));
assertThat(piActionGroup1.id(), is(piActionGroupId));
assertThat("Incorrect members value",
- CollectionUtils.isEqualCollection(piActionGroup1.members(), piActionGroupMembers));
+ CollectionUtils.isEqualCollection(piActionGroup1.members(), piActionProfileMembers));
}
}
diff --git a/core/api/src/test/java/org/onosproject/net/pi/runtime/PiActionProfileMemberIdTest.java b/core/api/src/test/java/org/onosproject/net/pi/runtime/PiActionProfileMemberIdTest.java
new file mode 100644
index 0000000..430ce9e
--- /dev/null
+++ b/core/api/src/test/java/org/onosproject/net/pi/runtime/PiActionProfileMemberIdTest.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2017-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.pi.runtime;
+
+import com.google.common.testing.EqualsTester;
+import org.junit.Test;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.notNullValue;
+import static org.onlab.junit.ImmutableClassChecker.assertThatClassIsImmutable;
+
+/**
+ * Unit tests for PiActionProfileMemberId class.
+ */
+public class PiActionProfileMemberIdTest {
+
+ final PiActionProfileMemberId piActionProfileMemberId1 = PiActionProfileMemberId.of(10);
+ final PiActionProfileMemberId sameAsPiActionProfileMemberId1 = PiActionProfileMemberId.of(10);
+ final PiActionProfileMemberId piActionProfileMemberId2 = PiActionProfileMemberId.of(20);
+
+ /**
+ * Checks that the PiActionProfileMemberId class is immutable.
+ */
+ @Test
+ public void testImmutability() {
+
+ assertThatClassIsImmutable(PiActionProfileMemberId.class);
+ }
+
+ /**
+ * Checks the operation of equals(), hashCode() and toString() methods.
+ */
+ @Test
+ public void testEquals() {
+
+ new EqualsTester()
+ .addEqualityGroup(piActionProfileMemberId1, sameAsPiActionProfileMemberId1)
+ .addEqualityGroup(piActionProfileMemberId2)
+ .testEquals();
+ }
+
+ /**
+ * Checks the methods of PiActionProfileMemberId.
+ */
+ @Test
+ public void testMethods() {
+
+ assertThat(piActionProfileMemberId1, is(notNullValue()));
+ assertThat(piActionProfileMemberId1.type(), is(PiTableAction.Type.ACTION_PROFILE_MEMBER_ID));
+ assertThat(piActionProfileMemberId1.id(), is(10));
+ }
+}
diff --git a/core/api/src/test/java/org/onosproject/net/pi/runtime/PiActionGroupMemberTest.java b/core/api/src/test/java/org/onosproject/net/pi/runtime/PiActionProfileMemberTest.java
similarity index 65%
rename from core/api/src/test/java/org/onosproject/net/pi/runtime/PiActionGroupMemberTest.java
rename to core/api/src/test/java/org/onosproject/net/pi/runtime/PiActionProfileMemberTest.java
index e84d48f..317f322 100644
--- a/core/api/src/test/java/org/onosproject/net/pi/runtime/PiActionGroupMemberTest.java
+++ b/core/api/src/test/java/org/onosproject/net/pi/runtime/PiActionProfileMemberTest.java
@@ -31,49 +31,49 @@
import static org.onosproject.net.pi.runtime.PiConstantsTest.MOD_NW_DST;
/**
- * Unit tests for PiActionGroupMember class.
+ * Unit tests for PiActionProfileMember class.
*/
-public class PiActionGroupMemberTest {
+public class PiActionProfileMemberTest {
private final PiActionProfileId actionProfileId1 = PiActionProfileId.of("foo");
private final PiActionProfileId actionProfileId2 = PiActionProfileId.of("bar");
- private final PiActionGroupMemberId piActionGroupMemberId = PiActionGroupMemberId.of(10);
+ private final PiActionProfileMemberId piActionProfileMemberId = PiActionProfileMemberId.of(10);
private final PiAction piAction = PiAction.builder().withId(PiActionId.of(MOD_NW_DST))
.withParameter(new PiActionParam(PiActionParamId.of(DST_ADDR), copyFrom(0x0a010101)))
.build();
- private final PiActionGroupMember piActionGroupMember1 = PiActionGroupMember.builder()
+ private final PiActionProfileMember piActionProfileMember1 = PiActionProfileMember.builder()
.forActionProfile(actionProfileId1)
- .withId(piActionGroupMemberId)
+ .withId(piActionProfileMemberId)
.withAction(piAction)
.withWeight(10)
.build();
- private final PiActionGroupMember sameAsPiActionGroupMember1 = PiActionGroupMember.builder()
+ private final PiActionProfileMember sameAsPiActionProfileMember1 = PiActionProfileMember.builder()
.forActionProfile(actionProfileId1)
- .withId(piActionGroupMemberId)
+ .withId(piActionProfileMemberId)
.withAction(piAction)
.withWeight(10)
.build();
- private final PiActionGroupMember piActionGroupMember2 = PiActionGroupMember.builder()
+ private final PiActionProfileMember piActionProfileMember2 = PiActionProfileMember.builder()
.forActionProfile(actionProfileId1)
- .withId(piActionGroupMemberId)
+ .withId(piActionProfileMemberId)
.withAction(piAction)
.withWeight(20)
.build();
- private final PiActionGroupMember piActionGroupMember1ForOtherProfile = PiActionGroupMember.builder()
+ private final PiActionProfileMember piActionGroupMember1ForOtherProfile = PiActionProfileMember.builder()
.forActionProfile(actionProfileId2)
- .withId(piActionGroupMemberId)
+ .withId(piActionProfileMemberId)
.withAction(piAction)
.withWeight(10)
.build();
/**
- * Checks that the PiActionGroupMember class is immutable.
+ * Checks that the PiActionProfileMember class is immutable.
*/
@Test
public void testImmutability() {
- assertThatClassIsImmutable(PiActionGroupMember.class);
+ assertThatClassIsImmutable(PiActionProfileMember.class);
}
/**
@@ -83,21 +83,21 @@
public void testEquals() {
new EqualsTester()
- .addEqualityGroup(piActionGroupMember1, sameAsPiActionGroupMember1)
- .addEqualityGroup(piActionGroupMember2)
+ .addEqualityGroup(piActionProfileMember1, sameAsPiActionProfileMember1)
+ .addEqualityGroup(piActionProfileMember2)
.addEqualityGroup(piActionGroupMember1ForOtherProfile)
.testEquals();
}
/**
- * Checks the methods of PiActionGroupMember.
+ * Checks the methods of PiActionProfileMember.
*/
@Test
public void testMethods() {
- assertThat(piActionGroupMember1, is(notNullValue()));
- assertThat(piActionGroupMember1.weight(), is(10));
- assertThat(piActionGroupMember1.id(), is(piActionGroupMemberId));
- assertThat(piActionGroupMember1.action(), is(piAction));
+ assertThat(piActionProfileMember1, is(notNullValue()));
+ assertThat(piActionProfileMember1.weight(), is(10));
+ assertThat(piActionProfileMember1.id(), is(piActionProfileMemberId));
+ assertThat(piActionProfileMember1.action(), is(piAction));
}
}
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
+}
diff --git a/core/net/src/main/java/org/onosproject/net/pi/impl/PiGroupTranslatorImpl.java b/core/net/src/main/java/org/onosproject/net/pi/impl/PiGroupTranslatorImpl.java
index 4a4dff7..de32b60 100644
--- a/core/net/src/main/java/org/onosproject/net/pi/impl/PiGroupTranslatorImpl.java
+++ b/core/net/src/main/java/org/onosproject/net/pi/impl/PiGroupTranslatorImpl.java
@@ -24,10 +24,10 @@
import org.onosproject.net.pi.model.PiPipeconf;
import org.onosproject.net.pi.model.PiPipelineInterpreter;
import org.onosproject.net.pi.runtime.PiAction;
-import org.onosproject.net.pi.runtime.PiActionGroup;
-import org.onosproject.net.pi.runtime.PiActionGroupId;
-import org.onosproject.net.pi.runtime.PiActionGroupMember;
-import org.onosproject.net.pi.runtime.PiActionGroupMemberId;
+import org.onosproject.net.pi.runtime.PiActionProfileGroup;
+import org.onosproject.net.pi.runtime.PiActionProfileGroupId;
+import org.onosproject.net.pi.runtime.PiActionProfileMember;
+import org.onosproject.net.pi.runtime.PiActionProfileMemberId;
import org.onosproject.net.pi.runtime.PiGroupKey;
import org.onosproject.net.pi.runtime.PiTableAction;
import org.onosproject.net.pi.service.PiTranslationException;
@@ -55,15 +55,16 @@
}
/**
- * Returns a PI action group equivalent to the given group, for the given pipeconf and device.
+ * Returns a PI action profile group equivalent to the given group, for the given pipeconf and device.
*
* @param group group
* @param pipeconf pipeconf
* @param device device
- * @return PI action group
+ * @return PI action profile group
* @throws PiTranslationException if the group cannot be translated
*/
- static PiActionGroup translate(Group group, PiPipeconf pipeconf, Device device) throws PiTranslationException {
+ static PiActionProfileGroup translate(Group group, PiPipeconf pipeconf, Device device)
+ throws PiTranslationException {
if (!SUPPORTED_GROUP_TYPES.contains(group.type())) {
throw new PiTranslationException(format(
@@ -72,8 +73,8 @@
final PiPipelineInterpreter interpreter = getInterpreterOrNull(device, pipeconf);
- final PiActionGroup.Builder piActionGroupBuilder = PiActionGroup.builder()
- .withId(PiActionGroupId.of(group.id().id()));
+ final PiActionProfileGroup.Builder piActionGroupBuilder = PiActionProfileGroup.builder()
+ .withId(PiActionProfileGroupId.of(group.id().id()));
if (!(group.appCookie() instanceof PiGroupKey)) {
throw new PiTranslationException("group app cookie is not PI (class should be PiGroupKey)");
@@ -88,7 +89,7 @@
/*
FIXME: the way member IDs are computed can cause collisions!
Problem:
- In P4Runtime action group members, i.e. action buckets, are associated to a numeric ID chosen
+ In P4Runtime action profile members, i.e. action buckets, are associated to a numeric ID chosen
at member insertion time. This ID must be unique for the whole action profile (i.e. the group table in
OpenFlow). In ONOS, GroupBucket doesn't specify any ID.
@@ -118,9 +119,9 @@
"PI table action of type %s is not supported in groups", tableAction.type()));
}
- piActionGroupBuilder.addMember(PiActionGroupMember.builder()
+ piActionGroupBuilder.addMember(PiActionProfileMember.builder()
.forActionProfile(groupKey.actionProfileId())
- .withId(PiActionGroupMemberId.of(memberId))
+ .withId(PiActionProfileMemberId.of(memberId))
.withAction((PiAction) tableAction)
.withWeight(bucket.weight())
.build());
diff --git a/core/net/src/main/java/org/onosproject/net/pi/impl/PiTranslationServiceImpl.java b/core/net/src/main/java/org/onosproject/net/pi/impl/PiTranslationServiceImpl.java
index a28ab0a..33da340 100644
--- a/core/net/src/main/java/org/onosproject/net/pi/impl/PiTranslationServiceImpl.java
+++ b/core/net/src/main/java/org/onosproject/net/pi/impl/PiTranslationServiceImpl.java
@@ -29,7 +29,7 @@
import org.onosproject.net.group.Group;
import org.onosproject.net.meter.Meter;
import org.onosproject.net.pi.model.PiPipeconf;
-import org.onosproject.net.pi.runtime.PiActionGroup;
+import org.onosproject.net.pi.runtime.PiActionProfileGroup;
import org.onosproject.net.pi.runtime.PiMeterCellConfig;
import org.onosproject.net.pi.runtime.PiMulticastGroupEntry;
import org.onosproject.net.pi.runtime.PiTableEntry;
@@ -139,7 +139,7 @@
}
private final class InternalGroupTranslator
- extends AbstractPiTranslatorImpl<Group, PiActionGroup>
+ extends AbstractPiTranslatorImpl<Group, PiActionProfileGroup>
implements PiGroupTranslator {
private InternalGroupTranslator(PiGroupTranslationStore store) {
@@ -147,7 +147,7 @@
}
@Override
- public PiActionGroup translate(Group original, PiPipeconf pipeconf)
+ public PiActionProfileGroup translate(Group original, PiPipeconf pipeconf)
throws PiTranslationException {
return PiGroupTranslatorImpl
.translate(original, pipeconf, getDevice(original.deviceId()));
diff --git a/core/net/src/test/java/org/onosproject/net/pi/impl/PiGroupTranslatorImplTest.java b/core/net/src/test/java/org/onosproject/net/pi/impl/PiGroupTranslatorImplTest.java
index 6c86604..f5b8384 100644
--- a/core/net/src/test/java/org/onosproject/net/pi/impl/PiGroupTranslatorImplTest.java
+++ b/core/net/src/test/java/org/onosproject/net/pi/impl/PiGroupTranslatorImplTest.java
@@ -38,10 +38,10 @@
import org.onosproject.net.group.GroupDescription;
import org.onosproject.net.pi.model.PiPipeconf;
import org.onosproject.net.pi.runtime.PiAction;
-import org.onosproject.net.pi.runtime.PiActionGroup;
-import org.onosproject.net.pi.runtime.PiActionGroupMember;
-import org.onosproject.net.pi.runtime.PiActionGroupMemberId;
import org.onosproject.net.pi.runtime.PiActionParam;
+import org.onosproject.net.pi.runtime.PiActionProfileGroup;
+import org.onosproject.net.pi.runtime.PiActionProfileMember;
+import org.onosproject.net.pi.runtime.PiActionProfileMemberId;
import org.onosproject.net.pi.runtime.PiGroupKey;
import org.onosproject.net.pi.runtime.PiTableAction;
import org.onosproject.pipelines.basic.PipeconfLoader;
@@ -80,7 +80,7 @@
private static final Group SELECT_GROUP = new DefaultGroup(GROUP_ID, SELECT_GROUP_DESC);
private static final int DEFAULT_MEMBER_WEIGHT = 1;
private static final int BASE_MEM_ID = 65535;
- private Collection<PiActionGroupMember> expectedMembers;
+ private Collection<PiActionProfileMember> expectedMembers;
private PiPipeconf pipeconf;
@@ -102,16 +102,16 @@
return DefaultGroupBucket.createSelectGroupBucket(treatment);
}
- private static PiActionGroupMember outputMember(int portNum)
+ private static PiActionProfileMember outputMember(int portNum)
throws ImmutableByteSequence.ByteSequenceTrimException {
PiActionParam param = new PiActionParam(ACT_PRM_PORT_ID, copyFrom(portNum).fit(PORT_BITWIDTH));
PiAction piAction = PiAction.builder()
.withId(ACT_SET_EGRESS_PORT_WCMP_ID)
.withParameter(param).build();
- return PiActionGroupMember.builder()
+ return PiActionProfileMember.builder()
.forActionProfile(ACT_PRF_WCMP_SELECTOR_ID)
.withAction(piAction)
- .withId(PiActionGroupMemberId.of(BASE_MEM_ID + portNum))
+ .withId(PiActionProfileMemberId.of(BASE_MEM_ID + portNum))
.withWeight(DEFAULT_MEMBER_WEIGHT)
.build();
}
@@ -122,8 +122,8 @@
@Test
public void testTranslateGroups() throws Exception {
- PiActionGroup piGroup1 = PiGroupTranslatorImpl.translate(SELECT_GROUP, pipeconf, null);
- PiActionGroup piGroup2 = PiGroupTranslatorImpl.translate(SELECT_GROUP, pipeconf, null);
+ PiActionProfileGroup piGroup1 = PiGroupTranslatorImpl.translate(SELECT_GROUP, pipeconf, null);
+ PiActionProfileGroup piGroup2 = PiGroupTranslatorImpl.translate(SELECT_GROUP, pipeconf, null);
new EqualsTester()
.addEqualityGroup(piGroup1, piGroup2)
@@ -135,7 +135,7 @@
piGroup1.actionProfileId(), is(equalTo(ACT_PRF_WCMP_SELECTOR_ID)));
// members installed
- Collection<PiActionGroupMember> members = piGroup1.members();
+ Collection<PiActionProfileMember> members = piGroup1.members();
assertThat("The number of group members must be equal",
piGroup1.members().size(), is(expectedMembers.size()));
assertThat("Group members must be equal",
diff --git a/core/store/dist/src/main/java/org/onosproject/store/pi/impl/DistributedPiGroupTranslationStore.java b/core/store/dist/src/main/java/org/onosproject/store/pi/impl/DistributedPiGroupTranslationStore.java
index fa62ef1..05ef4af 100644
--- a/core/store/dist/src/main/java/org/onosproject/store/pi/impl/DistributedPiGroupTranslationStore.java
+++ b/core/store/dist/src/main/java/org/onosproject/store/pi/impl/DistributedPiGroupTranslationStore.java
@@ -19,7 +19,7 @@
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Service;
import org.onosproject.net.group.Group;
-import org.onosproject.net.pi.runtime.PiActionGroup;
+import org.onosproject.net.pi.runtime.PiActionProfileGroup;
import org.onosproject.net.pi.service.PiGroupTranslationStore;
/**
@@ -28,7 +28,7 @@
@Component(immediate = true)
@Service
public class DistributedPiGroupTranslationStore
- extends AbstractDistributedPiTranslationStore<Group, PiActionGroup>
+ extends AbstractDistributedPiTranslationStore<Group, PiActionProfileGroup>
implements PiGroupTranslationStore {
private static final String MAP_SIMPLE_NAME = "group";
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 faaafac..cf81216 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
@@ -226,13 +226,13 @@
import org.onosproject.net.pi.model.PiTableId;
import org.onosproject.net.pi.model.PiTableType;
import org.onosproject.net.pi.runtime.PiAction;
-import org.onosproject.net.pi.runtime.PiActionGroup;
-import org.onosproject.net.pi.runtime.PiActionGroupHandle;
-import org.onosproject.net.pi.runtime.PiActionGroupId;
-import org.onosproject.net.pi.runtime.PiActionGroupMember;
-import org.onosproject.net.pi.runtime.PiActionGroupMemberHandle;
-import org.onosproject.net.pi.runtime.PiActionGroupMemberId;
import org.onosproject.net.pi.runtime.PiActionParam;
+import org.onosproject.net.pi.runtime.PiActionProfileGroup;
+import org.onosproject.net.pi.runtime.PiActionProfileGroupHandle;
+import org.onosproject.net.pi.runtime.PiActionProfileGroupId;
+import org.onosproject.net.pi.runtime.PiActionProfileMember;
+import org.onosproject.net.pi.runtime.PiActionProfileMemberHandle;
+import org.onosproject.net.pi.runtime.PiActionProfileMemberId;
import org.onosproject.net.pi.runtime.PiControlMetadata;
import org.onosproject.net.pi.runtime.PiCounterCell;
import org.onosproject.net.pi.runtime.PiCounterCellData;
@@ -692,12 +692,12 @@
PiTableType.class,
// PI Runtime
PiAction.class,
- PiActionGroup.class,
- PiActionGroupHandle.class,
- PiActionGroupId.class,
- PiActionGroupMember.class,
- PiActionGroupMemberHandle.class,
- PiActionGroupMemberId.class,
+ PiActionProfileGroup.class,
+ PiActionProfileGroupHandle.class,
+ PiActionProfileGroupId.class,
+ PiActionProfileMember.class,
+ PiActionProfileMemberHandle.class,
+ PiActionProfileMemberId.class,
PiActionParam.class,
PiControlMetadata.class,
PiCounterCell.class,