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 java.util.Objects;
21 * Represent a single port change in the VNF
23 public class ReportedAffectedCp {
24 private String providerId;
26 private String ecpdId;
27 private String cpId; //the location of the resource in the Heat stack
28 private String tenantId;
29 private String ipAddress;
30 private String macAddress;
31 private String serverProviderId;
33 private String networkProviderId;
36 * @return the provider id of the port
38 public String getProviderId() {
43 * @param providerId the provider id of the port
45 public void setProviderId(String providerId) {
46 this.providerId = providerId;
50 * @return the identifier of the connection point of the port (may be null)
52 public String getCpdId() {
57 * @param cpdId the identifier of the connection point of the port (may be null)
59 public void setCpdId(String cpdId) {
64 * @return the identifier of the external connection point of the port (may be null)
66 public String getEcpdId() {
71 * @param ecpdId the identifier of the connection point of the port (may be null)
73 public void setEcpdId(String ecpdId) {
78 * @return the identifier of the connection point instance of the port
80 public String getCpId() {
85 * @param cpId the identifier of the connection point instance of the port
87 public void setCpId(String cpId) {
92 * @return the identifier of the tenant owning the port
94 public String getTenantId() {
99 * @param tenantId the identifier of the tenant owning the port
101 public void setTenantId(String tenantId) {
102 this.tenantId = tenantId;
106 * @return the IP address of the port (may be null)
108 public String getIpAddress() {
113 * @param ipAddress the IP address of the port (may be null)
115 public void setIpAddress(String ipAddress) {
116 this.ipAddress = ipAddress;
120 * @return the MAC address of the port
122 public String getMacAddress() {
127 * @param macAddress the MAC address of the port
129 public void setMacAddress(String macAddress) {
130 this.macAddress = macAddress;
134 * @return the provider id of the server to which the port is attached to (may be null)
136 public String getServerProviderId() {
137 return serverProviderId;
141 * @param serverProviderId the provider id of the server to which the port is attached to (may be null)
143 public void setServerProviderId(String serverProviderId) {
144 this.serverProviderId = serverProviderId;
148 * @return the name of the port (may be null)
150 public String getName() {
155 * @param name the name of the port
157 public void setName(String name) {
162 * @return the provider id of the network of the port
164 public String getNetworkProviderId() {
165 return networkProviderId;
169 * @param networkProviderId the provider id of the network of the port
171 public void setNetworkProviderId(String networkProviderId) {
172 this.networkProviderId = networkProviderId;
176 public String toString() {
177 return "ReportedAffectedCp{" +
178 "providerId='" + providerId + '\'' +
179 ", cpdId='" + cpdId + '\'' +
180 ", ecpdId='" + ecpdId + '\'' +
181 ", cpId='" + cpId + '\'' +
182 ", tenantId='" + tenantId + '\'' +
183 ", ipAddress='" + ipAddress + '\'' +
184 ", macAddress='" + macAddress + '\'' +
185 ", serverProviderId='" + serverProviderId + '\'' +
186 ", name='" + name + '\'' +
187 ", networkProviderId='" + networkProviderId + '\'' +
192 //generated code. This is the recommended way to formulate equals
193 @SuppressWarnings({"squid:S00122", "squid:S1067"})
194 public boolean equals(Object o) {
195 if (this == o) return true;
196 if (o == null || getClass() != o.getClass()) return false;
197 ReportedAffectedCp that = (ReportedAffectedCp) o;
198 return Objects.equals(providerId, that.providerId) &&
199 Objects.equals(cpdId, that.cpdId) &&
200 Objects.equals(ecpdId, that.ecpdId) &&
201 Objects.equals(cpId, that.cpId) &&
202 Objects.equals(tenantId, that.tenantId) &&
203 Objects.equals(ipAddress, that.ipAddress) &&
204 Objects.equals(macAddress, that.macAddress) &&
205 Objects.equals(serverProviderId, that.serverProviderId) &&
206 Objects.equals(name, that.name) &&
207 Objects.equals(networkProviderId, that.networkProviderId);
211 public int hashCode() {
212 return Objects.hash(providerId, cpdId, ecpdId, cpId, tenantId, ipAddress, macAddress, serverProviderId, name, networkProviderId);