Added vnfc support to BB layer
[so.git] / bpmn / MSOCommonBPMN / src / main / java / org / onap / so / bpmn / servicedecomposition / bbobjects / VfModule.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.modelinfo.ModelInfoVfModule;
35 import org.onap.so.db.catalog.beans.OrchestrationStatus;
36
37 import com.fasterxml.jackson.annotation.JsonProperty;
38 import com.fasterxml.jackson.annotation.JsonRootName;
39
40 @JsonRootName("vf-module")
41 public class VfModule implements Serializable, ShallowCopy<VfModule> {
42         
43         private static final long serialVersionUID = 6570087672008609773L;
44
45         @Id
46         @JsonProperty("vf-module-id")
47         private String vfModuleId;
48         @JsonProperty("vf-module-name")
49         private String vfModuleName;
50         @JsonProperty("orchestration-status")
51         private OrchestrationStatus orchestrationStatus;
52         @JsonProperty("cloud-params")
53         private Map<String, String> cloudParams = new HashMap<>();
54         @JsonProperty("cascaded")
55         private Boolean cascaded;
56         @JsonProperty("heat-stack-id")
57     private String heatStackId;
58         @JsonProperty("contrail-service-instance-fqdn")
59     private String contrailServiceInstanceFqdn;
60         @JsonProperty("module-index")
61     private Integer moduleIndex;
62         @JsonProperty("selflink")
63     private String selflink;
64         @JsonProperty("vnfcs")
65         private List<Vnfc> vnfcs = new ArrayList<>();
66         @JsonProperty("model-info-vf-module")
67         private ModelInfoVfModule modelInfoVfModule;
68
69         public ModelInfoVfModule getModelInfoVfModule() {
70                 return modelInfoVfModule;
71         }
72         public void setModelInfoVfModule(ModelInfoVfModule modelInfoVfModule) {
73                 this.modelInfoVfModule = modelInfoVfModule;
74         }
75         public String getHeatStackId() {
76                 return heatStackId;
77         }
78         public void setHeatStackId(String heatStackId) {
79                 this.heatStackId = heatStackId;
80         }
81         public String getContrailServiceInstanceFqdn() {
82                 return contrailServiceInstanceFqdn;
83         }
84         public void setContrailServiceInstanceFqdn(String contrailServiceInstanceFqdn) {
85                 this.contrailServiceInstanceFqdn = contrailServiceInstanceFqdn;
86         }
87         public Integer getModuleIndex() {
88                 return moduleIndex;
89         }
90         public void setModuleIndex(Integer moduleIndex) {
91                 this.moduleIndex = moduleIndex;
92         }
93         public String getSelflink() {
94                 return selflink;
95         }
96         public void setSelflink(String selflink) {
97                 this.selflink = selflink;
98         }
99         public String getVfModuleId() {
100                 return vfModuleId;
101         }
102         public void setVfModuleId(String vfModuleId) {
103                 this.vfModuleId = vfModuleId;
104         }
105         public String getVfModuleName() {
106                 return vfModuleName;
107         }
108         public void setVfModuleName(String vfModuleName) {
109                 this.vfModuleName = vfModuleName;
110         }
111         public OrchestrationStatus getOrchestrationStatus() {
112                 return orchestrationStatus;
113         }
114         public void setOrchestrationStatus(OrchestrationStatus orchestrationStatus) {
115                 this.orchestrationStatus = orchestrationStatus;
116         }
117         public Map<String, String> getCloudParams() {
118                 return cloudParams;
119         }
120         public void setCloudParams(Map<String, String> cloudParams) {
121                 this.cloudParams = cloudParams;
122         }
123         public Boolean isCascaded() {
124                 return cascaded;
125         }
126         public void setCascaded(boolean cascaded) {
127                 this.cascaded = cascaded;
128         }
129         public List<Vnfc> getVnfcs() {
130                 return vnfcs;
131         }
132         @Override
133         public boolean equals(final Object other) {
134                 if (!(other instanceof VfModule)) {
135                         return false;
136                 }
137                 VfModule castOther = (VfModule) other;
138                 return new EqualsBuilder().append(vfModuleId, castOther.vfModuleId).isEquals();
139         }
140         @Override
141         public int hashCode() {
142                 return new HashCodeBuilder().append(vfModuleId).toHashCode();
143         }
144 }