[ONOS-7311] and [ONOS-7197] Update ONOS to support most recent version of BMv2 and PI
Change-Id: Ie69cfe1946f3c9241dc7f59a64bd40005a063931
diff --git a/core/api/src/main/java/org/onosproject/net/pi/model/PiActionGroupType.java b/core/api/src/main/java/org/onosproject/net/pi/model/PiActionGroupType.java
deleted file mode 100644
index dd92888..0000000
--- a/core/api/src/main/java/org/onosproject/net/pi/model/PiActionGroupType.java
+++ /dev/null
@@ -1,31 +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.model;
-
-import com.google.common.annotations.Beta;
-
-/**
- * Type of action group in a protocol-independent pipeline.
- */
-@Beta
-public enum PiActionGroupType {
-
- /**
- * Performs load-balancing among different members of the group.
- */
- SELECT
-}
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
index 9084bea..dd90f9b 100644
--- 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
@@ -21,7 +21,6 @@
import com.google.common.base.Objects;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Maps;
-import org.onosproject.net.pi.model.PiActionGroupType;
import org.onosproject.net.pi.model.PiActionProfileId;
import java.util.Collection;
@@ -37,15 +36,12 @@
public final class PiActionGroup implements PiEntity {
private final PiActionGroupId id;
- private final PiActionGroupType type;
private final ImmutableSet<PiActionGroupMember> members;
private final PiActionProfileId piActionProfileId;
- private PiActionGroup(PiActionGroupId id, PiActionGroupType type,
- ImmutableSet<PiActionGroupMember> members,
+ private PiActionGroup(PiActionGroupId id, ImmutableSet<PiActionGroupMember> members,
PiActionProfileId piActionProfileId) {
this.id = id;
- this.type = type;
this.members = members;
this.piActionProfileId = piActionProfileId;
}
@@ -60,15 +56,6 @@
}
/**
- * Returns the type of this action group.
- *
- * @return action group type
- */
- public PiActionGroupType type() {
- return type;
- }
-
- /**
* Returns the members of this action group.
*
* @return collection of action members.
@@ -96,21 +83,19 @@
}
PiActionGroup that = (PiActionGroup) o;
return Objects.equal(id, that.id) &&
- Objects.equal(type, that.type) &&
Objects.equal(members, that.members) &&
Objects.equal(piActionProfileId, that.piActionProfileId);
}
@Override
public int hashCode() {
- return Objects.hashCode(id, type, members);
+ return Objects.hashCode(id, members);
}
@Override
public String toString() {
return MoreObjects.toStringHelper(this)
.add("groupId", id)
- .add("type", type)
.add("members", members)
.add("piActionProfileId", piActionProfileId)
.toString();
@@ -136,7 +121,6 @@
public static final class Builder {
private PiActionGroupId id;
- private PiActionGroupType type;
private Map<PiActionGroupMemberId, PiActionGroupMember> members = Maps.newHashMap();
private PiActionProfileId piActionProfileId;
@@ -156,17 +140,6 @@
}
/**
- * Sets the type of this action group.
- *
- * @param type action group type
- * @return this
- */
- public Builder withType(PiActionGroupType type) {
- this.type = type;
- return this;
- }
-
- /**
* Adds one member to this action group.
*
* @param member action group member
@@ -206,11 +179,9 @@
*/
public PiActionGroup build() {
checkNotNull(id);
- checkNotNull(type);
checkArgument(!members.isEmpty(), "Members cannot be empty");
checkNotNull(piActionProfileId);
- return new PiActionGroup(id, type,
- ImmutableSet.copyOf(members.values()),
+ return new PiActionGroup(id, ImmutableSet.copyOf(members.values()),
piActionProfileId);
}
}
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/PiActionGroupMember.java
index 2905eb9..9682383 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/PiActionGroupMember.java
@@ -57,8 +57,7 @@
}
/**
- * Returns the weight associated to this member. Meaningful if the action group of this member is of type {@link
- * org.onosproject.net.pi.model.PiActionGroupType#SELECT}.
+ * Returns the weight associated to this member.
*
* @return weight
*/
@@ -139,8 +138,7 @@
}
/**
- * Sets the weight of this member. Meaningful only if the action group is of type {@link
- * org.onosproject.net.pi.model.PiActionGroupType#SELECT}.
+ * Sets the weight of this member.
* <p>
* Default value is 0.
*
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/PiActionGroupTest.java
index 6672d91..bd4bc2c 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/PiActionGroupTest.java
@@ -20,7 +20,6 @@
import com.google.common.testing.EqualsTester;
import org.apache.commons.collections.CollectionUtils;
import org.junit.Test;
-import org.onosproject.net.pi.model.PiActionGroupType;
import org.onosproject.net.pi.model.PiActionId;
import org.onosproject.net.pi.model.PiActionParamId;
@@ -54,14 +53,12 @@
private PiActionGroup piActionGroup1 = PiActionGroup.builder()
.addMember(piActionGroupMember)
.withId(piActionGroupId)
- .withType(PiActionGroupType.SELECT)
.withActionProfileId(ACTION_PROF_ID)
.build();
private PiActionGroup sameAsPiActionGroup1 = PiActionGroup.builder()
.addMember(piActionGroupMember)
.withId(piActionGroupId)
- .withType(PiActionGroupType.SELECT)
.withActionProfileId(ACTION_PROF_ID)
.build();
@@ -69,7 +66,6 @@
private PiActionGroup piActionGroup2 = PiActionGroup.builder()
.addMember(piActionGroupMember)
.withId(piActionGroupId2)
- .withType(PiActionGroupType.SELECT)
.withActionProfileId(ACTION_PROF_ID)
.build();
@@ -105,7 +101,6 @@
piActionGroupMembers.add(piActionGroupMember);
assertThat(piActionGroup1, is(notNullValue()));
assertThat(piActionGroup1.id(), is(piActionGroupId));
- assertThat(piActionGroup1.type(), is(PiActionGroupType.SELECT));
assertThat("Incorrect members value",
CollectionUtils.isEqualCollection(piActionGroup1.members(), piActionGroupMembers));
}