Added oparent to sdc main
[sdc.git] / asdctool / src / main / java / org / openecomp / sdc / asdctool / migration / core / execution / MigrationExecutionResult.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
4  * ================================================================================
5  * Copyright (C) 2019 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.openecomp.sdc.asdctool.migration.core.execution;
22
23 import org.openecomp.sdc.asdctool.migration.core.DBVersion;
24 import org.openecomp.sdc.asdctool.migration.core.task.MigrationResult;
25 import org.openecomp.sdc.be.resources.data.MigrationTaskEntry;
26
27 import java.util.Date;
28
29 public class MigrationExecutionResult {
30
31     private MigrationResult.MigrationStatus migrationStatus;
32     private String msg;
33     private double executionTime;
34     private DBVersion version;
35     private String taskName;
36     private String description;
37
38     public MigrationTaskEntry toMigrationTaskEntry() {
39         MigrationTaskEntry migrationTaskEntry = new MigrationTaskEntry();
40         migrationTaskEntry.setMajorVersion(this.getVersion().getMajor().longValue());
41         migrationTaskEntry.setMinorVersion(this.getVersion().getMinor().longValue());
42         migrationTaskEntry.setTimestamp(new Date());
43         migrationTaskEntry.setTaskName(this.getTaskName());
44         migrationTaskEntry.setTaskStatus(this.getMigrationStatus().name());
45         migrationTaskEntry.setMessage(this.getMsg());
46         migrationTaskEntry.setExecutionTime(this.getExecutionTime());
47         migrationTaskEntry.setDescription(this.getDescription());
48         return migrationTaskEntry;
49     }
50
51
52     public MigrationResult.MigrationStatus getMigrationStatus() {
53         return migrationStatus;
54     }
55
56     void setMigrationStatus(MigrationResult.MigrationStatus migrationStatus) {
57         this.migrationStatus = migrationStatus;
58     }
59
60     public String getMsg() {
61         return msg;
62     }
63
64     void setMsg(String msg) {
65         this.msg = msg;
66     }
67
68     double getExecutionTime() {
69         return executionTime;
70     }
71
72     void setExecutionTime(double executionTime) {
73         this.executionTime = executionTime;
74     }
75
76     public DBVersion getVersion() {
77         return version;
78     }
79
80     public void setVersion(DBVersion version) {
81         this.version = version;
82     }
83
84     String getTaskName() {
85         return taskName;
86     }
87
88     void setTaskName(String taskName) {
89         this.taskName = taskName;
90     }
91
92     public String getDescription() {
93         return description;
94     }
95
96     public void setDescription(String description) {
97         this.description = description;
98     }
99 }