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.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;
37 @JsonRootName("service-instance")
38 public class ServiceInstance implements Serializable, ShallowCopy<ServiceInstance> {
40 private static final long serialVersionUID = -1843348234891739356L;
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;
56 private List<GenericVnf> vnfs = new ArrayList<>();
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>();
84 public void setServiceProxies(List<ServiceProxy> serviceProxies) {
85 this.serviceProxies = serviceProxies;
88 public List<GenericVnf> getVnfs() {
92 public List<AllottedResource> getAllottedResources() {
93 return allottedResources;
96 public List<L3Network> getNetworks() {
100 public ModelInfoServiceInstance getModelInfoServiceInstance() {
101 return modelInfoServiceInstance;
104 public void setModelInfoServiceInstance(ModelInfoServiceInstance modelInfoServiceInstance) {
105 this.modelInfoServiceInstance = modelInfoServiceInstance;
108 public List<Configuration> getConfigurations() {
109 return configurations;
112 public void setConfigurations(List<Configuration> configurations) {
113 this.configurations = configurations;
116 public String getVhnPortalUrl() {
120 public void setVhnPortalUrl(String vhnPortalUrl) {
121 this.vhnPortalUrl = vhnPortalUrl;
124 public String getServiceInstanceLocationId() {
125 return serviceInstanceLocationId;
128 public void setServiceInstanceLocationId(String serviceInstanceLocationId) {
129 this.serviceInstanceLocationId = serviceInstanceLocationId;
132 public String getSelflink() {
136 public void setSelflink(String selflink) {
137 this.selflink = selflink;
140 public Metadata getMetadata() {
144 public void setMetadata(Metadata metadata) {
145 this.metadata = metadata;
148 public String getServiceInstanceId() {
149 return serviceInstanceId;
152 public void setServiceInstanceId(String serviceInstanceId) {
153 this.serviceInstanceId = serviceInstanceId;
156 public String getServiceInstanceName() {
157 return serviceInstanceName;
160 public void setServiceInstanceName(String serviceInstanceName) {
161 this.serviceInstanceName = serviceInstanceName;
164 public OrchestrationStatus getOrchestrationStatus() {
165 return orchestrationStatus;
168 public void setOrchestrationStatus(OrchestrationStatus orchestrationStatus) {
169 this.orchestrationStatus = orchestrationStatus;
172 public OwningEntity getOwningEntity() {
176 public void setOwningEntity(OwningEntity owningEntity) {
177 this.owningEntity = owningEntity;
180 public Project getProject() {
184 public void setProject(Project project) {
185 this.project = project;
188 public Collection getCollection() {
192 public void setCollection(Collection collection) {
193 this.collection = collection;
196 public List<VpnBondingLink> getVpnBondingLinks() {
197 return vpnBondingLinks;
200 public List<Pnf> getPnfs() {
204 public SolutionInfo getSolutionInfo() {
208 public void setSolutionInfo(SolutionInfo solutionInfo) {
209 this.solutionInfo = solutionInfo;
212 public List<InstanceGroup> getInstanceGroups() {
213 return instanceGroups;
216 public void setInstanceGroups(List<InstanceGroup> instanceGroups) {
217 this.instanceGroups = instanceGroups;
220 public List<ServiceProxy> getServiceProxies() {
221 return serviceProxies;
225 public boolean equals(final Object other) {
226 if (!(other instanceof ServiceInstance)) {
229 ServiceInstance castOther = (ServiceInstance) other;
230 return new EqualsBuilder().append(serviceInstanceId, castOther.serviceInstanceId).isEquals();
234 public int hashCode() {
235 return new HashCodeBuilder().append(serviceInstanceId).toHashCode();