Merge "resume request support"
[so.git] / bpmn / MSOCommonBPMN / src / main / java / org / onap / so / bpmn / servicedecomposition / bbobjects / ServiceInstance.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.List;
26 import javax.persistence.Id;
27 import org.apache.commons.lang3.builder.EqualsBuilder;
28 import org.apache.commons.lang3.builder.HashCodeBuilder;
29 import org.onap.so.bpmn.servicedecomposition.Metadata;
30 import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceInstance;
31 import org.onap.so.db.catalog.beans.OrchestrationStatus;
32 import com.fasterxml.jackson.annotation.JsonProperty;
33 import com.fasterxml.jackson.annotation.JsonRootName;
34 import org.onap.so.bpmn.servicedecomposition.ShallowCopy;
35 import org.onap.so.bpmn.servicedecomposition.homingobjects.SolutionInfo;
36
37 @JsonRootName("service-instance")
38 public class ServiceInstance implements Serializable, ShallowCopy<ServiceInstance> {
39
40     private static final long serialVersionUID = -1843348234891739356L;
41
42     @Id
43     @JsonProperty("service-instance-id")
44     private String serviceInstanceId;
45     @JsonProperty("service-instance-name")
46     private String serviceInstanceName;
47     @JsonProperty("orchestration-status")
48     private OrchestrationStatus orchestrationStatus;
49     @JsonProperty("owning-entity")
50     private OwningEntity owningEntity;
51     @JsonProperty("project")
52     private Project project;
53     @JsonProperty("collection")
54     private Collection collection;
55     @JsonProperty("vnfs")
56     private List<GenericVnf> vnfs = new ArrayList<>();
57     @JsonProperty("pnfs")
58     private List<Pnf> pnfs = new ArrayList<>();
59     @JsonProperty("allotted-resources")
60     private List<AllottedResource> allottedResources = new ArrayList<>();
61     @JsonProperty("networks")
62     private List<L3Network> networks = new ArrayList<>();
63     @JsonProperty("vpn-bonding-links")
64     private List<VpnBondingLink> vpnBondingLinks = new ArrayList<>();
65     @JsonProperty("vhn-portal-url")
66     private String vhnPortalUrl;
67     @JsonProperty("service-instance-location-id")
68     private String serviceInstanceLocationId;
69     @JsonProperty("selflink")
70     private String selflink;
71     @JsonProperty("metadata")
72     private Metadata metadata;
73     @JsonProperty("configurations")
74     private List<Configuration> configurations = new ArrayList<>();
75     @JsonProperty("solution-info")
76     private SolutionInfo solutionInfo;
77     @JsonProperty("model-info-service-instance")
78     private ModelInfoServiceInstance modelInfoServiceInstance;
79     @JsonProperty("instance-groups")
80     private List<InstanceGroup> instanceGroups = new ArrayList<>();
81     @JsonProperty("service-proxies")
82     private List<ServiceProxy> serviceProxies = new ArrayList<ServiceProxy>();
83
84     public void setServiceProxies(List<ServiceProxy> serviceProxies) {
85         this.serviceProxies = serviceProxies;
86     }
87
88     public List<GenericVnf> getVnfs() {
89         return vnfs;
90     }
91
92     public List<AllottedResource> getAllottedResources() {
93         return allottedResources;
94     }
95
96     public List<L3Network> getNetworks() {
97         return networks;
98     }
99
100     public ModelInfoServiceInstance getModelInfoServiceInstance() {
101         return modelInfoServiceInstance;
102     }
103
104     public void setModelInfoServiceInstance(ModelInfoServiceInstance modelInfoServiceInstance) {
105         this.modelInfoServiceInstance = modelInfoServiceInstance;
106     }
107
108     public List<Configuration> getConfigurations() {
109         return configurations;
110     }
111
112     public void setConfigurations(List<Configuration> configurations) {
113         this.configurations = configurations;
114     }
115
116     public String getVhnPortalUrl() {
117         return vhnPortalUrl;
118     }
119
120     public void setVhnPortalUrl(String vhnPortalUrl) {
121         this.vhnPortalUrl = vhnPortalUrl;
122     }
123
124     public String getServiceInstanceLocationId() {
125         return serviceInstanceLocationId;
126     }
127
128     public void setServiceInstanceLocationId(String serviceInstanceLocationId) {
129         this.serviceInstanceLocationId = serviceInstanceLocationId;
130     }
131
132     public String getSelflink() {
133         return selflink;
134     }
135
136     public void setSelflink(String selflink) {
137         this.selflink = selflink;
138     }
139
140     public Metadata getMetadata() {
141         return metadata;
142     }
143
144     public void setMetadata(Metadata metadata) {
145         this.metadata = metadata;
146     }
147
148     public String getServiceInstanceId() {
149         return serviceInstanceId;
150     }
151
152     public void setServiceInstanceId(String serviceInstanceId) {
153         this.serviceInstanceId = serviceInstanceId;
154     }
155
156     public String getServiceInstanceName() {
157         return serviceInstanceName;
158     }
159
160     public void setServiceInstanceName(String serviceInstanceName) {
161         this.serviceInstanceName = serviceInstanceName;
162     }
163
164     public OrchestrationStatus getOrchestrationStatus() {
165         return orchestrationStatus;
166     }
167
168     public void setOrchestrationStatus(OrchestrationStatus orchestrationStatus) {
169         this.orchestrationStatus = orchestrationStatus;
170     }
171
172     public OwningEntity getOwningEntity() {
173         return owningEntity;
174     }
175
176     public void setOwningEntity(OwningEntity owningEntity) {
177         this.owningEntity = owningEntity;
178     }
179
180     public Project getProject() {
181         return project;
182     }
183
184     public void setProject(Project project) {
185         this.project = project;
186     }
187
188     public Collection getCollection() {
189         return collection;
190     }
191
192     public void setCollection(Collection collection) {
193         this.collection = collection;
194     }
195
196     public List<VpnBondingLink> getVpnBondingLinks() {
197         return vpnBondingLinks;
198     }
199
200     public List<Pnf> getPnfs() {
201         return pnfs;
202     }
203
204     public SolutionInfo getSolutionInfo() {
205         return solutionInfo;
206     }
207
208     public void setSolutionInfo(SolutionInfo solutionInfo) {
209         this.solutionInfo = solutionInfo;
210     }
211
212     public List<InstanceGroup> getInstanceGroups() {
213         return instanceGroups;
214     }
215
216     public void setInstanceGroups(List<InstanceGroup> instanceGroups) {
217         this.instanceGroups = instanceGroups;
218     }
219
220     public List<ServiceProxy> getServiceProxies() {
221         return serviceProxies;
222     }
223
224     @Override
225     public boolean equals(final Object other) {
226         if (!(other instanceof ServiceInstance)) {
227             return false;
228         }
229         ServiceInstance castOther = (ServiceInstance) other;
230         return new EqualsBuilder().append(serviceInstanceId, castOther.serviceInstanceId).isEquals();
231     }
232
233     @Override
234     public int hashCode() {
235         return new HashCodeBuilder().append(serviceInstanceId).toHashCode();
236     }
237 }