c6e7668f229bd71e7bd8623c1fb5c4a592534fef
[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         @JsonProperty("CDS_BLUEPRINT_NAME")
147         private String blueprintName;
148         @JsonProperty("CDS_BLUEPRINT_VERSION")
149         private String blueprintVersion;
150
151
152         public String getBlueprintName() {
153                 return blueprintName;
154         }
155
156         public void setBlueprintName(String blueprintName) {
157                 this.blueprintName = blueprintName;
158         }
159
160         public String getBlueprintVersion() {
161                 return blueprintVersion;
162         }
163
164         public void setBlueprintVersion(String blueprintVersion) {
165                 this.blueprintVersion = blueprintVersion;
166         }
167
168         public String getNfFunction() {
169                 return nfFunction;
170         }
171
172         public void setNfFunction(String nfFunction) {
173                 this.nfFunction = nfFunction;
174         }
175
176         public String getNfRole() {
177                 return nfRole;
178         }
179
180         public void setNfRole(String nfRole) {
181                 this.nfRole = nfRole;
182         }
183
184         public List<InstanceGroup> getInstanceGroups() {
185                 return instanceGroups;
186         }
187
188         public List<VolumeGroup> getVolumeGroups() {
189                 return volumeGroups;
190         }
191
192         public ModelInfoGenericVnf getModelInfoGenericVnf() {
193                 return modelInfoGenericVnf;
194         }
195
196         public void setModelInfoGenericVnf(ModelInfoGenericVnf modelInfoGenericVnf) {
197                 this.modelInfoGenericVnf = modelInfoGenericVnf;
198         }
199
200         public String getVnfName2() {
201                 return vnfName2;
202         }
203
204         public void setVnfName2(String vnfName2) {
205                 this.vnfName2 = vnfName2;
206         }
207
208         public String getServiceId() {
209                 return serviceId;
210         }
211
212         public void setServiceId(String serviceId) {
213                 this.serviceId = serviceId;
214         }
215
216         public String getRegionalResourceZone() {
217                 return regionalResourceZone;
218         }
219
220         public void setRegionalResourceZone(String regionalResourceZone) {
221                 this.regionalResourceZone = regionalResourceZone;
222         }
223
224         public String getProvStatus() {
225                 return provStatus;
226         }
227
228         public void setProvStatus(String provStatus) {
229                 this.provStatus = provStatus;
230         }
231
232         public String getOperationalStatus() {
233                 return operationalStatus;
234         }
235
236         public void setOperationalStatus(String operationalStatus) {
237                 this.operationalStatus = operationalStatus;
238         }
239
240         public String getEquipmentRole() {
241                 return equipmentRole;
242         }
243
244         public void setEquipmentRole(String equipmentRole) {
245                 this.equipmentRole = equipmentRole;
246         }
247
248         public String getManagementOption() {
249                 return managementOption;
250         }
251
252         public void setManagementOption(String managementOption) {
253                 this.managementOption = managementOption;
254         }
255
256         public String getIpv4OamAddress() {
257                 return ipv4OamAddress;
258         }
259
260         public void setIpv4OamAddress(String ipv4OamAddress) {
261                 this.ipv4OamAddress = ipv4OamAddress;
262         }
263
264         public String getIpv4Loopback0Address() {
265                 return ipv4Loopback0Address;
266         }
267
268         public void setIpv4Loopback0Address(String ipv4Loopback0Address) {
269                 this.ipv4Loopback0Address = ipv4Loopback0Address;
270         }
271
272         public String getNmLanV6Address() {
273                 return nmLanV6Address;
274         }
275
276         public void setNmLanV6Address(String nmLanV6Address) {
277                 this.nmLanV6Address = nmLanV6Address;
278         }
279
280         public String getManagementV6Address() {
281                 return managementV6Address;
282         }
283
284         public void setManagementV6Address(String managementV6Address) {
285                 this.managementV6Address = managementV6Address;
286         }
287
288         public Long getVcpu() {
289                 return vcpu;
290         }
291
292         public void setVcpu(Long vcpu) {
293                 this.vcpu = vcpu;
294         }
295
296         public String getVcpuUnits() {
297                 return vcpuUnits;
298         }
299
300         public void setVcpuUnits(String vcpuUnits) {
301                 this.vcpuUnits = vcpuUnits;
302         }
303
304         public List<LInterface> getlInterfaces() {
305                 return lInterfaces;
306         }
307
308         public List<LagInterface> getLagInterfaces() {
309                 return lagInterfaces;
310         }
311
312         public List<Entitlement> getEntitlements() {
313                 return entitlements;
314         }
315
316         public List<VfModule> getVfModules() {
317                 return vfModules;
318         }
319
320         public Long getVmemory() {
321                 return vmemory;
322         }
323
324         public void setVmemory(Long vmemory) {
325                 this.vmemory = vmemory;
326         }
327
328         public String getVmemoryUnits() {
329                 return vmemoryUnits;
330         }
331
332         public void setVmemoryUnits(String vmemoryUnits) {
333                 this.vmemoryUnits = vmemoryUnits;
334         }
335
336         public Long getVdisk() {
337                 return vdisk;
338         }
339
340         public void setVdisk(Long vdisk) {
341                 this.vdisk = vdisk;
342         }
343
344         public String getVdiskUnits() {
345                 return vdiskUnits;
346         }
347
348         public void setVdiskUnits(String vdiskUnits) {
349                 this.vdiskUnits = vdiskUnits;
350         }
351
352         public Boolean isInMaint() {
353                 return inMaint;
354         }
355
356         public void setInMaint(Boolean inMaint) {
357                 this.inMaint = inMaint;
358         }
359
360         public Boolean isIsClosedLoopDisabled() {
361                 return isClosedLoopDisabled;
362         }
363
364         public void setClosedLoopDisabled(Boolean isClosedLoopDisabled) {
365                 this.isClosedLoopDisabled = isClosedLoopDisabled;
366         }
367
368         public String getSummaryStatus() {
369                 return summaryStatus;
370         }
371
372         public void setSummaryStatus(String summaryStatus) {
373                 this.summaryStatus = summaryStatus;
374         }
375
376         public Boolean getEncryptedAccessFlag() {
377                 return encryptedAccessFlag;
378         }
379
380         public void setEncryptedAccessFlag(Boolean encryptedAccessFlag) {
381                 this.encryptedAccessFlag = encryptedAccessFlag;
382         }
383
384         public String getAsNumber() {
385                 return asNumber;
386         }
387
388         public void setAsNumber(String asNumber) {
389                 this.asNumber = asNumber;
390         }
391
392         public String getRegionalResourceSubzone() {
393                 return regionalResourceSubzone;
394         }
395
396         public void setRegionalResourceSubzone(String regionalResourceSubzone) {
397                 this.regionalResourceSubzone = regionalResourceSubzone;
398         }
399
400         public License getLicense() {
401                 return license;
402         }
403
404         public void setLicense(License license) {
405                 this.license = license;
406         }
407
408         public String getSelflink() {
409                 return selflink;
410         }
411
412         public void setSelflink(String selflink) {
413                 this.selflink = selflink;
414         }
415
416         public String getIpv4OamGatewayAddress() {
417                 return ipv4OamGatewayAddress;
418         }
419
420         public void setIpv4OamGatewayAddress(String ipv4OamGatewayAddress) {
421                 this.ipv4OamGatewayAddress = ipv4OamGatewayAddress;
422         }
423
424         public Integer getIpv4OamGatewayAddressPrefixLength() {
425                 return ipv4OamGatewayAddressPrefixLength;
426         }
427
428         public void setIpv4OamGatewayAddressPrefixLength(Integer ipv4OamGatewayAddressPrefixLength) {
429                 this.ipv4OamGatewayAddressPrefixLength = ipv4OamGatewayAddressPrefixLength;
430         }
431
432         public Long getVlanIdOuter() {
433                 return vlanIdOuter;
434         }
435
436         public void setVlanIdOuter(Long vlanIdOuter) {
437                 this.vlanIdOuter = vlanIdOuter;
438         }
439
440         public String getNmProfileName() {
441                 return nmProfileName;
442         }
443
444         public void setNmProfileName(String nmProfileName) {
445                 this.nmProfileName = nmProfileName;
446         }
447
448         public String getVnfId() {
449                 return vnfId;
450         }
451
452         public void setVnfId(String vnfId) {
453                 this.vnfId = vnfId;
454         }
455
456         public String getVnfName() {
457                 return vnfName;
458         }
459
460         public void setVnfName(String vnfName) {
461                 this.vnfName = vnfName;
462         }
463
464         public String getVnfType() {
465                 return vnfType;
466         }
467
468         public void setVnfType(String vnfType) {
469                 this.vnfType = vnfType;
470         }
471
472         public OrchestrationStatus getOrchestrationStatus() {
473                 return orchestrationStatus;
474         }
475
476         public void setOrchestrationStatus(OrchestrationStatus orchestrationStatus) {
477                 this.orchestrationStatus = orchestrationStatus;
478         }
479
480         public LineOfBusiness getLineOfBusiness() {
481                 return lineOfBusiness;
482         }
483
484         public void setLineOfBusiness(LineOfBusiness lineOfBusiness) {
485                 this.lineOfBusiness = lineOfBusiness;
486         }
487
488         public Platform getPlatform() {
489                 return platform;
490         }
491
492         public void setPlatform(Platform platform) {
493                 this.platform = platform;
494         }
495
496         public Boolean isCascaded() {
497                 return cascaded;
498         }
499
500         public void setCascaded(Boolean cascaded) {
501                 this.cascaded = cascaded;
502         }
503
504         public Map<String, String> getCloudParams() {
505                 return cloudParams;
506         }
507
508         public void setCloudParams(Map<String, String> cloudParams) {
509                 this.cloudParams = cloudParams;
510         }
511
512         public SolutionInfo getSolution() {
513                 return solution;
514         }
515
516         public void setSolution(SolutionInfo solution) {
517                 this.solution = solution;
518         }
519
520         public CloudRegion getCloudRegion() {
521                 return cloudRegion;
522         }
523
524         public void setCloudRegion(CloudRegion cloudRegion) {
525                 this.cloudRegion = cloudRegion;
526         }
527
528         public Boolean isCallHoming() {
529                 return callHoming;
530         }
531
532         public void setCallHoming(Boolean callHoming) {
533                         this.callHoming = callHoming;
534         }
535
536         @Override
537         public boolean equals(final Object other) {
538                 if (!(other instanceof GenericVnf)) {
539                         return false;
540                 }
541                 GenericVnf castOther = (GenericVnf) other;
542                 return new EqualsBuilder().append(vnfId, castOther.vnfId).isEquals();
543         }
544
545         @Override
546         public int hashCode() {
547                 return new HashCodeBuilder().append(vnfId).toHashCode();
548         }
549
550 }