Containerization feature of SO
[so.git] / bpmn / MSOCommonBPMN / src / main / java / org / onap / so / bpmn / servicedecomposition / bbobjects / AllottedResource.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
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
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
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=========================================================
19  */
20
21 package org.onap.so.bpmn.servicedecomposition.bbobjects;
22
23 import java.io.Serializable;
24
25 import javax.persistence.Id;
26
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;
31
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;
36
37 @JsonRootName("allotted-resource")
38 public class AllottedResource extends SolutionCandidates implements Serializable, ShallowCopy<AllottedResource> {
39
40         private static final long serialVersionUID = 8674239064804424306L;
41
42         @Id
43         @JsonProperty("id")
44         private String id;
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;
53         @JsonProperty("type")
54     private String type;
55         @JsonProperty("role")
56     private String role;
57     @JsonProperty("model-info-allotted-resource")
58     private ModelInfoAllottedResource modelInfoAllottedResource;
59     @JsonProperty("service-instance")
60     private ServiceInstance parentServiceInstance;
61
62         public ModelInfoAllottedResource getModelInfoAllottedResource() {
63                 return modelInfoAllottedResource;
64         }
65         public void setModelInfoAllottedResource(ModelInfoAllottedResource modelInfoAllottedResource) {
66                 this.modelInfoAllottedResource = modelInfoAllottedResource;
67         }
68         public String getId() {
69                 return id;
70         }
71         public void setId(String id) {
72                 this.id = id;
73         }
74         public String getTargetNetworkRole() {
75                 return targetNetworkRole;
76         }
77         public void setTargetNetworkRole(String targetNetworkRole) {
78                 this.targetNetworkRole = targetNetworkRole;
79         }
80         public String getSelflink() {
81                 return selflink;
82         }
83         public void setSelflink(String selflink) {
84                 this.selflink = selflink;
85         }
86         public String getOperationalStatus() {
87                 return operationalStatus;
88         }
89         public void setOperationalStatus(String operationalStatus) {
90                 this.operationalStatus = operationalStatus;
91         }
92         public OrchestrationStatus getOrchestrationStatus() {
93                 return orchestrationStatus;
94         }
95         public void setOrchestrationStatus(OrchestrationStatus orchestrationStatus) {
96                 this.orchestrationStatus = orchestrationStatus;
97         }
98         public String getType() {
99                 return type;
100         }
101         public void setType(String type) {
102                 this.type = type;
103         }
104         public String getRole() {
105                 return role;
106         }
107         public void setRole(String role) {
108                 this.role = role;
109         }
110         public ServiceInstance getParentServiceInstance() {
111                 return parentServiceInstance;
112         }
113         public void setParentServiceInstance(ServiceInstance parentServiceInstance) {
114                 this.parentServiceInstance = parentServiceInstance;
115         }
116         @Override
117         public boolean equals(final Object other) {
118                 if (!(other instanceof AllottedResource)) {
119                         return false;
120                 }
121                 AllottedResource castOther = (AllottedResource) other;
122                 return new EqualsBuilder().append(id, castOther.id).isEquals();
123         }
124         @Override
125         public int hashCode() {
126                 return new HashCodeBuilder().append(id).toHashCode();
127         }
128
129 }