Fixed Status parsing
This commit is contained in:
parent
ad9e913202
commit
5c577c2145
|
@ -121,7 +121,8 @@ public class WorkspaceFolderManager {
|
||||||
SynchFolderConfiguration config=getSynchConfiguration();
|
SynchFolderConfiguration config=getSynchConfiguration();
|
||||||
try{
|
try{
|
||||||
checkFolder(theFolder,recursively,config,null,theFolder.getId(),WorkspaceUtils.safelyGetLastUpdate(theFolder.get()));
|
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);
|
log.info("Resulting status for {} IS {} ",folderId,resultingStatus);
|
||||||
|
|
||||||
|
|
|
@ -462,7 +462,7 @@ public class WorkspaceUtils {
|
||||||
if(!(map.containsKey(Constants.WorkspaceProperties.TBS)&&Boolean.parseBoolean(map.get(Constants.WorkspaceProperties.TBS)+"")))
|
if(!(map.containsKey(Constants.WorkspaceProperties.TBS)&&Boolean.parseBoolean(map.get(Constants.WorkspaceProperties.TBS)+"")))
|
||||||
throw new WorkspaceNotSynchedException("Item is not to be synchronized");
|
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);
|
SynchronizedElementInfo toReturn=new SynchronizedElementInfo(status);
|
||||||
|
|
||||||
//TODO PARSE ALL PROPERTIES
|
//TODO PARSE ALL PROPERTIES
|
||||||
|
|
|
@ -37,7 +37,7 @@ public class TestCommons {
|
||||||
|
|
||||||
private static Map<String,TestSet> configs=new HashMap<>();
|
private static Map<String,TestSet> configs=new HashMap<>();
|
||||||
|
|
||||||
private static String toUseConfig="root";
|
private static String toUseConfig="simple";
|
||||||
|
|
||||||
|
|
||||||
static {
|
static {
|
||||||
|
|
|
@ -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.client.dsl.ItemContainer;
|
||||||
import org.gcube.common.storagehub.model.exceptions.StorageHubException;
|
import org.gcube.common.storagehub.model.exceptions.StorageHubException;
|
||||||
import org.gcube.usecases.ws.thredds.engine.impl.WorkspaceFolderManager;
|
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;
|
import org.gcube.usecases.ws.thredds.model.SynchFolderConfiguration;
|
||||||
|
|
||||||
public class WorkspaceProperties {
|
public class WorkspaceProperties {
|
||||||
|
@ -66,6 +67,7 @@ public class WorkspaceProperties {
|
||||||
}
|
}
|
||||||
for(ItemContainer<?> item:folder.list().withMetadata().getContainers())
|
for(ItemContainer<?> item:folder.list().withMetadata().getContainers())
|
||||||
if(item.getType().equals(ContainerType.FOLDER))scanForPrint((FolderContainer) item);
|
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;");
|
if(entry.getValue()==null) System.out.print(entry.getKey()+" is null;");
|
||||||
else System.out.print(entry.getKey()+" = "+entry.getValue()+";");
|
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();
|
System.out.println();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue