2 * Copyright 2016-2017, Nokia Corporation
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.vnfm.notification;
18 import com.nokia.cbam.lcm.v32.model.ChangeType;
20 import java.util.Objects;
23 * Represent a single port change in the VNF
25 public class ReportedAffectedCp {
26 private String providerId;
28 private String ecpdId;
29 private String cpId; //the location of the resource in the Heat stack
30 private String tenantId;
31 private String ipAddress;
32 private String macAddress;
33 private String serverProviderId;
35 private String networkProviderId;
36 private ChangeType changeType;
39 * @return the provider id of the port
41 public String getProviderId() {
46 * @param providerId the provider id of the port
48 public void setProviderId(String providerId) {
49 this.providerId = providerId;
53 * @return the identifier of the connection point of the port (may be null)
55 public String getCpdId() {
60 * @param cpdId the identifier of the connection point of the port (may be null)
62 public void setCpdId(String cpdId) {
67 * @return the identifier of the external connection point of the port (may be null)
69 public String getEcpdId() {
74 * @param ecpdId the identifier of the connection point of the port (may be null)
76 public void setEcpdId(String ecpdId) {
81 * @return the identifier of the connection point instance of the port
83 public String getCpId() {
88 * @param cpId the identifier of the connection point instance of the port
90 public void setCpId(String cpId) {
95 * @return the identifier of the tenant owning the port
97 public String getTenantId() {
102 * @param tenantId the identifier of the tenant owning the port
104 public void setTenantId(String tenantId) {
105 this.tenantId = tenantId;
109 * @return the IP address of the port (may be null)
111 public String getIpAddress() {
116 * @param ipAddress the IP address of the port (may be null)
118 public void setIpAddress(String ipAddress) {
119 this.ipAddress = ipAddress;
123 * @return the MAC address of the port
125 public String getMacAddress() {
130 * @param macAddress the MAC address of the port
132 public void setMacAddress(String macAddress) {
133 this.macAddress = macAddress;
137 * @return the provider id of the server to which the port is attached to (may be null)
139 public String getServerProviderId() {
140 return serverProviderId;
144 * @param serverProviderId the provider id of the server to which the port is attached to (may be null)
146 public void setServerProviderId(String serverProviderId) {
147 this.serverProviderId = serverProviderId;
151 * @return the name of the port (may be null)
153 public String getName() {
158 * @param name the name of the port
160 public void setName(String name) {
165 * @return the provider id of the network of the port
167 public String getNetworkProviderId() {
168 return networkProviderId;
172 * @param networkProviderId the provider id of the network of the port
174 public void setNetworkProviderId(String networkProviderId) {
175 this.networkProviderId = networkProviderId;
179 * @return the state of the port in the current operation
181 public ChangeType getChangeType() {
186 * @param changeType the state of the port in the current operation
188 public void setChangeType(ChangeType changeType) {
189 this.changeType = changeType;
193 public String toString() {
194 return "ReportedAffectedCp{" +
195 "providerId='" + providerId + '\'' +
196 ", cpdId='" + cpdId + '\'' +
197 ", ecpdId='" + ecpdId + '\'' +
198 ", cpId='" + cpId + '\'' +
199 ", tenantId='" + tenantId + '\'' +
200 ", ipAddress='" + ipAddress + '\'' +
201 ", macAddress='" + macAddress + '\'' +
202 ", serverProviderId='" + serverProviderId + '\'' +
203 ", name='" + name + '\'' +
204 ", networkProviderId='" + networkProviderId + '\'' +
205 ", changeType=" + changeType +
210 public boolean equals(Object o) {
211 if (this == o) return true;
212 if (o == null || getClass() != o.getClass()) return false;
213 ReportedAffectedCp that = (ReportedAffectedCp) o;
214 return Objects.equals(providerId, that.providerId) &&
215 Objects.equals(cpdId, that.cpdId) &&
216 Objects.equals(ecpdId, that.ecpdId) &&
217 Objects.equals(cpId, that.cpId) &&
218 Objects.equals(tenantId, that.tenantId) &&
219 Objects.equals(ipAddress, that.ipAddress) &&
220 Objects.equals(macAddress, that.macAddress) &&
221 Objects.equals(serverProviderId, that.serverProviderId) &&
222 Objects.equals(name, that.name) &&
223 Objects.equals(networkProviderId, that.networkProviderId) &&
224 changeType == that.changeType;
228 public int hashCode() {
229 return Objects.hash(providerId, cpdId, ecpdId, cpId, tenantId, ipAddress, macAddress, serverProviderId, name, networkProviderId, changeType);