/** * Completes the migration and calculates the status. */ public void complete() { this.endDate = new Date(); if (reports.stream().allMatch(report -> report.isSuccessful() == true)) { this.successful = true; } }
protected MigrationReportInstance convertMigrationReport(MigrationReport report) { if (report == null) { return null; } MigrationReportInstance reportInstance = MigrationReportInstance.builder() .successful(report.isSuccessful()) .startDate(report.getStartDate()) .endDate(report.getEndDate()) .logs(convertLogs(report.getEntries())) .processInstanceId(report.getProcessInstanceId()) .build(); return reportInstance; }
public static MigrationReportInstance convertMigrationReport(MigrationReport report) { if (report == null) { return null; } MigrationReportInstance reportInstance = MigrationReportInstance.builder() .successful(report.isSuccessful()) .startDate(report.getStartDate()) .endDate(report.getEndDate()) .logs(convertLogs(report.getEntries())) .processInstanceId(report.getProcessInstanceId()) .build(); return reportInstance; }