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