Bug fix: generate different next objectives for port with multiple vlans
Cleaning up some logs.
Change-Id: I0db119fdbc36ccbd25a382d54d3f9f731f8be1ec
diff --git a/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/storekey/PortNextObjectiveStoreKey.java b/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/storekey/PortNextObjectiveStoreKey.java
index fdf28df..d76c9c6 100644
--- a/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/storekey/PortNextObjectiveStoreKey.java
+++ b/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/storekey/PortNextObjectiveStoreKey.java
@@ -17,6 +17,7 @@
import org.onosproject.net.DeviceId;
import org.onosproject.net.PortNumber;
+import org.onosproject.net.flow.TrafficSelector;
import org.onosproject.net.flow.TrafficTreatment;
import java.util.Objects;
@@ -31,6 +32,7 @@
private final DeviceId deviceId;
private final PortNumber portNum;
private final TrafficTreatment treatment;
+ private final TrafficSelector meta;
/**
* Constructs the key of port next objective store.
@@ -38,12 +40,15 @@
* @param deviceId device ID
* @param portNum port number
* @param treatment treatment that will be applied to the interface
+ * @param meta optional data to pass to the driver
*/
public PortNextObjectiveStoreKey(DeviceId deviceId, PortNumber portNum,
- TrafficTreatment treatment) {
+ TrafficTreatment treatment,
+ TrafficSelector meta) {
this.deviceId = deviceId;
this.portNum = portNum;
this.treatment = treatment;
+ this.meta = meta;
}
/**
@@ -73,6 +78,16 @@
return treatment;
}
+ /**
+ * Gets metadata information in this PortNextObjectiveStoreKey.
+ *
+ * @return meta information
+ */
+ public TrafficSelector meta() {
+ return meta;
+ }
+
+
@Override
public boolean equals(Object o) {
if (this == o) {
@@ -85,16 +100,19 @@
(PortNextObjectiveStoreKey) o;
return (Objects.equals(this.deviceId, that.deviceId) &&
Objects.equals(this.portNum, that.portNum) &&
- Objects.equals(this.treatment, that.treatment));
+ Objects.equals(this.treatment, that.treatment) &&
+ Objects.equals(this.meta, that.meta));
}
@Override
public int hashCode() {
- return Objects.hash(deviceId, portNum, treatment);
+ return Objects.hash(deviceId, portNum, treatment, meta);
}
@Override
public String toString() {
- return "Device: " + deviceId + " Port: " + portNum + " Treatment: " + treatment;
+ return "Device: " + deviceId + " Port: " + portNum +
+ " Treatment: " + treatment +
+ " Meta: " + meta;
}
}