Updating Nokia driver
[vfc/nfvo/driver/vnfm/svnfm.git] / nokiav2 / driver / src / main / java / org / onap / vfc / nfvo / driver / vnfm / svnfm / nokia / vnfm / notification / ReportedAffectedCp.java
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     private ChangeType changeType;
37
38     /**
39      * @return the provider id of the port
40      */
41     public String getProviderId() {
42         return providerId;
43     }
44
45     /**
46      * @param providerId the provider id of the port
47      */
48     public void setProviderId(String providerId) {
49         this.providerId = providerId;
50     }
51
52     /**
53      * @return the identifier of the connection point of the port (may be null)
54      */
55     public String getCpdId() {
56         return cpdId;
57     }
58
59     /**
60      * @param cpdId the identifier of the connection point of the port (may be null)
61      */
62     public void setCpdId(String cpdId) {
63         this.cpdId = cpdId;
64     }
65
66     /**
67      * @return the identifier of the external connection point of the port (may be null)
68      */
69     public String getEcpdId() {
70         return ecpdId;
71     }
72
73     /**
74      * @param ecpdId the identifier of the connection point of the port (may be null)
75      */
76     public void setEcpdId(String ecpdId) {
77         this.ecpdId = ecpdId;
78     }
79
80     /**
81      * @return the identifier of the connection point instance of the port
82      */
83     public String getCpId() {
84         return cpId;
85     }
86
87     /**
88      * @param cpId the identifier of the connection point instance of the port
89      */
90     public void setCpId(String cpId) {
91         this.cpId = cpId;
92     }
93
94     /**
95      * @return the identifier of the tenant owning the port
96      */
97     public String getTenantId() {
98         return tenantId;
99     }
100
101     /**
102      * @param tenantId the identifier of the tenant owning the port
103      */
104     public void setTenantId(String tenantId) {
105         this.tenantId = tenantId;
106     }
107
108     /**
109      * @return the IP address of the port (may be null)
110      */
111     public String getIpAddress() {
112         return ipAddress;
113     }
114
115     /**
116      * @param ipAddress the IP address of the port (may be null)
117      */
118     public void setIpAddress(String ipAddress) {
119         this.ipAddress = ipAddress;
120     }
121
122     /**
123      * @return the MAC address of the port
124      */
125     public String getMacAddress() {
126         return macAddress;
127     }
128
129     /**
130      * @param macAddress the MAC address of the port
131      */
132     public void setMacAddress(String macAddress) {
133         this.macAddress = macAddress;
134     }
135
136     /**
137      * @return the provider id of the server to which the port is attached to (may be null)
138      */
139     public String getServerProviderId() {
140         return serverProviderId;
141     }
142
143     /**
144      * @param serverProviderId the provider id of the server to which the port is attached to (may be null)
145      */
146     public void setServerProviderId(String serverProviderId) {
147         this.serverProviderId = serverProviderId;
148     }
149
150     /**
151      * @return the name of the port  (may be null)
152      */
153     public String getName() {
154         return name;
155     }
156
157     /**
158      * @param name the name of the port
159      */
160     public void setName(String name) {
161         this.name = name;
162     }
163
164     /**
165      * @return the provider id of the network of the port
166      */
167     public String getNetworkProviderId() {
168         return networkProviderId;
169     }
170
171     /**
172      * @param networkProviderId the provider id of the network of the port
173      */
174     public void setNetworkProviderId(String networkProviderId) {
175         this.networkProviderId = networkProviderId;
176     }
177
178     /**
179      * @return the state of the port in the current operation
180      */
181     public ChangeType getChangeType() {
182         return changeType;
183     }
184
185     /**
186      * @param changeType the state of the port in the current operation
187      */
188     public void setChangeType(ChangeType changeType) {
189         this.changeType = changeType;
190     }
191
192     @Override
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 +
206                 '}';
207     }
208
209     @Override
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;
225     }
226
227     @Override
228     public int hashCode() {
229         return Objects.hash(providerId, cpdId, ecpdId, cpId, tenantId, ipAddress, macAddress, serverProviderId, name, networkProviderId, changeType);
230     }
231 }