6c3a0c43ed02d9f0a7ddf1a539f387813cfaf179
[so.git] /
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
82     public List<GenericVnf> getVnfs() {
83         return vnfs;
84     }
85
86     public List<AllottedResource> getAllottedResources() {
87         return allottedResources;
88     }
89
90     public List<L3Network> getNetworks() {
91         return networks;
92     }
93
94     public ModelInfoServiceInstance getModelInfoServiceInstance() {
95         return modelInfoServiceInstance;
96     }
97
98     public void setModelInfoServiceInstance(ModelInfoServiceInstance modelInfoServiceInstance) {
99         this.modelInfoServiceInstance = modelInfoServiceInstance;
100     }
101
102     public List<Configuration> getConfigurations() {
103         return configurations;
104     }
105
106     public void setConfigurations(List<Configuration> configurations) {
107         this.configurations = configurations;
108     }
109
110     public String getVhnPortalUrl() {
111         return vhnPortalUrl;
112     }
113
114     public void setVhnPortalUrl(String vhnPortalUrl) {
115         this.vhnPortalUrl = vhnPortalUrl;
116     }
117
118     public String getServiceInstanceLocationId() {
119         return serviceInstanceLocationId;
120     }
121
122     public void setServiceInstanceLocationId(String serviceInstanceLocationId) {
123         this.serviceInstanceLocationId = serviceInstanceLocationId;
124     }
125
126     public String getSelflink() {
127         return selflink;
128     }
129
130     public void setSelflink(String selflink) {
131         this.selflink = selflink;
132     }
133
134     public Metadata getMetadata() {
135         return metadata;
136     }
137
138     public void setMetadata(Metadata metadata) {
139         this.metadata = metadata;
140     }
141
142     public String getServiceInstanceId() {
143         return serviceInstanceId;
144     }
145
146     public void setServiceInstanceId(String serviceInstanceId) {
147         this.serviceInstanceId = serviceInstanceId;
148     }
149
150     public String getServiceInstanceName() {
151         return serviceInstanceName;
152     }
153
154     public void setServiceInstanceName(String serviceInstanceName) {
155         this.serviceInstanceName = serviceInstanceName;
156     }
157
158     public OrchestrationStatus getOrchestrationStatus() {
159         return orchestrationStatus;
160     }
161
162     public void setOrchestrationStatus(OrchestrationStatus orchestrationStatus) {
163         this.orchestrationStatus = orchestrationStatus;
164     }
165
166     public OwningEntity getOwningEntity() {
167         return owningEntity;
168     }
169
170     public void setOwningEntity(OwningEntity owningEntity) {
171         this.owningEntity = owningEntity;
172     }
173
174     public Project getProject() {
175         return project;
176     }
177
178     public void setProject(Project project) {
179         this.project = project;
180     }
181
182     public Collection getCollection() {
183         return collection;
184     }
185
186     public void setCollection(Collection collection) {
187         this.collection = collection;
188     }
189
190     public List<VpnBondingLink> getVpnBondingLinks() {
191         return vpnBondingLinks;
192     }
193
194     public List<Pnf> getPnfs() {
195         return pnfs;
196     }
197
198     public SolutionInfo getSolutionInfo() {
199         return solutionInfo;
200     }
201
202     public void setSolutionInfo(SolutionInfo solutionInfo) {
203         this.solutionInfo = solutionInfo;
204     }
205
206     public List<InstanceGroup> getInstanceGroups() {
207         return instanceGroups;
208     }
209
210     public void setInstanceGroups(List<InstanceGroup> instanceGroups) {
211         this.instanceGroups = instanceGroups;
212     }
213
214     @Override
215     public boolean equals(final Object other) {
216         if (!(other instanceof ServiceInstance)) {
217             return false;
218         }
219         ServiceInstance castOther = (ServiceInstance) other;
220         return new EqualsBuilder().append(serviceInstanceId, castOther.serviceInstanceId).isEquals();
221     }
222
223     @Override
224     public int hashCode() {
225         return new HashCodeBuilder().append(serviceInstanceId).toHashCode();
226     }
227 }