Fixed Status parsing

This commit is contained in:
Fabio Sinibaldi 2021-05-14 16:00:09 +02:00
parent ad9e913202
commit 5c577c2145
4 changed files with 11 additions and 3 deletions

View File

@ -121,7 +121,8 @@ public class WorkspaceFolderManager {
SynchFolderConfiguration config=getSynchConfiguration();
try{
checkFolder(theFolder,recursively,config,null,theFolder.getId(),WorkspaceUtils.safelyGetLastUpdate(theFolder.get()));
SynchronizationStatus resultingStatus=SynchronizationStatus.valueOf(theFolder.get().getMetadata().getMap().get(Constants.WorkspaceProperties.LAST_UPDATE_STATUS)+"");
SynchronizationStatus resultingStatus=
SynchronizationStatus.valueOf(theFolder.get().getMetadata().getMap().get(Constants.WorkspaceProperties.SYNCHRONIZATION_STATUS)+"");
log.info("Resulting status for {} IS {} ",folderId,resultingStatus);

View File

@ -462,7 +462,7 @@ public class WorkspaceUtils {
if(!(map.containsKey(Constants.WorkspaceProperties.TBS)&&Boolean.parseBoolean(map.get(Constants.WorkspaceProperties.TBS)+"")))
throw new WorkspaceNotSynchedException("Item is not to be synchronized");
SynchronizationStatus status = SynchronizationStatus.valueOf(map.get(Constants.WorkspaceProperties.LAST_UPDATE_STATUS)+"");
SynchronizationStatus status = SynchronizationStatus.valueOf(map.get(Constants.WorkspaceProperties.SYNCHRONIZATION_STATUS)+"");
SynchronizedElementInfo toReturn=new SynchronizedElementInfo(status);
//TODO PARSE ALL PROPERTIES

View File

@ -37,7 +37,7 @@ public class TestCommons {
private static Map<String,TestSet> configs=new HashMap<>();
private static String toUseConfig="root";
private static String toUseConfig="simple";
static {

View File

@ -8,6 +8,7 @@ import org.gcube.common.storagehub.client.dsl.FolderContainer;
import org.gcube.common.storagehub.client.dsl.ItemContainer;
import org.gcube.common.storagehub.model.exceptions.StorageHubException;
import org.gcube.usecases.ws.thredds.engine.impl.WorkspaceFolderManager;
import org.gcube.usecases.ws.thredds.faults.WorkspaceNotSynchedException;
import org.gcube.usecases.ws.thredds.model.SynchFolderConfiguration;
public class WorkspaceProperties {
@ -66,6 +67,7 @@ public class WorkspaceProperties {
}
for(ItemContainer<?> item:folder.list().withMetadata().getContainers())
if(item.getType().equals(ContainerType.FOLDER))scanForPrint((FolderContainer) item);
}
@ -80,6 +82,11 @@ public class WorkspaceProperties {
if(entry.getValue()==null) System.out.print(entry.getKey()+" is null;");
else System.out.print(entry.getKey()+" = "+entry.getValue()+";");
}
try{
System.out.println(SyncEngine.parseInfo(map, org.gcube.usecases.ws.thredds.model.ContainerType.valueOf(item.getType().toString())));
}catch(Throwable t) {
System.err.println("ITEM ID "+item.getId()+t.getMessage());
}
}
System.out.println();
}