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;
25 import javax.persistence.Id;
27 import org.onap.so.bpmn.servicedecomposition.ShallowCopy;
28 import org.onap.so.bpmn.servicedecomposition.homingobjects.SolutionCandidates;
29 import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoAllottedResource;
30 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.apache.commons.lang3.builder.HashCodeBuilder;
35 import org.apache.commons.lang3.builder.EqualsBuilder;
37 @JsonRootName("allotted-resource")
38 public class AllottedResource extends SolutionCandidates implements Serializable, ShallowCopy<AllottedResource> {
40 private static final long serialVersionUID = 8674239064804424306L;
45 @JsonProperty("target-network-role")
46 private String targetNetworkRole;
47 @JsonProperty("self-link")
48 private String selflink;
49 @JsonProperty("orchestration-status")
50 private OrchestrationStatus orchestrationStatus;
51 @JsonProperty("operational-status")
52 private String operationalStatus;
57 @JsonProperty("model-info-allotted-resource")
58 private ModelInfoAllottedResource modelInfoAllottedResource;
59 @JsonProperty("service-instance")
60 private ServiceInstance parentServiceInstance;
62 public ModelInfoAllottedResource getModelInfoAllottedResource() {
63 return modelInfoAllottedResource;
65 public void setModelInfoAllottedResource(ModelInfoAllottedResource modelInfoAllottedResource) {
66 this.modelInfoAllottedResource = modelInfoAllottedResource;
68 public String getId() {
71 public void setId(String id) {
74 public String getTargetNetworkRole() {
75 return targetNetworkRole;
77 public void setTargetNetworkRole(String targetNetworkRole) {
78 this.targetNetworkRole = targetNetworkRole;
80 public String getSelflink() {
83 public void setSelflink(String selflink) {
84 this.selflink = selflink;
86 public String getOperationalStatus() {
87 return operationalStatus;
89 public void setOperationalStatus(String operationalStatus) {
90 this.operationalStatus = operationalStatus;
92 public OrchestrationStatus getOrchestrationStatus() {
93 return orchestrationStatus;
95 public void setOrchestrationStatus(OrchestrationStatus orchestrationStatus) {
96 this.orchestrationStatus = orchestrationStatus;
98 public String getType() {
101 public void setType(String type) {
104 public String getRole() {
107 public void setRole(String role) {
110 public ServiceInstance getParentServiceInstance() {
111 return parentServiceInstance;
113 public void setParentServiceInstance(ServiceInstance parentServiceInstance) {
114 this.parentServiceInstance = parentServiceInstance;
117 public boolean equals(final Object other) {
118 if (!(other instanceof AllottedResource)) {
121 AllottedResource castOther = (AllottedResource) other;
122 return new EqualsBuilder().append(id, castOther.id).isEquals();
125 public int hashCode() {
126 return new HashCodeBuilder().append(id).toHashCode();