diff --git a/src/main/java/org/gcube/portal/wssynclibrary/shared/thredds/ThStepReport.java b/src/main/java/org/gcube/portal/wssynclibrary/shared/thredds/ThStepReport.java new file mode 100644 index 0000000..be7ff2c --- /dev/null +++ b/src/main/java/org/gcube/portal/wssynclibrary/shared/thredds/ThStepReport.java @@ -0,0 +1,68 @@ +package org.gcube.portal.wssynclibrary.shared.thredds; + +import java.io.Serializable; + +/** + * The Class ThStepReport. + * + * @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it + * + * May 18, 2021 + */ +public class ThStepReport implements Serializable { + + /** + * + */ + private static final long serialVersionUID = -1678408521458644765L; + private String stepReportStatus; + + /** + * Instantiates a new th step report. + */ + public ThStepReport() { + + } + + /** + * Instantiates a new th step report. + * + * @param stepReportStatus the step report status + */ + public ThStepReport(String stepReportStatus) { + this.stepReportStatus = stepReportStatus; + } + + /** + * Gets the step report status. + * + * @return the step report status + */ + public String getStepReportStatus() { + return stepReportStatus; + } + + /** + * Sets the step report status. + * + * @param stepReportStatus the new step report status + */ + public void setStepReportStatus(String stepReportStatus) { + this.stepReportStatus = stepReportStatus; + } + + /** + * To string. + * + * @return the string + */ + @Override + public String toString() { + StringBuilder builder = new StringBuilder(); + builder.append("ThStepReport [stepReportStatus="); + builder.append(stepReportStatus); + builder.append("]"); + return builder.toString(); + } + +} diff --git a/src/main/java/org/gcube/portal/wssynclibrary/shared/thredds/ThSyncElementInfo.java b/src/main/java/org/gcube/portal/wssynclibrary/shared/thredds/ThSyncElementInfo.java index 2f08f09..d1b1947 100644 --- a/src/main/java/org/gcube/portal/wssynclibrary/shared/thredds/ThSyncElementInfo.java +++ b/src/main/java/org/gcube/portal/wssynclibrary/shared/thredds/ThSyncElementInfo.java @@ -2,8 +2,6 @@ package org.gcube.portal.wssynclibrary.shared.thredds; import java.io.Serializable; -import org.gcube.usecases.ws.thredds.model.StepReport; - /** * The Class ThSyncElementInfo. * @@ -20,7 +18,7 @@ public class ThSyncElementInfo implements Serializable { private Sync_Status syncStatus; - private StepReport.Status lastSynchronizationStatus; + private ThStepReport stepReport; private String lastupdateTime; @@ -59,54 +57,33 @@ public class ThSyncElementInfo implements Serializable { this.syncStatus = syncStatus; } - /** - * Gets the last synchronization status. - * - * @return the last synchronization status - */ - public StepReport.Status getLastSynchronizationStatus() { - return lastSynchronizationStatus; + public ThStepReport getStepReport() { + return stepReport; } - /** - * Sets the last synchronization status. - * - * @param lastSynchronizationStatus the new last synchronization status - */ - public void setLastSynchronizationStatus(StepReport.Status lastSynchronizationStatus) { - this.lastSynchronizationStatus = lastSynchronizationStatus; + public void setStepReport(ThStepReport stepReport) { + this.stepReport = stepReport; } - /** - * Gets the lastupdate time. - * - * @return the lastupdate time - */ public String getLastupdateTime() { return lastupdateTime; } - /** - * Sets the lastupdate time. - * - * @param lastupdateTime the new lastupdate time - */ public void setLastupdateTime(String lastupdateTime) { this.lastupdateTime = lastupdateTime; } - /** - * To string. - * - * @return the string - */ @Override public String toString() { StringBuilder builder = new StringBuilder(); builder.append("ThSyncElementInfo [syncStatus="); builder.append(syncStatus); + builder.append(", stepReport="); + builder.append(stepReport); + builder.append(", lastupdateTime="); + builder.append(lastupdateTime); builder.append("]"); return builder.toString(); } -} +} \ No newline at end of file diff --git a/src/main/java/org/gcube/portal/wssynclibrary/thredds/ThreddsConverter.java b/src/main/java/org/gcube/portal/wssynclibrary/thredds/ThreddsConverter.java index 9de5ac6..fbdf465 100644 --- a/src/main/java/org/gcube/portal/wssynclibrary/thredds/ThreddsConverter.java +++ b/src/main/java/org/gcube/portal/wssynclibrary/thredds/ThreddsConverter.java @@ -7,6 +7,7 @@ import org.gcube.portal.wssynclibrary.shared.thredds.Sync_Status; import org.gcube.portal.wssynclibrary.shared.thredds.ThCatalogueBean; import org.gcube.portal.wssynclibrary.shared.thredds.ThProcessDescriptor; import org.gcube.portal.wssynclibrary.shared.thredds.ThProcessStatus; +import org.gcube.portal.wssynclibrary.shared.thredds.ThStepReport; import org.gcube.portal.wssynclibrary.shared.thredds.ThSyncElementInfo; import org.gcube.portal.wssynclibrary.shared.thredds.ThSyncFolderDescriptor; import org.gcube.portal.wssynclibrary.shared.thredds.ThSynchFolderConfiguration; @@ -209,7 +210,10 @@ public class ThreddsConverter { Sync_Status theSyncStatus = toSyncStatus.apply(sei.getStatus()); toReturn.setSyncStatus(theSyncStatus); toReturn.setLastupdateTime(sei.getLastupdateTime()); - toReturn.setLastSynchronizationStatus(sei.getLastSynchronizationStatus()); + String lastSyncStatus = sei.getLastSynchronizationStatus() != null + ? sei.getLastSynchronizationStatus().name() + : null; + toReturn.setStepReport(new ThStepReport(lastSyncStatus)); return toReturn; } };