Replaced all tabs with spaces in java and pom.xml
[so.git] / mso-api-handlers / mso-requests-db / src / main / java / org / onap / so / db / request / beans / ResourceOperationStatus.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
4  * ================================================================================
5  * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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.db.request.beans;
22
23 import java.io.Serializable;
24 import javax.persistence.Column;
25 import javax.persistence.Entity;
26 import javax.persistence.Id;
27 import javax.persistence.IdClass;
28 import javax.persistence.Table;
29 import java.util.Objects;
30 import org.apache.commons.lang3.builder.ToStringBuilder;
31
32 /**
33  * The Resource operation status <br>
34  * <p>
35  * </p>
36  * 
37  * @author
38  * @version ONAP Amsterdam Release 2017-08-28
39  */
40
41 @IdClass(ResourceOperationStatusId.class)
42 @Entity
43 @Table(name = "resource_operation_status")
44 public class ResourceOperationStatus implements Serializable {
45
46     /**
47      * 
48      */
49     private static final long serialVersionUID = 1L;
50
51     @Id
52     @Column(name = "SERVICE_ID")
53     private String serviceId;
54     @Id
55     @Column(name = "OPERATION_ID", length = 256)
56     private String operationId;
57     @Id
58     @Column(name = "RESOURCE_TEMPLATE_UUID")
59     private String resourceTemplateUUID;
60
61     @Column(name = "OPER_TYPE", length = 256)
62     private String operType;
63
64     @Column(name = "RESOURCE_INSTANCE_ID", length = 256)
65     private String resourceInstanceID;
66
67     @Column(name = "JOB_ID", length = 256)
68     private String jobId;
69
70     @Column(name = "STATUS", length = 256)
71     private String status;
72
73     @Column(name = "PROGRESS", length = 256)
74     private String progress = "0";
75
76     @Column(name = "ERROR_CODE", length = 256)
77     private String errorCode;
78
79     @Column(name = "STATUS_DESCRIPOTION", length = 256)
80     private String statusDescription;
81
82     public ResourceOperationStatus() {
83
84     }
85
86     public ResourceOperationStatus(String serviceId, String operationId, String resourceTemplateUUID) {
87         this.serviceId = serviceId;
88         this.operationId = operationId;
89         this.resourceTemplateUUID = resourceTemplateUUID;
90     }
91
92     public String getServiceId() {
93         return serviceId;
94     }
95
96
97     public void setServiceId(String serviceId) {
98         this.serviceId = serviceId;
99     }
100
101
102     public String getOperationId() {
103         return operationId;
104     }
105
106
107     public void setOperationId(String operationId) {
108         this.operationId = operationId;
109     }
110
111
112     public String getResourceTemplateUUID() {
113         return resourceTemplateUUID;
114     }
115
116
117     public void setResourceTemplateUUID(String resourceTemplateUUId) {
118         this.resourceTemplateUUID = resourceTemplateUUId;
119     }
120
121
122     public String getJobId() {
123         return jobId;
124     }
125
126
127     public void setJobId(String jobId) {
128         this.jobId = jobId;
129     }
130
131
132     public String getStatus() {
133         return status;
134     }
135
136
137     public void setStatus(String status) {
138         this.status = status;
139     }
140
141
142     public String getProgress() {
143         return progress;
144     }
145
146
147     public void setProgress(String progress) {
148         this.progress = progress;
149     }
150
151
152     public String getErrorCode() {
153         return errorCode;
154     }
155
156
157     public void setErrorCode(String errorCode) {
158         this.errorCode = errorCode;
159     }
160
161
162     public String getStatusDescription() {
163         return statusDescription;
164     }
165
166
167     public void setStatusDescription(String statusDescription) {
168         this.statusDescription = statusDescription;
169     }
170
171
172
173     public String getResourceInstanceID() {
174         return resourceInstanceID;
175     }
176
177
178
179     public void setResourceInstanceID(String resourceInstanceID) {
180         this.resourceInstanceID = resourceInstanceID;
181     }
182
183
184     public String getOperType() {
185         return operType;
186     }
187
188
189     public void setOperType(String operType) {
190         this.operType = operType;
191     }
192
193     @Override
194     public boolean equals(final Object other) {
195         if (this == other) {
196             return true;
197         }
198         if (!(other instanceof ResourceOperationStatus)) {
199             return false;
200         }
201         ResourceOperationStatus castOther = (ResourceOperationStatus) other;
202         return Objects.equals(getServiceId(), castOther.getServiceId())
203                 && Objects.equals(getOperationId(), castOther.getOperationId())
204                 && Objects.equals(getResourceTemplateUUID(), castOther.getResourceTemplateUUID());
205     }
206
207     @Override
208     public int hashCode() {
209         return Objects.hash(getServiceId(), getOperationId(), getResourceTemplateUUID());
210     }
211
212     @Override
213     public String toString() {
214         return new ToStringBuilder(this).append("serviceId", getServiceId()).append("operationId", getOperationId())
215                 .append("resourceTemplateUUID", getResourceTemplateUUID()).append("operType", getOperType())
216                 .append("resourceInstanceID", getResourceInstanceID()).append("jobId", getJobId())
217                 .append("status", getStatus()).append("progress", getProgress()).append("errorCode", getErrorCode())
218                 .append("statusDescription", getStatusDescription()).toString();
219     }
220 }