removed geSyncStatus

This commit is contained in:
Francesco Mangiacrapa 2021-05-13 15:02:53 +02:00
parent ac7fb2101b
commit 2cdc935d37
5 changed files with 26 additions and 75 deletions

View File

@ -214,9 +214,7 @@ public abstract class ShowThreddsFolderInfoView extends Composite {
return; return;
} }
if(syncFolderDesc.getSyncStatus()!=null) {
this.field_folder_status.setValue(syncFolderDesc.getSyncStatus().toString());
}
if(syncFolderDesc.getSelectedScope()!=null) { if(syncFolderDesc.getSelectedScope()!=null) {
String toValue = FormatUtil.toScopeValue(syncFolderDesc.getSelectedScope()); String toValue = FormatUtil.toScopeValue(syncFolderDesc.getSelectedScope());
@ -231,6 +229,9 @@ public abstract class ShowThreddsFolderInfoView extends Composite {
this.field_folder_path.setValue(sfd.getFolderPath()); this.field_folder_path.setValue(sfd.getFolderPath());
this.field_folder_path.setTitle(sfd.getFolderPath()); this.field_folder_path.setTitle(sfd.getFolderPath());
this.field_folder_locked.setValue(sfd.isLocked()+""); this.field_folder_locked.setValue(sfd.isLocked()+"");
if(sfd.getElementInfo()!=null)
this.field_folder_status.setValue(sfd.getElementInfo().getSyncStatus().toString());
ThSynchFolderConfiguration config = sfd.getConfiguration(); ThSynchFolderConfiguration config = sfd.getConfiguration();
@ -239,6 +240,7 @@ public abstract class ShowThreddsFolderInfoView extends Composite {
this.field_catalogue_name.setTitle(config.getToCreateCatalogName()); this.field_catalogue_name.setTitle(config.getToCreateCatalogName());
this.field_remote_path.setValue(config.getRemotePath()); this.field_remote_path.setValue(config.getRemotePath());
this.field_remote_path.setTitle(config.getRemotePath()); this.field_remote_path.setTitle(config.getRemotePath());
} }

View File

@ -1,6 +1,5 @@
package org.gcube.portlets.widgets.wsthreddssync.server; package org.gcube.portlets.widgets.wsthreddssync.server;
import org.gcube.portal.wssynclibrary.shared.thredds.Sync_Status;
import org.gcube.portal.wssynclibrary.shared.thredds.ThSyncFolderDescriptor; import org.gcube.portal.wssynclibrary.shared.thredds.ThSyncFolderDescriptor;
import org.gcube.portal.wssynclibrary.shared.thredds.ThSynchFolderConfiguration; import org.gcube.portal.wssynclibrary.shared.thredds.ThSynchFolderConfiguration;
import org.gcube.portlets.widgets.wsthreddssync.shared.GcubeScope; import org.gcube.portlets.widgets.wsthreddssync.shared.GcubeScope;
@ -31,15 +30,13 @@ public class BeanConverter {
* @param theStatus the the status * @param theStatus the the status
* @return the ws thredds synch folder descriptor * @return the ws thredds synch folder descriptor
*/ */
public static WsThreddsSynchFolderDescriptor toWsThreddsFolderConfig(ThSyncFolderDescriptor t, public static WsThreddsSynchFolderDescriptor toWsThreddsFolderConfig(ThSyncFolderDescriptor t) {
Sync_Status theStatus) {
if (t == null || t.getConfiguration()==null) if (t == null || t.getConfiguration()==null)
return null; return null;
WsThreddsSynchFolderDescriptor ws = new WsThreddsSynchFolderDescriptor(); WsThreddsSynchFolderDescriptor ws = new WsThreddsSynchFolderDescriptor();
ws.setServerFolderDescriptor(t); ws.setServerFolderDescriptor(t);
ws.setSyncStatus(theStatus);
// FROM TARGET TOKEN TO SCOPE // FROM TARGET TOKEN TO SCOPE
// t.getConfiguration().getTargetToken() // t.getConfiguration().getTargetToken()

View File

@ -14,7 +14,6 @@ import org.gcube.common.scope.api.ScopeProvider;
import org.gcube.oidc.rest.JWTToken; import org.gcube.oidc.rest.JWTToken;
import org.gcube.portal.oidc.lr62.OIDCUmaUtil; import org.gcube.portal.oidc.lr62.OIDCUmaUtil;
import org.gcube.portal.wssynclibrary.shared.ItemNotSynched; import org.gcube.portal.wssynclibrary.shared.ItemNotSynched;
import org.gcube.portal.wssynclibrary.shared.thredds.Sync_Status;
import org.gcube.portal.wssynclibrary.shared.thredds.ThCatalogueBean; import org.gcube.portal.wssynclibrary.shared.thredds.ThCatalogueBean;
import org.gcube.portal.wssynclibrary.shared.thredds.ThSyncFolderDescriptor; import org.gcube.portal.wssynclibrary.shared.thredds.ThSyncFolderDescriptor;
import org.gcube.portal.wssynclibrary.shared.thredds.ThSyncStatus; import org.gcube.portal.wssynclibrary.shared.thredds.ThSyncStatus;
@ -385,19 +384,19 @@ public class SyncronizeWithThredds {
workspaceThreddsSynchronize.registerCallbackForId(folderId); workspaceThreddsSynchronize.registerCallbackForId(folderId);
} }
/** // /**
* Gets the sync status info. // * Gets the sync status info.
* // *
* @param itemId the item id // * @param itemId the item id
* @param scope the scope // * @param scope the scope
* @param userToken the user token // * @param userToken the user token
* @return the sync status info // * @return the sync status info
* @throws Exception the exception // * @throws Exception the exception
*/ // */
public Sync_Status getSyncStatusInfo(String itemId, String scope, String userToken) throws Exception { // public Sync_Status getSyncStatusInfo(String itemId, String scope, String userToken) throws Exception {
setContextParameters(scope, userToken); // setContextParameters(scope, userToken);
return workspaceThreddsSynchronize.getInfo(itemId); // return workspaceThreddsSynchronize.getInfoAfterCheck(itemId);
//
} // }
} }

View File

@ -10,7 +10,6 @@ import java.util.Set;
import org.gcube.common.portal.PortalContext; import org.gcube.common.portal.PortalContext;
import org.gcube.portal.wssynclibrary.shared.ItemNotSynched; import org.gcube.portal.wssynclibrary.shared.ItemNotSynched;
import org.gcube.portal.wssynclibrary.shared.WorkspaceFolderLocked; import org.gcube.portal.wssynclibrary.shared.WorkspaceFolderLocked;
import org.gcube.portal.wssynclibrary.shared.thredds.Sync_Status;
import org.gcube.portal.wssynclibrary.shared.thredds.ThCatalogueBean; import org.gcube.portal.wssynclibrary.shared.thredds.ThCatalogueBean;
import org.gcube.portal.wssynclibrary.shared.thredds.ThSyncFolderDescriptor; import org.gcube.portal.wssynclibrary.shared.thredds.ThSyncFolderDescriptor;
import org.gcube.portal.wssynclibrary.shared.thredds.ThSyncStatus; import org.gcube.portal.wssynclibrary.shared.thredds.ThSyncStatus;
@ -134,9 +133,7 @@ public class ThreddsWorkspaceSyncServiceImpl extends RemoteServiceServlet implem
if (theConfig != null) { if (theConfig != null) {
logger.info("Folder id: " + folderId + " is synched"); logger.info("Folder id: " + folderId + " is synched");
Sync_Status theStatus = getSyncService().getSyncStatusInfo(folderId,wsScope,wsUserToken); WsThreddsSynchFolderDescriptor toWsThreddFolder = BeanConverter.toWsThreddsFolderConfig(theConfig);
WsThreddsSynchFolderDescriptor toWsThreddFolder = BeanConverter.toWsThreddsFolderConfig(theConfig,
theStatus);
logger.debug("isItemSynched for id: " + folderId + " returning: " + toWsThreddFolder); logger.debug("isItemSynched for id: " + folderId + " returning: " + toWsThreddFolder);
return toWsThreddFolder; return toWsThreddFolder;
} }

View File

@ -2,17 +2,14 @@ package org.gcube.portlets.widgets.wsthreddssync.shared;
import java.io.Serializable; import java.io.Serializable;
import org.gcube.portal.wssynclibrary.shared.thredds.Sync_Status;
import org.gcube.portal.wssynclibrary.shared.thredds.ThSyncFolderDescriptor; import org.gcube.portal.wssynclibrary.shared.thredds.ThSyncFolderDescriptor;
// TODO: Auto-generated Javadoc
/** /**
* The Class WsThreddsSynchFolderDescriptor. * The Class WsThreddsSynchFolderDescriptor.
* *
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it * @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
* *
* May 10, 2021 * May 13, 2021
*/ */
public class WsThreddsSynchFolderDescriptor implements Serializable { public class WsThreddsSynchFolderDescriptor implements Serializable {
@ -25,33 +22,24 @@ public class WsThreddsSynchFolderDescriptor implements Serializable {
private ThSyncFolderDescriptor serverFolderDescriptor; private ThSyncFolderDescriptor serverFolderDescriptor;
private Sync_Status syncStatus;
/** /**
* Instantiates a new ws thredds synch folder configuration. * Instantiates a new ws thredds synch folder configuration.
*/ */
public WsThreddsSynchFolderDescriptor() { public WsThreddsSynchFolderDescriptor() {
// TODO Auto-generated constructor stub
} }
/** /**
* Instantiates a new ws thredds synch folder descriptor. * Instantiates a new ws thredds synch folder descriptor.
* *
* @param selectedScope the selected scope * @param selectedScope the selected scope
* @param serverFolderDescriptor the server folder descriptor * @param serverFolderDescriptor the server folder descriptor
* @param syncStatus the sync status
*/ */
public WsThreddsSynchFolderDescriptor(GcubeScope selectedScope, ThSyncFolderDescriptor serverFolderDescriptor, public WsThreddsSynchFolderDescriptor(GcubeScope selectedScope, ThSyncFolderDescriptor serverFolderDescriptor) {
Sync_Status syncStatus) {
super(); super();
this.selectedScope = selectedScope; this.selectedScope = selectedScope;
this.serverFolderDescriptor = serverFolderDescriptor; this.serverFolderDescriptor = serverFolderDescriptor;
this.syncStatus = syncStatus;
} }
/** /**
* Gets the selected scope. * Gets the selected scope.
* *
@ -62,26 +50,6 @@ public class WsThreddsSynchFolderDescriptor implements Serializable {
return selectedScope; return selectedScope;
} }
/**
* Sets the sync status.
*
* @param syncStatus
* the new sync status
*/
public void setSyncStatus(Sync_Status syncStatus) {
this.syncStatus = syncStatus;
}
/**
* Gets the sync status.
*
* @return the sync status
*/
public Sync_Status getSyncStatus() {
return syncStatus;
}
/** /**
* Sets the selected scope. * Sets the selected scope.
* *
@ -103,33 +71,21 @@ public class WsThreddsSynchFolderDescriptor implements Serializable {
/** /**
* Sets the server folder descriptor. * Sets the server folder descriptor.
* *
* @param serverFolderDescriptor * @param serverFolderDescriptor the new server folder descriptor
* the new server folder descriptor
*/ */
public void setServerFolderDescriptor(ThSyncFolderDescriptor serverFolderDescriptor) { public void setServerFolderDescriptor(ThSyncFolderDescriptor serverFolderDescriptor) {
this.serverFolderDescriptor = serverFolderDescriptor; this.serverFolderDescriptor = serverFolderDescriptor;
} }
/**
* To string.
*
* @return the string
*/
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
@Override @Override
public String toString() { public String toString() {
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
builder.append("WsThreddsSynchFolderDescriptor [selectedVRE="); builder.append("WsThreddsSynchFolderDescriptor [selectedScope=");
builder.append(selectedScope); builder.append(selectedScope);
builder.append(", serverFolderDescriptor="); builder.append(", serverFolderDescriptor=");
builder.append(serverFolderDescriptor); builder.append(serverFolderDescriptor);
builder.append(", syncStatus=");
builder.append(syncStatus);
builder.append("]"); builder.append("]");
return builder.toString(); return builder.toString();
} }
} }