Merge "Reorder modifiers"
[so.git] / mso-api-handlers / mso-requests-db / src / main / java / org / openecomp / mso / requestsdb / 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 package org.openecomp.mso.requestsdb;
21
22 import java.io.Serializable;
23
24 /**
25  * The Resource operation status
26  * <br>
27  * <p>
28  * </p>
29  * 
30  * @author
31  * @version     ONAP Amsterdam Release  2017-08-28
32  */
33 public class ResourceOperationStatus implements Serializable{
34
35     /**
36      * 
37      */
38     private static final long serialVersionUID = 1L;
39
40     private String serviceId = null;
41     
42     private String operationId = null;
43     
44     private String resourceTemplateUUID = null;
45     
46     private String operType = null;
47     
48     private String resourceInstanceID = null;
49     
50     private String jobId = null;
51     
52     private String status = null;
53     
54     private String progress = "0";
55     
56     private String errorCode = null;
57     
58     private String statusDescription = null;
59
60     public ResourceOperationStatus(){
61         
62     }
63     
64     public ResourceOperationStatus(String serviceId, String operationId, String resourceTemplateUUID)
65     {
66         this.serviceId = serviceId;
67         this.operationId = operationId;
68         this.resourceTemplateUUID = resourceTemplateUUID;
69     }
70     
71     public String getServiceId() {
72         return serviceId;
73     }
74
75     
76     public void setServiceId(String serviceId) {
77         this.serviceId = serviceId;
78     }
79
80     
81     public String getOperationId() {
82         return operationId;
83     }
84
85     
86     public void setOperationId(String operationId) {
87         this.operationId = operationId;
88     }
89
90     
91     public String getResourceTemplateUUID() {
92         return resourceTemplateUUID;
93     }
94
95     
96     public void setResourceTemplateUUID(String resourceTemplateUUId) {
97         this.resourceTemplateUUID = resourceTemplateUUId;
98     }
99
100     
101     public String getJobId() {
102         return jobId;
103     }
104
105     
106     public void setJobId(String jobId) {
107         this.jobId = jobId;
108     }
109
110     
111     public String getStatus() {
112         return status;
113     }
114
115     
116     public void setStatus(String status) {
117         this.status = status;
118     }
119
120     
121     public String getProgress() {
122         return progress;
123     }
124
125     
126     public void setProgress(String progress) {
127         this.progress = progress;
128     }
129
130     
131     public String getErrorCode() {
132         return errorCode;
133     }
134
135     
136     public void setErrorCode(String errorCode) {
137         this.errorCode = errorCode;
138     }
139
140     
141     public String getStatusDescription() {
142         return statusDescription;
143     }
144
145     
146     public void setStatusDescription(String statusDescription) {
147         this.statusDescription = statusDescription;
148     }
149
150
151     
152     public String getResourceInstanceID() {
153         return resourceInstanceID;
154     }
155
156
157     
158     public void setResourceInstanceID(String resourceInstanceID) {
159         this.resourceInstanceID = resourceInstanceID;
160     }
161
162     
163     public String getOperType() {
164         return operType;
165     }
166
167     
168     public void setOperType(String operType) {
169         this.operType = operType;
170     }
171
172     /**
173      * <br>
174      * 
175      * @return
176      * @since   ONAP Amsterdam Release 
177      */
178     @Override
179     public int hashCode() {
180         final int prime = 31;
181         int result = 1;
182         result = prime * result + ((operationId == null) ? 0 : operationId.hashCode());
183         result = prime * result + ((resourceTemplateUUID == null) ? 0 : resourceTemplateUUID.hashCode());
184         result = prime * result + ((serviceId == null) ? 0 : serviceId.hashCode());
185         return result;
186     }
187
188     /**
189      * <br>
190      * 
191      * @param obj
192      * @return
193      * @since   ONAP Amsterdam Release 
194      */
195     @Override
196     public boolean equals(Object obj) {
197         if(this == obj)
198             return true;
199         if(obj == null)
200             return false;
201         if(getClass() != obj.getClass())
202             return false;
203         ResourceOperationStatus other = (ResourceOperationStatus)obj;
204         if(operationId == null) {
205             if(other.operationId != null)
206                 return false;
207         } else if(!operationId.equals(other.operationId))
208             return false;
209         if(resourceTemplateUUID == null) {
210             if(other.resourceTemplateUUID != null)
211                 return false;
212         } else if(!resourceTemplateUUID.equals(other.resourceTemplateUUID))
213             return false;
214         if(serviceId == null) {
215             if(other.serviceId != null)
216                 return false;
217         } else if(!serviceId.equals(other.serviceId))
218             return false;
219         return true;
220     }   
221     
222 }