2 * ============LICENSE_START=======================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.onap.so.bpmn.servicedecomposition.bbobjects;
23 import java.io.Serializable;
24 import java.util.ArrayList;
25 import java.util.HashMap;
26 import java.util.List;
29 import javax.persistence.Id;
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;
39 import com.fasterxml.jackson.annotation.JsonProperty;
40 import com.fasterxml.jackson.annotation.JsonRootName;
42 @JsonRootName("generic-vnf")
43 public class GenericVnf implements Serializable, ShallowCopy<GenericVnf> {
45 private static final long serialVersionUID = -5107610336831330403L;
48 @JsonProperty("vnf-id")
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;
96 @JsonProperty("vcpu-units")
97 private String vcpuUnits;
98 @JsonProperty("vmemory")
100 @JsonProperty("vmemory-units")
101 private String vmemoryUnits;
102 @JsonProperty("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;
144 public List<InstanceGroup> getInstanceGroups() {
145 return instanceGroups;
148 public List<VolumeGroup> getVolumeGroups() {
152 public ModelInfoGenericVnf getModelInfoGenericVnf() {
153 return modelInfoGenericVnf;
156 public void setModelInfoGenericVnf(ModelInfoGenericVnf modelInfoGenericVnf) {
157 this.modelInfoGenericVnf = modelInfoGenericVnf;
160 public String getVnfName2() {
164 public void setVnfName2(String vnfName2) {
165 this.vnfName2 = vnfName2;
168 public String getServiceId() {
172 public void setServiceId(String serviceId) {
173 this.serviceId = serviceId;
176 public String getRegionalResourceZone() {
177 return regionalResourceZone;
180 public void setRegionalResourceZone(String regionalResourceZone) {
181 this.regionalResourceZone = regionalResourceZone;
184 public String getProvStatus() {
188 public void setProvStatus(String provStatus) {
189 this.provStatus = provStatus;
192 public String getOperationalStatus() {
193 return operationalStatus;
196 public void setOperationalStatus(String operationalStatus) {
197 this.operationalStatus = operationalStatus;
200 public String getEquipmentRole() {
201 return equipmentRole;
204 public void setEquipmentRole(String equipmentRole) {
205 this.equipmentRole = equipmentRole;
208 public String getManagementOption() {
209 return managementOption;
212 public void setManagementOption(String managementOption) {
213 this.managementOption = managementOption;
216 public String getIpv4OamAddress() {
217 return ipv4OamAddress;
220 public void setIpv4OamAddress(String ipv4OamAddress) {
221 this.ipv4OamAddress = ipv4OamAddress;
224 public String getIpv4Loopback0Address() {
225 return ipv4Loopback0Address;
228 public void setIpv4Loopback0Address(String ipv4Loopback0Address) {
229 this.ipv4Loopback0Address = ipv4Loopback0Address;
232 public String getNmLanV6Address() {
233 return nmLanV6Address;
236 public void setNmLanV6Address(String nmLanV6Address) {
237 this.nmLanV6Address = nmLanV6Address;
240 public String getManagementV6Address() {
241 return managementV6Address;
244 public void setManagementV6Address(String managementV6Address) {
245 this.managementV6Address = managementV6Address;
248 public Long getVcpu() {
252 public void setVcpu(Long vcpu) {
256 public String getVcpuUnits() {
260 public void setVcpuUnits(String vcpuUnits) {
261 this.vcpuUnits = vcpuUnits;
264 public List<LInterface> getlInterfaces() {
268 public List<LagInterface> getLagInterfaces() {
269 return lagInterfaces;
272 public List<Entitlement> getEntitlements() {
276 public List<VfModule> getVfModules() {
280 public Long getVmemory() {
284 public void setVmemory(Long vmemory) {
285 this.vmemory = vmemory;
288 public String getVmemoryUnits() {
292 public void setVmemoryUnits(String vmemoryUnits) {
293 this.vmemoryUnits = vmemoryUnits;
296 public Long getVdisk() {
300 public void setVdisk(Long vdisk) {
304 public String getVdiskUnits() {
308 public void setVdiskUnits(String vdiskUnits) {
309 this.vdiskUnits = vdiskUnits;
312 public boolean isInMaint() {
316 public void setInMaint(boolean inMaint) {
317 this.inMaint = inMaint;
320 public boolean isClosedLoopDisabled() {
321 return isClosedLoopDisabled;
324 public void setClosedLoopDisabled(boolean isClosedLoopDisabled) {
325 this.isClosedLoopDisabled = isClosedLoopDisabled;
328 public String getSummaryStatus() {
329 return summaryStatus;
332 public void setSummaryStatus(String summaryStatus) {
333 this.summaryStatus = summaryStatus;
336 public Boolean getEncryptedAccessFlag() {
337 return encryptedAccessFlag;
340 public void setEncryptedAccessFlag(Boolean encryptedAccessFlag) {
341 this.encryptedAccessFlag = encryptedAccessFlag;
344 public String getAsNumber() {
348 public void setAsNumber(String asNumber) {
349 this.asNumber = asNumber;
352 public String getRegionalResourceSubzone() {
353 return regionalResourceSubzone;
356 public void setRegionalResourceSubzone(String regionalResourceSubzone) {
357 this.regionalResourceSubzone = regionalResourceSubzone;
360 public License getLicense() {
364 public void setLicense(License license) {
365 this.license = license;
368 public String getSelflink() {
372 public void setSelflink(String selflink) {
373 this.selflink = selflink;
376 public String getIpv4OamGatewayAddress() {
377 return ipv4OamGatewayAddress;
380 public void setIpv4OamGatewayAddress(String ipv4OamGatewayAddress) {
381 this.ipv4OamGatewayAddress = ipv4OamGatewayAddress;
384 public Integer getIpv4OamGatewayAddressPrefixLength() {
385 return ipv4OamGatewayAddressPrefixLength;
388 public void setIpv4OamGatewayAddressPrefixLength(Integer ipv4OamGatewayAddressPrefixLength) {
389 this.ipv4OamGatewayAddressPrefixLength = ipv4OamGatewayAddressPrefixLength;
392 public Long getVlanIdOuter() {
396 public void setVlanIdOuter(Long vlanIdOuter) {
397 this.vlanIdOuter = vlanIdOuter;
400 public String getNmProfileName() {
401 return nmProfileName;
404 public void setNmProfileName(String nmProfileName) {
405 this.nmProfileName = nmProfileName;
408 public String getVnfId() {
412 public void setVnfId(String vnfId) {
416 public String getVnfName() {
420 public void setVnfName(String vnfName) {
421 this.vnfName = vnfName;
424 public String getVnfType() {
428 public void setVnfType(String vnfType) {
429 this.vnfType = vnfType;
432 public OrchestrationStatus getOrchestrationStatus() {
433 return orchestrationStatus;
436 public void setOrchestrationStatus(OrchestrationStatus orchestrationStatus) {
437 this.orchestrationStatus = orchestrationStatus;
440 public LineOfBusiness getLineOfBusiness() {
441 return lineOfBusiness;
444 public void setLineOfBusiness(LineOfBusiness lineOfBusiness) {
445 this.lineOfBusiness = lineOfBusiness;
448 public Platform getPlatform() {
452 public void setPlatform(Platform platform) {
453 this.platform = platform;
456 public boolean isCascaded() {
460 public void setCascaded(boolean cascaded) {
461 this.cascaded = cascaded;
464 public Map<String, String> getCloudParams() {
468 public void setCloudParams(Map<String, String> cloudParams) {
469 this.cloudParams = cloudParams;
472 public SolutionInfo getSolution() {
476 public void setSolution(SolutionInfo solution) {
477 this.solution = solution;
480 public CloudRegion getCloudRegion() {
484 public void setCloudRegion(CloudRegion cloudRegion) {
485 this.cloudRegion = cloudRegion;
488 public boolean isCallHoming() {
492 public void setCallHoming(boolean callHoming) {
493 this.callHoming = callHoming;
497 public boolean equals(final Object other) {
498 if (!(other instanceof GenericVnf)) {
501 GenericVnf castOther = (GenericVnf) other;
502 return new EqualsBuilder().append(vnfId, castOther.vnfId).isEquals();
506 public int hashCode() {
507 return new HashCodeBuilder().append(vnfId).toHashCode();