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;
27 import javax.persistence.Id;
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;
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;
40 @JsonRootName("service-instance")
41 public class ServiceInstance implements Serializable, ShallowCopy<ServiceInstance> {
43 private static final long serialVersionUID = -1843348234891739356L;
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;
59 private List<GenericVnf> vnfs = new ArrayList<>();
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;
83 public List<GenericVnf> getVnfs() {
86 public List<AllottedResource> getAllottedResources() {
87 return allottedResources;
89 public List<L3Network> getNetworks() {
92 public ModelInfoServiceInstance getModelInfoServiceInstance() {
93 return modelInfoServiceInstance;
95 public void setModelInfoServiceInstance(ModelInfoServiceInstance modelInfoServiceInstance) {
96 this.modelInfoServiceInstance = modelInfoServiceInstance;
98 public List<Configuration> getConfigurations() {
99 return configurations;
101 public void setConfigurations(List<Configuration> configurations) {
102 this.configurations = configurations;
104 public String getVhnPortalUrl() {
108 public void setVhnPortalUrl(String vhnPortalUrl) {
109 this.vhnPortalUrl = vhnPortalUrl;
112 public String getServiceInstanceLocationId() {
113 return serviceInstanceLocationId;
116 public void setServiceInstanceLocationId(String serviceInstanceLocationId) {
117 this.serviceInstanceLocationId = serviceInstanceLocationId;
120 public String getSelflink() {
124 public void setSelflink(String selflink) {
125 this.selflink = selflink;
128 public Metadata getMetadata() {
132 public void setMetadata(Metadata metadata) {
133 this.metadata = metadata;
136 public String getServiceInstanceId() {
137 return serviceInstanceId;
140 public void setServiceInstanceId(String serviceInstanceId) {
141 this.serviceInstanceId = serviceInstanceId;
144 public String getServiceInstanceName() {
145 return serviceInstanceName;
148 public void setServiceInstanceName(String serviceInstanceName) {
149 this.serviceInstanceName = serviceInstanceName;
152 public OrchestrationStatus getOrchestrationStatus() {
153 return orchestrationStatus;
156 public void setOrchestrationStatus(OrchestrationStatus orchestrationStatus) {
157 this.orchestrationStatus = orchestrationStatus;
160 public OwningEntity getOwningEntity() {
164 public void setOwningEntity(OwningEntity owningEntity) {
165 this.owningEntity = owningEntity;
168 public Project getProject() {
172 public void setProject(Project project) {
173 this.project = project;
176 public Collection getCollection() {
179 public void setCollection(Collection collection) {
180 this.collection = collection;
182 public List<VpnBondingLink> getVpnBondingLinks() {
183 return vpnBondingLinks;
185 public List<Pnf> getPnfs() {
188 public SolutionInfo getSolutionInfo() {
191 public void setSolutionInfo(SolutionInfo solutionInfo) {
192 this.solutionInfo = solutionInfo;
195 public boolean equals(final Object other) {
196 if (!(other instanceof ServiceInstance)) {
199 ServiceInstance castOther = (ServiceInstance) other;
200 return new EqualsBuilder().append(serviceInstanceId, castOther.serviceInstanceId).isEquals();
203 public int hashCode() {
204 return new HashCodeBuilder().append(serviceInstanceId).toHashCode();