aboutsummaryrefslogtreecommitdiffstats
path: root/mso-api-handlers
diff options
context:
space:
mode:
authorSeshu Kumar M <seshu.kumar.m@huawei.com>2020-02-12 07:27:22 +0000
committerGerrit Code Review <gerrit@onap.org>2020-02-12 07:27:22 +0000
commit78eb0176ae83484534789cafb60f773c8f8d3f44 (patch)
treecc5d82e97df9eb8cd7ea70398c1bd6ff686a90f5 /mso-api-handlers
parent00ba764f619848bcd4a384e26b0806bd5fb80749 (diff)
parent75dc3bd27de1a99f7049b617ae2429b133978bfd (diff)
Merge "Add table for OrchestrationTask in requestDB"
Diffstat (limited to 'mso-api-handlers')
-rw-r--r--mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/OrchestrationTask.java143
1 files changed, 143 insertions, 0 deletions
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/OrchestrationTask.java b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/OrchestrationTask.java
new file mode 100644
index 0000000000..53760f1b00
--- /dev/null
+++ b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/OrchestrationTask.java
@@ -0,0 +1,143 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2019 Huawei Technologies Co., Ltd. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License")
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.db.request.beans;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.hibernate.annotations.DynamicUpdate;
+import javax.persistence.*;
+import java.io.Serializable;
+import java.util.Date;
+import java.util.Objects;
+
+@Entity
+@DynamicUpdate
+@Table(name = "orchestration_task")
+public class OrchestrationTask implements Serializable {
+
+ private static final long serialVersionUID = -9158494554305291596L;
+
+ @Id
+ @Column(name = "TASK_ID", nullable = false, updatable = false)
+ private String taskId;
+
+ @Column(name = "REQUEST_ID", nullable = false, updatable = false)
+ private String requestId;
+
+ @Column(name = "NAME")
+ private String name;
+
+ @Column(name = "CREATED_TIME")
+ private Date createdTime;
+
+ @Column(name = "STATUS")
+ private String status;
+
+ @Column(name = "IS_MANUAL")
+ private String isManual;
+
+ @Column(name = "PARAMS")
+ private String params;
+
+ public String getTaskId() {
+ return taskId;
+ }
+
+ public void setTaskId(String taskId) {
+ this.taskId = taskId;
+ }
+
+ public String getRequestId() {
+ return requestId;
+ }
+
+ public void setRequestId(String requestId) {
+ this.requestId = requestId;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public Date getCreatedTime() {
+ return createdTime;
+ }
+
+ public void setCreatedTime(Date createdTime) {
+ this.createdTime = createdTime;
+ }
+
+ public String getStatus() {
+ return status;
+ }
+
+ public void setStatus(String status) {
+ this.status = status;
+ }
+
+ public String getIsManual() {
+ return isManual;
+ }
+
+ public void setIsManual(String isManual) {
+ this.isManual = isManual;
+ }
+
+ public String getParams() {
+ return params;
+ }
+
+ public void setParams(String parameters) {
+ this.params = parameters;
+ }
+
+ @Override
+ public boolean equals(final Object other) {
+ if (this == other) {
+ return true;
+ }
+ if (!(other instanceof OrchestrationTask)) {
+ return false;
+ }
+ OrchestrationTask castOther = (OrchestrationTask) other;
+ return Objects.equals(getTaskId(), castOther.getTaskId());
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(this.getTaskId());
+ }
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this).append("taskId", getTaskId()).toString();
+ }
+
+ @PrePersist
+ protected void onCreate() {
+ this.createdTime = new Date();
+ }
+
+}
+