added generic fabric support to SO
[so.git] / bpmn / MSOCommonBPMN / src / main / java / org / onap / so / bpmn / servicedecomposition / bbobjects / GenericVnf.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.onap.so.bpmn.servicedecomposition.bbobjects;
22
23 import java.io.Serializable;
24 import java.util.ArrayList;
25 import java.util.HashMap;
26 import java.util.List;
27 import java.util.Map;
28
29 import javax.persistence.Id;
30
31 import org.apache.commons.lang3.builder.EqualsBuilder;
32 import org.apache.commons.lang3.builder.HashCodeBuilder;
33 import org.onap.so.bpmn.servicedecomposition.ShallowCopy;
34 import org.onap.so.bpmn.servicedecomposition.generalobjects.License;
35 import org.onap.so.bpmn.servicedecomposition.homingobjects.SolutionInfo;
36 import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoGenericVnf;
37 import org.onap.so.db.catalog.beans.OrchestrationStatus;
38
39 import com.fasterxml.jackson.annotation.JsonProperty;
40 import com.fasterxml.jackson.annotation.JsonRootName;
41
42 @JsonRootName("generic-vnf")
43 public class GenericVnf implements Serializable, ShallowCopy<GenericVnf> {
44
45         private static final long serialVersionUID = -5107610336831330403L;
46
47         @Id
48         @JsonProperty("vnf-id")
49         private String vnfId;
50         @JsonProperty("vnf-name")
51         private String vnfName;
52         @JsonProperty("vnf-type")
53         private String vnfType;
54         @JsonProperty("orchestration-status")
55         private OrchestrationStatus orchestrationStatus;
56         @JsonProperty("vf-modules")
57         private List<VfModule> vfModules = new ArrayList<>();
58         @JsonProperty("volume-groups")
59         private List<VolumeGroup> volumeGroups = new ArrayList<>();
60         @JsonProperty("line-of-business")
61         private LineOfBusiness lineOfBusiness;
62         @JsonProperty("platform")
63         private Platform platform;
64         @JsonProperty("cascaded")
65         private Boolean cascaded;
66         @JsonProperty("cloud-params")
67         private Map<String, String> cloudParams = new HashMap<>();
68         @JsonProperty("cloud-context")
69         private CloudRegion cloudRegion;
70         @JsonProperty("solution")
71         private SolutionInfo solution;
72         @JsonProperty("vnf-name-2")
73         private String vnfName2;
74         @JsonProperty("service-id")
75         private String serviceId;
76         @JsonProperty("regional-resource-zone")
77         private String regionalResourceZone;
78         @JsonProperty("prov-status")
79         private String provStatus;
80         @JsonProperty("operational-status")
81         private String operationalStatus;
82         @JsonProperty("equipment-role")
83         private String equipmentRole;
84         @JsonProperty("management-option")
85         private String managementOption;
86         @JsonProperty("ipv4-oam-address")
87         private String ipv4OamAddress;
88         @JsonProperty("ipv4-loopback0-address")
89         private String ipv4Loopback0Address;
90         @JsonProperty("nm-lan-v6-address")
91         private String nmLanV6Address;
92         @JsonProperty("management-v6-address")
93         private String managementV6Address;
94         @JsonProperty("vcpu")
95         private Long vcpu;
96         @JsonProperty("vcpu-units")
97         private String vcpuUnits;
98         @JsonProperty("vmemory")
99         private Long vmemory;
100         @JsonProperty("vmemory-units")
101         private String vmemoryUnits;
102         @JsonProperty("vdisk")
103         private Long vdisk;
104         @JsonProperty("vdisk-units")
105         private String vdiskUnits;
106         @JsonProperty("in-maint")
107         private Boolean inMaint;
108         @JsonProperty("is-closed-loop-disabled")
109         private Boolean isClosedLoopDisabled;
110         @JsonProperty("summary-status")
111         private String summaryStatus;
112         @JsonProperty("encrypted-access-flag")
113         private Boolean encryptedAccessFlag;
114         @JsonProperty("as-number")
115         private String asNumber;
116         @JsonProperty("regional-resource-subzone")
117         private String regionalResourceSubzone;
118         @JsonProperty("self-link")
119         private String selflink;
120         @JsonProperty("ipv4-oam-gateway-address")
121         private String ipv4OamGatewayAddress;
122         @JsonProperty("ipv4-oam-gateway-address-prefix-length")
123         private Integer ipv4OamGatewayAddressPrefixLength;
124         @JsonProperty("vlan-id-outer")
125         private Long vlanIdOuter;
126         @JsonProperty("nm-profile-name")
127         private String nmProfileName;
128         @JsonProperty("l-interfaces")
129         private List<LInterface> lInterfaces = new ArrayList<>();
130         @JsonProperty("lag-interfaces")
131         private List<LagInterface> lagInterfaces = new ArrayList<>();
132         @JsonProperty("license")
133         private License license;
134         @JsonProperty("entitlements") //TODO remove, duplicated
135         private List<Entitlement> entitlements = new ArrayList<>();
136         @JsonProperty("model-info-generic-vnf")
137         private ModelInfoGenericVnf modelInfoGenericVnf;
138         @JsonProperty("instance-groups")
139     private List<InstanceGroup> instanceGroups = new ArrayList<InstanceGroup>();
140         @JsonProperty("call-homing")
141         private Boolean callHoming;
142         @JsonProperty("nf-function")
143         private String nfFunction;
144         @JsonProperty("nf-role")
145         private String nfRole;
146
147
148         public String getNfFunction() {
149                 return nfFunction;
150         }
151
152         public void setNfFunction(String nfFunction) {
153                 this.nfFunction = nfFunction;
154         }
155
156         public String getNfRole() {
157                 return nfRole;
158         }
159
160         public void setNfRole(String nfRole) {
161                 this.nfRole = nfRole;
162         }
163
164         public List<InstanceGroup> getInstanceGroups() {
165                 return instanceGroups;
166         }
167
168         public List<VolumeGroup> getVolumeGroups() {
169                 return volumeGroups;
170         }
171
172         public ModelInfoGenericVnf getModelInfoGenericVnf() {
173                 return modelInfoGenericVnf;
174         }
175
176         public void setModelInfoGenericVnf(ModelInfoGenericVnf modelInfoGenericVnf) {
177                 this.modelInfoGenericVnf = modelInfoGenericVnf;
178         }
179
180         public String getVnfName2() {
181                 return vnfName2;
182         }
183
184         public void setVnfName2(String vnfName2) {
185                 this.vnfName2 = vnfName2;
186         }
187
188         public String getServiceId() {
189                 return serviceId;
190         }
191
192         public void setServiceId(String serviceId) {
193                 this.serviceId = serviceId;
194         }
195
196         public String getRegionalResourceZone() {
197                 return regionalResourceZone;
198         }
199
200         public void setRegionalResourceZone(String regionalResourceZone) {
201                 this.regionalResourceZone = regionalResourceZone;
202         }
203
204         public String getProvStatus() {
205                 return provStatus;
206         }
207
208         public void setProvStatus(String provStatus) {
209                 this.provStatus = provStatus;
210         }
211
212         public String getOperationalStatus() {
213                 return operationalStatus;
214         }
215
216         public void setOperationalStatus(String operationalStatus) {
217                 this.operationalStatus = operationalStatus;
218         }
219
220         public String getEquipmentRole() {
221                 return equipmentRole;
222         }
223
224         public void setEquipmentRole(String equipmentRole) {
225                 this.equipmentRole = equipmentRole;
226         }
227
228         public String getManagementOption() {
229                 return managementOption;
230         }
231
232         public void setManagementOption(String managementOption) {
233                 this.managementOption = managementOption;
234         }
235
236         public String getIpv4OamAddress() {
237                 return ipv4OamAddress;
238         }
239
240         public void setIpv4OamAddress(String ipv4OamAddress) {
241                 this.ipv4OamAddress = ipv4OamAddress;
242         }
243
244         public String getIpv4Loopback0Address() {
245                 return ipv4Loopback0Address;
246         }
247
248         public void setIpv4Loopback0Address(String ipv4Loopback0Address) {
249                 this.ipv4Loopback0Address = ipv4Loopback0Address;
250         }
251
252         public String getNmLanV6Address() {
253                 return nmLanV6Address;
254         }
255
256         public void setNmLanV6Address(String nmLanV6Address) {
257                 this.nmLanV6Address = nmLanV6Address;
258         }
259
260         public String getManagementV6Address() {
261                 return managementV6Address;
262         }
263
264         public void setManagementV6Address(String managementV6Address) {
265                 this.managementV6Address = managementV6Address;
266         }
267
268         public Long getVcpu() {
269                 return vcpu;
270         }
271
272         public void setVcpu(Long vcpu) {
273                 this.vcpu = vcpu;
274         }
275
276         public String getVcpuUnits() {
277                 return vcpuUnits;
278         }
279
280         public void setVcpuUnits(String vcpuUnits) {
281                 this.vcpuUnits = vcpuUnits;
282         }
283
284         public List<LInterface> getlInterfaces() {
285                 return lInterfaces;
286         }
287
288         public List<LagInterface> getLagInterfaces() {
289                 return lagInterfaces;
290         }
291
292         public List<Entitlement> getEntitlements() {
293                 return entitlements;
294         }
295
296         public List<VfModule> getVfModules() {
297                 return vfModules;
298         }
299
300         public Long getVmemory() {
301                 return vmemory;
302         }
303
304         public void setVmemory(Long vmemory) {
305                 this.vmemory = vmemory;
306         }
307
308         public String getVmemoryUnits() {
309                 return vmemoryUnits;
310         }
311
312         public void setVmemoryUnits(String vmemoryUnits) {
313                 this.vmemoryUnits = vmemoryUnits;
314         }
315
316         public Long getVdisk() {
317                 return vdisk;
318         }
319
320         public void setVdisk(Long vdisk) {
321                 this.vdisk = vdisk;
322         }
323
324         public String getVdiskUnits() {
325                 return vdiskUnits;
326         }
327
328         public void setVdiskUnits(String vdiskUnits) {
329                 this.vdiskUnits = vdiskUnits;
330         }
331
332         public Boolean isInMaint() {
333                 return inMaint;
334         }
335
336         public void setInMaint(Boolean inMaint) {
337                 this.inMaint = inMaint;
338         }
339
340         public Boolean isIsClosedLoopDisabled() {
341                 return isClosedLoopDisabled;
342         }
343
344         public void setClosedLoopDisabled(Boolean isClosedLoopDisabled) {
345                 this.isClosedLoopDisabled = isClosedLoopDisabled;
346         }
347
348         public String getSummaryStatus() {
349                 return summaryStatus;
350         }
351
352         public void setSummaryStatus(String summaryStatus) {
353                 this.summaryStatus = summaryStatus;
354         }
355
356         public Boolean getEncryptedAccessFlag() {
357                 return encryptedAccessFlag;
358         }
359
360         public void setEncryptedAccessFlag(Boolean encryptedAccessFlag) {
361                 this.encryptedAccessFlag = encryptedAccessFlag;
362         }
363
364         public String getAsNumber() {
365                 return asNumber;
366         }
367
368         public void setAsNumber(String asNumber) {
369                 this.asNumber = asNumber;
370         }
371
372         public String getRegionalResourceSubzone() {
373                 return regionalResourceSubzone;
374         }
375
376         public void setRegionalResourceSubzone(String regionalResourceSubzone) {
377                 this.regionalResourceSubzone = regionalResourceSubzone;
378         }
379
380         public License getLicense() {
381                 return license;
382         }
383
384         public void setLicense(License license) {
385                 this.license = license;
386         }
387
388         public String getSelflink() {
389                 return selflink;
390         }
391
392         public void setSelflink(String selflink) {
393                 this.selflink = selflink;
394         }
395
396         public String getIpv4OamGatewayAddress() {
397                 return ipv4OamGatewayAddress;
398         }
399
400         public void setIpv4OamGatewayAddress(String ipv4OamGatewayAddress) {
401                 this.ipv4OamGatewayAddress = ipv4OamGatewayAddress;
402         }
403
404         public Integer getIpv4OamGatewayAddressPrefixLength() {
405                 return ipv4OamGatewayAddressPrefixLength;
406         }
407
408         public void setIpv4OamGatewayAddressPrefixLength(Integer ipv4OamGatewayAddressPrefixLength) {
409                 this.ipv4OamGatewayAddressPrefixLength = ipv4OamGatewayAddressPrefixLength;
410         }
411
412         public Long getVlanIdOuter() {
413                 return vlanIdOuter;
414         }
415
416         public void setVlanIdOuter(Long vlanIdOuter) {
417                 this.vlanIdOuter = vlanIdOuter;
418         }
419
420         public String getNmProfileName() {
421                 return nmProfileName;
422         }
423
424         public void setNmProfileName(String nmProfileName) {
425                 this.nmProfileName = nmProfileName;
426         }
427
428         public String getVnfId() {
429                 return vnfId;
430         }
431
432         public void setVnfId(String vnfId) {
433                 this.vnfId = vnfId;
434         }
435
436         public String getVnfName() {
437                 return vnfName;
438         }
439
440         public void setVnfName(String vnfName) {
441                 this.vnfName = vnfName;
442         }
443
444         public String getVnfType() {
445                 return vnfType;
446         }
447
448         public void setVnfType(String vnfType) {
449                 this.vnfType = vnfType;
450         }
451
452         public OrchestrationStatus getOrchestrationStatus() {
453                 return orchestrationStatus;
454         }
455
456         public void setOrchestrationStatus(OrchestrationStatus orchestrationStatus) {
457                 this.orchestrationStatus = orchestrationStatus;
458         }
459
460         public LineOfBusiness getLineOfBusiness() {
461                 return lineOfBusiness;
462         }
463
464         public void setLineOfBusiness(LineOfBusiness lineOfBusiness) {
465                 this.lineOfBusiness = lineOfBusiness;
466         }
467
468         public Platform getPlatform() {
469                 return platform;
470         }
471
472         public void setPlatform(Platform platform) {
473                 this.platform = platform;
474         }
475
476         public Boolean isCascaded() {
477                 return cascaded;
478         }
479
480         public void setCascaded(Boolean cascaded) {
481                 this.cascaded = cascaded;
482         }
483
484         public Map<String, String> getCloudParams() {
485                 return cloudParams;
486         }
487
488         public void setCloudParams(Map<String, String> cloudParams) {
489                 this.cloudParams = cloudParams;
490         }
491
492         public SolutionInfo getSolution() {
493                 return solution;
494         }
495
496         public void setSolution(SolutionInfo solution) {
497                 this.solution = solution;
498         }
499
500         public CloudRegion getCloudRegion() {
501                 return cloudRegion;
502         }
503
504         public void setCloudRegion(CloudRegion cloudRegion) {
505                 this.cloudRegion = cloudRegion;
506         }
507
508         public Boolean isCallHoming() {
509                 return callHoming;
510         }
511
512         public void setCallHoming(Boolean callHoming) {
513                         this.callHoming = callHoming;
514         }
515
516         @Override
517         public boolean equals(final Object other) {
518                 if (!(other instanceof GenericVnf)) {
519                         return false;
520                 }
521                 GenericVnf castOther = (GenericVnf) other;
522                 return new EqualsBuilder().append(vnfId, castOther.vnfId).isEquals();
523         }
524
525         @Override
526         public int hashCode() {
527                 return new HashCodeBuilder().append(vnfId).toHashCode();
528         }
529
530 }