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;
82 @JsonProperty("instance-groups")
83 private List<InstanceGroup> instanceGroups = new ArrayList<>();
85 public List<GenericVnf> getVnfs() {
88 public List<AllottedResource> getAllottedResources() {
89 return allottedResources;
91 public List<L3Network> getNetworks() {
94 public ModelInfoServiceInstance getModelInfoServiceInstance() {
95 return modelInfoServiceInstance;
97 public void setModelInfoServiceInstance(ModelInfoServiceInstance modelInfoServiceInstance) {
98 this.modelInfoServiceInstance = modelInfoServiceInstance;
100 public List<Configuration> getConfigurations() {
101 return configurations;
103 public void setConfigurations(List<Configuration> configurations) {
104 this.configurations = configurations;
106 public String getVhnPortalUrl() {
110 public void setVhnPortalUrl(String vhnPortalUrl) {
111 this.vhnPortalUrl = vhnPortalUrl;
114 public String getServiceInstanceLocationId() {
115 return serviceInstanceLocationId;
118 public void setServiceInstanceLocationId(String serviceInstanceLocationId) {
119 this.serviceInstanceLocationId = serviceInstanceLocationId;
122 public String getSelflink() {
126 public void setSelflink(String selflink) {
127 this.selflink = selflink;
130 public Metadata getMetadata() {
134 public void setMetadata(Metadata metadata) {
135 this.metadata = metadata;
138 public String getServiceInstanceId() {
139 return serviceInstanceId;
142 public void setServiceInstanceId(String serviceInstanceId) {
143 this.serviceInstanceId = serviceInstanceId;
146 public String getServiceInstanceName() {
147 return serviceInstanceName;
150 public void setServiceInstanceName(String serviceInstanceName) {
151 this.serviceInstanceName = serviceInstanceName;
154 public OrchestrationStatus getOrchestrationStatus() {
155 return orchestrationStatus;
158 public void setOrchestrationStatus(OrchestrationStatus orchestrationStatus) {
159 this.orchestrationStatus = orchestrationStatus;
162 public OwningEntity getOwningEntity() {
166 public void setOwningEntity(OwningEntity owningEntity) {
167 this.owningEntity = owningEntity;
170 public Project getProject() {
174 public void setProject(Project project) {
175 this.project = project;
178 public Collection getCollection() {
181 public void setCollection(Collection collection) {
182 this.collection = collection;
184 public List<VpnBondingLink> getVpnBondingLinks() {
185 return vpnBondingLinks;
187 public List<Pnf> getPnfs() {
190 public SolutionInfo getSolutionInfo() {
193 public void setSolutionInfo(SolutionInfo solutionInfo) {
194 this.solutionInfo = solutionInfo;
196 public List<InstanceGroup> getInstanceGroups() {
197 return instanceGroups;
199 public void setInstanceGroups(List<InstanceGroup> instanceGroups) {
200 this.instanceGroups = instanceGroups;
203 public boolean equals(final Object other) {
204 if (!(other instanceof ServiceInstance)) {
207 ServiceInstance castOther = (ServiceInstance) other;
208 return new EqualsBuilder().append(serviceInstanceId, castOther.serviceInstanceId).isEquals();
211 public int hashCode() {
212 return new HashCodeBuilder().append(serviceInstanceId).toHashCode();