Add Apache license header per file
[externalapi/nbi.git] / src / main / java / org / onap / nbi / apis / serviceorder / model / orchestrator / ExecutionTask.java
1 /**
2  *
3  *     Copyright (c) 2017 Orange.  All rights reserved.
4  *
5  *     Licensed under the Apache License, Version 2.0 (the "License");
6  *     you may not use this file except in compliance with the License.
7  *     You may obtain a copy of the License at
8  *
9  *         http://www.apache.org/licenses/LICENSE-2.0
10  *
11  *     Unless required by applicable law or agreed to in writing, software
12  *     distributed under the License is distributed on an "AS IS" BASIS,
13  *     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  *     See the License for the specific language governing permissions and
15  *     limitations under the License.
16  */
17 package org.onap.nbi.apis.serviceorder.model.orchestrator;
18
19 import java.util.Date;
20 import java.util.Objects;
21 import javax.persistence.Entity;
22 import javax.persistence.GeneratedValue;
23 import javax.persistence.GenerationType;
24 import javax.persistence.Id;
25 import javax.persistence.OneToOne;
26
27 @Entity
28 public class ExecutionTask {
29
30
31     @Id
32     @GeneratedValue(strategy = GenerationType.AUTO)
33     private Long internalId;
34
35     private String orderItemId;
36
37     private String reliedTasks;
38
39     private int nbRetries;
40
41     private Date lastAttemptDate;
42
43     @OneToOne
44     private ServiceOrderInfoJson serviceOrderInfoJson;
45
46     public ServiceOrderInfoJson getServiceOrderInfoJson() {
47         return serviceOrderInfoJson;
48     }
49
50     public void setServiceOrderInfoJson(ServiceOrderInfoJson serviceOrderInfoJson) {
51         this.serviceOrderInfoJson = serviceOrderInfoJson;
52     }
53
54     public Date getLastAttemptDate() {
55         return lastAttemptDate;
56     }
57
58     public void setLastAttemptDate(Date lastAttemptDate) {
59         this.lastAttemptDate = lastAttemptDate;
60     }
61
62     public String getOrderItemId() {
63         return orderItemId;
64     }
65
66     public void setOrderItemId(String orderItemId) {
67         this.orderItemId = orderItemId;
68     }
69
70     public String getReliedTasks() {
71         return reliedTasks;
72     }
73
74     public void setReliedTasks(String reliedTasks) {
75         this.reliedTasks = reliedTasks;
76     }
77
78     public int getNbRetries() {
79         return nbRetries;
80     }
81
82     public void setNbRetries(int nbRetries) {
83         this.nbRetries = nbRetries;
84     }
85
86     public Long getInternalId() {
87         return internalId;
88     }
89
90     public void setInternalId(Long internalId) {
91         this.internalId = internalId;
92     }
93
94
95     @Override
96     public boolean equals(Object o) {
97         if (this == o)
98             return true;
99         if (o == null || getClass() != o.getClass())
100             return false;
101         ExecutionTask that = (ExecutionTask) o;
102         return nbRetries == that.nbRetries && Objects.equals(internalId, that.internalId)
103                 && Objects.equals(orderItemId, that.orderItemId) && Objects.equals(reliedTasks, that.reliedTasks)
104                 && Objects.equals(lastAttemptDate, that.lastAttemptDate)
105                 && Objects.equals(serviceOrderInfoJson, that.serviceOrderInfoJson);
106     }
107
108     @Override
109     public int hashCode() {
110         return Objects.hash(internalId, orderItemId, reliedTasks, nbRetries, lastAttemptDate, serviceOrderInfoJson);
111     }
112 }