Revert "SEBA-814 To support Multi-Tcont on TT-workflow, SADIS configuration is updated."
This reverts commit 94f12a0bb65f9e9873dcbc482ed97c406edd85e3.
Change-Id: Idec4692c9a856a9511684ea746acdbb5ecd05cb5
diff --git a/api/src/main/java/org/opencord/sadis/SubscriberAndDeviceInformation.java b/api/src/main/java/org/opencord/sadis/SubscriberAndDeviceInformation.java
index 08ab94e..28540a0 100644
--- a/api/src/main/java/org/opencord/sadis/SubscriberAndDeviceInformation.java
+++ b/api/src/main/java/org/opencord/sadis/SubscriberAndDeviceInformation.java
@@ -17,15 +17,22 @@
import org.onlab.packet.Ip4Address;
import org.onlab.packet.MacAddress;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import org.onlab.packet.VlanId;
-import java.util.List;
+import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Represents a unit of information about a subscriber or access device.
*/
public class SubscriberAndDeviceInformation extends BaseInformation {
+
+ @JsonProperty(value = "sTag")
+ VlanId sTag;
+
+ @JsonProperty(value = "cTag")
+ VlanId cTag;
+
@JsonProperty(value = "nasPortId")
String nasPortId;
@@ -50,10 +57,32 @@
@JsonProperty(value = "remoteId")
String remoteId;
- @JsonProperty(value = "uniTagList")
- List<UniTagInformation> uniTagList;
+ @JsonProperty(value = "technologyProfileId")
+ int technologyProfileId = -1;
- public SubscriberAndDeviceInformation() {
+ @JsonProperty(value = "upstreamBandwidthProfile")
+ String upstreamBandwidthProfile;
+
+ @JsonProperty(value = "downstreamBandwidthProfile")
+ String downstreamBandwidthProfile;
+
+ protected SubscriberAndDeviceInformation() {
+ }
+
+ public final VlanId sTag() {
+ return this.sTag;
+ }
+
+ public final void setSTag(final VlanId stag) {
+ this.sTag = stag;
+ }
+
+ public final VlanId cTag() {
+ return this.cTag;
+ }
+
+ public final void setCTag(final VlanId ctag) {
+ this.cTag = ctag;
}
public final String nasPortId() {
@@ -120,14 +149,29 @@
this.remoteId = remoteId;
}
- public final List<UniTagInformation> uniTagList() {
- return this.uniTagList;
+ public final int technologyProfileId() {
+ return this.technologyProfileId;
}
- public final void setUniTagList(final List<UniTagInformation> uniTagList) {
- this.uniTagList = uniTagList;
+ public final void setTechnologyProfileId(final int technologyProfileId) {
+ this.technologyProfileId = technologyProfileId;
}
+ public final String upstreamBandwidthProfile() {
+ return this.upstreamBandwidthProfile;
+ }
+
+ public final void setUpstreamBandwidthProfile(final String upstreamBandwidthProfile) {
+ this.upstreamBandwidthProfile = upstreamBandwidthProfile;
+ }
+
+ public final String downstreamBandwidthProfile() {
+ return this.downstreamBandwidthProfile;
+ }
+
+ public final void setDownstreamBandwidthProfile(final String downstreamBandwidthProfile) {
+ this.downstreamBandwidthProfile = downstreamBandwidthProfile;
+ }
/*
* (non-Javadoc)
@@ -138,16 +182,22 @@
public int hashCode() {
final int prime = 31;
int result = 1;
+ result = prime * result + (this.cTag == null ? 0 : this.cTag.hashCode());
result = prime * result + (this.hardwareIdentifier == null ? 0 : this.hardwareIdentifier.hashCode());
result = prime * result + (this.id == null ? 0 : this.id.hashCode());
result = prime * result + (this.nasPortId == null ? 0 : this.nasPortId.hashCode());
result = prime * result + this.uplinkPort;
+ result = prime * result + (this.sTag == null ? 0 : this.sTag.hashCode());
result = prime * result + this.slot;
result = prime * result + (this.ipAddress == null ? 0 : this.ipAddress.hashCode());
result = prime * result + (this.nasId == null ? 0 : this.nasId.hashCode());
result = prime + result + (this.circuitId == null ? 0 : this.circuitId.hashCode());
result = prime + result + (this.remoteId == null ? 0 : this.remoteId.hashCode());
- result = prime + result + (this.uniTagList == null ? 0 : this.uniTagList.hashCode());
+ result = prime + result + this.technologyProfileId;
+ result = prime + result +
+ (this.upstreamBandwidthProfile == null ? 0 : this.upstreamBandwidthProfile.hashCode());
+ result = prime + result +
+ (this.downstreamBandwidthProfile == null ? 0 : this.downstreamBandwidthProfile.hashCode());
return result;
}
@@ -168,7 +218,13 @@
return false;
}
final SubscriberAndDeviceInformation other = (SubscriberAndDeviceInformation) obj;
-
+ if (this.cTag == null) {
+ if (other.cTag != null) {
+ return false;
+ }
+ } else if (!this.cTag.equals(other.cTag)) {
+ return false;
+ }
if (this.hardwareIdentifier == null) {
if (other.hardwareIdentifier != null) {
return false;
@@ -207,7 +263,13 @@
if (this.uplinkPort != other.uplinkPort) {
return false;
}
-
+ if (this.sTag == null) {
+ if (other.sTag != null) {
+ return false;
+ }
+ } else if (!this.sTag.equals(other.sTag)) {
+ return false;
+ }
if (this.slot != other.slot) {
return false;
}
@@ -225,11 +287,21 @@
} else if (!this.remoteId.equals(other.remoteId)) {
return false;
}
- if (this.uniTagList == null) {
- if (other.uniTagList != null) {
+ if (this.technologyProfileId != other.technologyProfileId) {
+ return false;
+ }
+ if (this.upstreamBandwidthProfile == null) {
+ if (other.upstreamBandwidthProfile != null) {
return false;
}
- } else if (!this.uniTagList.equals(other.uniTagList)) {
+ } else if (!this.upstreamBandwidthProfile.equals(other.upstreamBandwidthProfile)) {
+ return false;
+ }
+ if (this.downstreamBandwidthProfile == null) {
+ if (other.downstreamBandwidthProfile != null) {
+ return false;
+ }
+ } else if (!this.downstreamBandwidthProfile.equals(other.downstreamBandwidthProfile)) {
return false;
}
return true;
@@ -244,16 +316,34 @@
public String toString() {
final StringBuilder buf = new StringBuilder();
buf.append('[');
- buf.append("id:").append(this.id);
- buf.append(",nasPortId:").append(this.nasPortId);
- buf.append(",uplinkPort:").append(this.uplinkPort);
- buf.append(",slot:").append(this.slot);
- buf.append(",hardwareIdentifier:").append(this.hardwareIdentifier);
- buf.append(",ipaddress:").append(this.ipAddress);
- buf.append(",nasId:").append(this.nasId);
- buf.append(",circuitId:").append(this.circuitId);
- buf.append(",remoteId:").append(this.remoteId);
- buf.append(",uniTagList:").append(this.uniTagList);
+ buf.append("id:");
+ buf.append(this.id);
+ buf.append(",cTag:");
+ buf.append(this.cTag);
+ buf.append(",sTag:");
+ buf.append(this.sTag);
+ buf.append(",nasPortId:");
+ buf.append(this.nasPortId);
+ buf.append(",uplinkPort:");
+ buf.append(this.uplinkPort);
+ buf.append(",slot:");
+ buf.append(this.slot);
+ buf.append(",hardwareIdentifier:");
+ buf.append(this.hardwareIdentifier);
+ buf.append(",ipaddress:");
+ buf.append(this.ipAddress);
+ buf.append(",nasId:");
+ buf.append(this.nasId);
+ buf.append(",circuitId:");
+ buf.append(this.circuitId);
+ buf.append(",remoteId:");
+ buf.append(this.remoteId);
+ buf.append(",technologyProfileId:");
+ buf.append(this.technologyProfileId);
+ buf.append(",upstreamBandwidthProfile:");
+ buf.append(this.upstreamBandwidthProfile);
+ buf.append(",downstreamBandwidthProfile:");
+ buf.append(this.downstreamBandwidthProfile);
buf.append(']');
return buf.toString();
diff --git a/api/src/main/java/org/opencord/sadis/UniTagInformation.java b/api/src/main/java/org/opencord/sadis/UniTagInformation.java
deleted file mode 100644
index 8bdde45..0000000
--- a/api/src/main/java/org/opencord/sadis/UniTagInformation.java
+++ /dev/null
@@ -1,361 +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.opencord.sadis;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import org.onlab.packet.VlanId;
-
-/**
- * Represents a unit of information about a service.
- */
-public final class UniTagInformation {
-
- @JsonProperty(value = "uniTagMatch")
- private VlanId uniTagMatch = VlanId.NONE;
-
- @JsonProperty(value = "ponCTag")
- private VlanId ponCTag;
-
- @JsonProperty(value = "ponSTag")
- private VlanId ponSTag;
-
- @JsonProperty(value = "usPonCTagPriority")
- private int usPonCTagPriority = -1;
-
- @JsonProperty(value = "usPonSTagPriority")
- private int usPonSTagPriority = -1;
-
- @JsonProperty(value = "dsPonCTagPriority")
- private int dsPonCTagPriority = -1;
-
- @JsonProperty(value = "dsPonSTagPriority")
- private int dsPonSTagPriority = -1;
-
- @JsonProperty(value = "technologyProfileId")
- private int technologyProfileId = -1;
-
- @JsonProperty(value = "upstreamBandwidthProfile")
- private String upstreamBandwidthProfile;
-
- @JsonProperty(value = "downstreamBandwidthProfile")
- private String downstreamBandwidthProfile;
-
- @JsonProperty(value = "serviceName")
- private String serviceName;
-
- @JsonProperty(value = "enableMacLearning")
- private boolean enableMacLearning = false;
-
- @JsonProperty(value = "configuredMacAddress")
- private String configuredMacAddress;
-
- @JsonProperty(value = "isDhcpRequired")
- private boolean isDhcpRequired;
-
- @JsonProperty(value = "isIgmpRequired")
- private boolean isIgmpRequired;
-
- public UniTagInformation() {
-
- }
-
- private UniTagInformation(final VlanId uniTagMatch, final VlanId ponCTag, final VlanId ponSTag,
- final int usPonCTagPriority, final int usPonSTagPriority,
- final int dsPonCTagPriority, final int dsPonSTagPriority,
- final int technologyProfileId,
- final String upstreamBandwidthProfile, final String downstreamBandwidthProfile,
- final String serviceName, final boolean enableMacLearning,
- final String configuredMacAddress, final boolean isDhcpRequired,
- final boolean isIgmpRequired) {
- this.uniTagMatch = uniTagMatch;
- this.ponCTag = ponCTag;
- this.ponSTag = ponSTag;
- this.usPonCTagPriority = usPonCTagPriority;
- this.usPonSTagPriority = usPonSTagPriority;
- this.dsPonCTagPriority = dsPonCTagPriority;
- this.dsPonSTagPriority = dsPonSTagPriority;
- this.technologyProfileId = technologyProfileId;
- this.upstreamBandwidthProfile = upstreamBandwidthProfile;
- this.downstreamBandwidthProfile = downstreamBandwidthProfile;
- this.serviceName = serviceName;
- this.enableMacLearning = enableMacLearning;
- this.configuredMacAddress = configuredMacAddress;
- this.isDhcpRequired = isDhcpRequired;
- this.isIgmpRequired = isIgmpRequired;
- }
-
- public final VlanId getUniTagMatch() {
- return uniTagMatch;
- }
-
- public final VlanId getPonCTag() {
- return ponCTag;
- }
-
- public final VlanId getPonSTag() {
- return ponSTag;
- }
-
- public final int getUsPonCTagPriority() {
- return usPonCTagPriority;
- }
-
- public final int getUsPonSTagPriority() {
- return usPonSTagPriority;
- }
-
- public final int getDsPonCTagPriority() {
- return dsPonCTagPriority;
- }
-
- public final int getDsPonSTagPriority() {
- return dsPonSTagPriority;
- }
-
- public final int getTechnologyProfileId() {
- return technologyProfileId;
- }
-
- public final String getUpstreamBandwidthProfile() {
- return upstreamBandwidthProfile;
- }
-
- public final String getDownstreamBandwidthProfile() {
- return downstreamBandwidthProfile;
- }
-
- public final String getServiceName() {
- return serviceName;
- }
-
- public final boolean getEnableMacLearning() {
- return enableMacLearning;
- }
-
- public final String getConfiguredMacAddress() {
- return configuredMacAddress;
- }
-
- public final boolean getIsDhcpRequired() {
- return isDhcpRequired;
- }
-
- public final boolean getIsIgmpRequired() {
- return isIgmpRequired;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
-
- UniTagInformation that = (UniTagInformation) o;
-
- if (uniTagMatch != that.uniTagMatch) {
- return false;
- }
- if (technologyProfileId != that.technologyProfileId) {
- return false;
- }
- if (ponCTag != that.ponCTag) {
- return false;
- }
- if (ponSTag != that.ponSTag) {
- return false;
- }
- if (usPonCTagPriority != that.usPonCTagPriority) {
- return false;
- }
- if (usPonSTagPriority != that.usPonSTagPriority) {
- return false;
- }
- if (dsPonCTagPriority != that.dsPonCTagPriority) {
- return false;
- }
- if (dsPonSTagPriority != that.dsPonSTagPriority) {
- return false;
- }
- if (enableMacLearning != that.enableMacLearning) {
- return false;
- }
- if (configuredMacAddress != that.configuredMacAddress) {
- return false;
- }
- if (isDhcpRequired != that.isDhcpRequired) {
- return false;
- }
- if (isIgmpRequired != that.isIgmpRequired) {
- return false;
- }
- if (upstreamBandwidthProfile != null ? !upstreamBandwidthProfile.equals(that.upstreamBandwidthProfile) :
- that.upstreamBandwidthProfile != null) {
- return false;
- }
- if (downstreamBandwidthProfile != null ? !downstreamBandwidthProfile.equals(that.downstreamBandwidthProfile) :
- that.downstreamBandwidthProfile != null) {
- return false;
- }
- return serviceName != null ? serviceName.equals(that.serviceName) : that.serviceName == null;
- }
-
- @Override
- public int hashCode() {
- int result = uniTagMatch != null ? uniTagMatch.hashCode() : 0;
- result = 31 * result + (ponCTag != null ? ponCTag.hashCode() : 0);
- result = 31 * result + (ponSTag != null ? ponSTag.hashCode() : 0);
- result = 31 * result + usPonCTagPriority;
- result = 31 * result + usPonSTagPriority;
- result = 31 * result + dsPonCTagPriority;
- result = 31 * result + dsPonSTagPriority;
- result = 31 * result + technologyProfileId;
- result = 31 * result + (upstreamBandwidthProfile != null ? upstreamBandwidthProfile.hashCode() : 0);
- result = 31 * result + (downstreamBandwidthProfile != null ? downstreamBandwidthProfile.hashCode() : 0);
- result = 31 * result + (serviceName != null ? serviceName.hashCode() : 0);
- result = 31 * result + (enableMacLearning ? 1 : 0);
- result = 31 * result + (configuredMacAddress != null ? configuredMacAddress.hashCode() : 0);
- result = 31 * result + (isDhcpRequired ? 1 : 0);
- result = 31 * result + (isIgmpRequired ? 1 : 0);
- return result;
- }
-
- @Override
- public String toString() {
- final StringBuilder sb = new StringBuilder("UniTagInformation{");
- sb.append("uniTagMatch=").append(uniTagMatch);
- sb.append(", ponCTag=").append(ponCTag);
- sb.append(", ponSTag=").append(ponSTag);
- sb.append(", usPonCTagPriority=").append(usPonCTagPriority);
- sb.append(", usPonSTagPriority=").append(usPonSTagPriority);
- sb.append(", dsPonCTagPriority=").append(dsPonCTagPriority);
- sb.append(", dsPonSTagPriority=").append(dsPonSTagPriority);
- sb.append(", technologyProfileId=").append(technologyProfileId);
- sb.append(", enableMacLearning=").append(enableMacLearning);
- sb.append(", upstreamBandwidthProfile='").append(upstreamBandwidthProfile).append('\'');
- sb.append(", downstreamBandwidthProfile='").append(downstreamBandwidthProfile).append('\'');
- sb.append(", serviceName='").append(serviceName).append('\'');
- sb.append(", configuredMacAddress='").append(configuredMacAddress).append('\'');
- sb.append(", isDhcpRequired=").append(isDhcpRequired);
- sb.append(", isIgmpRequired=").append(isIgmpRequired);
- sb.append('}');
- return sb.toString();
- }
-
- public static final class Builder {
-
- private VlanId uniTagMatch;
- private VlanId ponCTag;
- private VlanId ponSTag;
- private int usPonCTagPriority;
- private int usPonSTagPriority;
- private int dsPonCTagPriority;
- private int dsPonSTagPriority;
- private int technologyProfileId;
- private String upstreamBandwidthProfile;
- private String downstreamBandwidthProfile;
- private String serviceName;
- private boolean enableMacLearning;
- private String configuredMacAddress;
- private boolean isDhcpRequired;
- private boolean isIgmpRequired;
-
- public final Builder setUniTagMatch(final VlanId uniTagMatch) {
- this.uniTagMatch = uniTagMatch;
- return this;
- }
-
- public final Builder setPonCTag(final VlanId ponCTag) {
- this.ponCTag = ponCTag;
- return this;
- }
-
- public final Builder setPonSTag(final VlanId ponSTag) {
- this.ponSTag = ponSTag;
- return this;
- }
-
- public final Builder setUsPonCTagPriority(final int usPonCTagPriority) {
- this.usPonCTagPriority = usPonCTagPriority;
- return this;
- }
-
- public final Builder setUsPonSTagPriority(final int usPonSTagPriority) {
- this.usPonSTagPriority = usPonSTagPriority;
- return this;
- }
-
- public final Builder setDsPonCTagPriority(final int dsPonCTagPriority) {
- this.dsPonCTagPriority = dsPonCTagPriority;
- return this;
- }
-
- public final Builder setDsPonSTagPriority(final int dsPonSTagPriority) {
- this.dsPonSTagPriority = dsPonSTagPriority;
- return this;
- }
-
- public final Builder setTechnologyProfileId(final int technologyProfileId) {
- this.technologyProfileId = technologyProfileId;
- return this;
- }
-
- public final Builder setUpstreamBandwidthProfile(final String upstreamBandwidthProfile) {
- this.upstreamBandwidthProfile = upstreamBandwidthProfile;
- return this;
- }
-
- public final Builder setDownstreamBandwidthProfile(final String downstreamBandwidthProfile) {
- this.downstreamBandwidthProfile = downstreamBandwidthProfile;
- return this;
- }
-
- public final Builder setServiceName(final String serviceName) {
- this.serviceName = serviceName;
- return this;
- }
-
- public final Builder setEnableMacLearning(final boolean enableMacLearning) {
- this.enableMacLearning = enableMacLearning;
- return this;
- }
-
- public final Builder setConfiguredMacAddress(final String configuredMacAddress) {
- this.configuredMacAddress = configuredMacAddress;
- return this;
- }
-
- public final Builder setIsDhcpRequired(final boolean isDhcpRequired) {
- this.isDhcpRequired = isDhcpRequired;
- return this;
- }
-
- public final Builder setIsIgmpRequired(final boolean isIgmpRequired) {
- this.isIgmpRequired = isIgmpRequired;
- return this;
- }
-
- public final UniTagInformation build() {
- return new UniTagInformation(this.uniTagMatch, this.ponCTag,
- this.ponSTag, this.usPonCTagPriority, this.usPonSTagPriority,
- this.dsPonCTagPriority, this.dsPonSTagPriority, this.technologyProfileId,
- this.upstreamBandwidthProfile, this.downstreamBandwidthProfile, this.serviceName,
- this.enableMacLearning, this.configuredMacAddress, this.isDhcpRequired, this.isIgmpRequired);
- }
- }
-}