2 * ============LICENSE_START=======================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.openecomp.sdc.asdctool.migration.core.execution;
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;
27 import java.util.Date;
29 public class MigrationExecutionResult {
31 private MigrationResult.MigrationStatus migrationStatus;
33 private double executionTime;
34 private DBVersion version;
35 private String taskName;
36 private String description;
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;
52 public MigrationResult.MigrationStatus getMigrationStatus() {
53 return migrationStatus;
56 void setMigrationStatus(MigrationResult.MigrationStatus migrationStatus) {
57 this.migrationStatus = migrationStatus;
60 public String getMsg() {
64 void setMsg(String msg) {
68 double getExecutionTime() {
72 void setExecutionTime(double executionTime) {
73 this.executionTime = executionTime;
76 public DBVersion getVersion() {
80 public void setVersion(DBVersion version) {
81 this.version = version;
84 String getTaskName() {
88 void setTaskName(String taskName) {
89 this.taskName = taskName;
92 public String getDescription() {
96 public void setDescription(String description) {
97 this.description = description;