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 javax.persistence.Id;
25 import org.onap.so.bpmn.servicedecomposition.ShallowCopy;
26 import org.onap.so.bpmn.servicedecomposition.homingobjects.SolutionCandidates;
27 import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoAllottedResource;
28 import org.onap.so.db.catalog.beans.OrchestrationStatus;
29 import com.fasterxml.jackson.annotation.JsonProperty;
30 import com.fasterxml.jackson.annotation.JsonRootName;
31 import org.apache.commons.lang3.builder.HashCodeBuilder;
32 import org.apache.commons.lang3.builder.EqualsBuilder;
34 @JsonRootName("allotted-resource")
35 public class AllottedResource extends SolutionCandidates implements Serializable, ShallowCopy<AllottedResource> {
37 private static final long serialVersionUID = 8674239064804424306L;
42 @JsonProperty("target-network-role")
43 private String targetNetworkRole;
44 @JsonProperty("self-link")
45 private String selflink;
46 @JsonProperty("orchestration-status")
47 private OrchestrationStatus orchestrationStatus;
48 @JsonProperty("operational-status")
49 private String operationalStatus;
54 @JsonProperty("model-info-allotted-resource")
55 private ModelInfoAllottedResource modelInfoAllottedResource;
56 @JsonProperty("service-instance")
57 private ServiceInstance parentServiceInstance;
59 public ModelInfoAllottedResource getModelInfoAllottedResource() {
60 return modelInfoAllottedResource;
63 public void setModelInfoAllottedResource(ModelInfoAllottedResource modelInfoAllottedResource) {
64 this.modelInfoAllottedResource = modelInfoAllottedResource;
67 public String getId() {
71 public void setId(String id) {
75 public String getTargetNetworkRole() {
76 return targetNetworkRole;
79 public void setTargetNetworkRole(String targetNetworkRole) {
80 this.targetNetworkRole = targetNetworkRole;
83 public String getSelflink() {
87 public void setSelflink(String selflink) {
88 this.selflink = selflink;
91 public String getOperationalStatus() {
92 return operationalStatus;
95 public void setOperationalStatus(String operationalStatus) {
96 this.operationalStatus = operationalStatus;
99 public OrchestrationStatus getOrchestrationStatus() {
100 return orchestrationStatus;
103 public void setOrchestrationStatus(OrchestrationStatus orchestrationStatus) {
104 this.orchestrationStatus = orchestrationStatus;
107 public String getType() {
111 public void setType(String type) {
115 public String getRole() {
119 public void setRole(String role) {
123 public ServiceInstance getParentServiceInstance() {
124 return parentServiceInstance;
127 public void setParentServiceInstance(ServiceInstance parentServiceInstance) {
128 this.parentServiceInstance = parentServiceInstance;
132 public boolean equals(final Object other) {
133 if (!(other instanceof AllottedResource)) {
136 AllottedResource castOther = (AllottedResource) other;
137 return new EqualsBuilder().append(id, castOther.id).isEquals();
141 public int hashCode() {
142 return new HashCodeBuilder().append(id).toHashCode();