6d265c60ec6cdac4fc6ff66e3c71004d1661d826
[vfc/nfvo/driver/vnfm/svnfm.git] /
1 /*
2  * Copyright 2016-2017, Nokia Corporation
3  *
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
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16 package org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.vnfm.notification;
17
18 import com.nokia.cbam.lcm.v32.model.ChangeType;
19
20 import java.util.Objects;
21
22 /**
23  * Represent a single port change in the VNF
24  */
25 public class ReportedAffectedCp {
26     private String providerId;
27     private String cpdId;
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;
34     private String name;
35     private String networkProviderId;
36
37     /**
38      * @return the provider id of the port
39      */
40     public String getProviderId() {
41         return providerId;
42     }
43
44     /**
45      * @param providerId the provider id of the port
46      */
47     public void setProviderId(String providerId) {
48         this.providerId = providerId;
49     }
50
51     /**
52      * @return the identifier of the connection point of the port (may be null)
53      */
54     public String getCpdId() {
55         return cpdId;
56     }
57
58     /**
59      * @param cpdId the identifier of the connection point of the port (may be null)
60      */
61     public void setCpdId(String cpdId) {
62         this.cpdId = cpdId;
63     }
64
65     /**
66      * @return the identifier of the external connection point of the port (may be null)
67      */
68     public String getEcpdId() {
69         return ecpdId;
70     }
71
72     /**
73      * @param ecpdId the identifier of the connection point of the port (may be null)
74      */
75     public void setEcpdId(String ecpdId) {
76         this.ecpdId = ecpdId;
77     }
78
79     /**
80      * @return the identifier of the connection point instance of the port
81      */
82     public String getCpId() {
83         return cpId;
84     }
85
86     /**
87      * @param cpId the identifier of the connection point instance of the port
88      */
89     public void setCpId(String cpId) {
90         this.cpId = cpId;
91     }
92
93     /**
94      * @return the identifier of the tenant owning the port
95      */
96     public String getTenantId() {
97         return tenantId;
98     }
99
100     /**
101      * @param tenantId the identifier of the tenant owning the port
102      */
103     public void setTenantId(String tenantId) {
104         this.tenantId = tenantId;
105     }
106
107     /**
108      * @return the IP address of the port (may be null)
109      */
110     public String getIpAddress() {
111         return ipAddress;
112     }
113
114     /**
115      * @param ipAddress the IP address of the port (may be null)
116      */
117     public void setIpAddress(String ipAddress) {
118         this.ipAddress = ipAddress;
119     }
120
121     /**
122      * @return the MAC address of the port
123      */
124     public String getMacAddress() {
125         return macAddress;
126     }
127
128     /**
129      * @param macAddress the MAC address of the port
130      */
131     public void setMacAddress(String macAddress) {
132         this.macAddress = macAddress;
133     }
134
135     /**
136      * @return the provider id of the server to which the port is attached to (may be null)
137      */
138     public String getServerProviderId() {
139         return serverProviderId;
140     }
141
142     /**
143      * @param serverProviderId the provider id of the server to which the port is attached to (may be null)
144      */
145     public void setServerProviderId(String serverProviderId) {
146         this.serverProviderId = serverProviderId;
147     }
148
149     /**
150      * @return the name of the port  (may be null)
151      */
152     public String getName() {
153         return name;
154     }
155
156     /**
157      * @param name the name of the port
158      */
159     public void setName(String name) {
160         this.name = name;
161     }
162
163     /**
164      * @return the provider id of the network of the port
165      */
166     public String getNetworkProviderId() {
167         return networkProviderId;
168     }
169
170     /**
171      * @param networkProviderId the provider id of the network of the port
172      */
173     public void setNetworkProviderId(String networkProviderId) {
174         this.networkProviderId = networkProviderId;
175     }
176
177     @Override
178     public String toString() {
179         return "ReportedAffectedCp{" +
180                 "providerId='" + providerId + '\'' +
181                 ", cpdId='" + cpdId + '\'' +
182                 ", ecpdId='" + ecpdId + '\'' +
183                 ", cpId='" + cpId + '\'' +
184                 ", tenantId='" + tenantId + '\'' +
185                 ", ipAddress='" + ipAddress + '\'' +
186                 ", macAddress='" + macAddress + '\'' +
187                 ", serverProviderId='" + serverProviderId + '\'' +
188                 ", name='" + name + '\'' +
189                 ", networkProviderId='" + networkProviderId + '\'' +
190                 '}';
191     }
192
193     @Override
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);
208     }
209
210     @Override
211     public int hashCode() {
212         return Objects.hash(providerId, cpdId, ecpdId, cpId, tenantId, ipAddress, macAddress, serverProviderId, name, networkProviderId);
213     }
214 }