added new class ThStepReport

This commit is contained in:
Francesco Mangiacrapa 2021-05-18 16:12:33 +02:00
parent 6506500f91
commit 55d1edde30
3 changed files with 83 additions and 34 deletions

View File

@ -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();
}
}

View File

@ -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();
}
}
}

View File

@ -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;
}
};