Validation management (default false)

This commit is contained in:
Fabio Sinibaldi 2021-03-24 17:38:52 +01:00
parent 289ad99094
commit 73ca36949f
4 changed files with 44 additions and 2 deletions

View File

@ -21,6 +21,8 @@ public class Constants {
public static final String SIS_PLUGIN_ID="SIS/GEOTK"; public static final String SIS_PLUGIN_ID="SIS/GEOTK";
public static final String SIS_PLUGIN_VALIDATE_PARAMETER="VALIDATE";
public static class WorkspaceProperties{ public static class WorkspaceProperties{
// Folder // Folder

View File

@ -104,7 +104,11 @@ public class SynchronizationThread implements Runnable {
Set<PluginInvocation> invocations=null; Set<PluginInvocation> invocations=null;
if(metadataItem==null) { if(metadataItem==null) {
log.debug("Metadata not found, asking SIS/GEOTK for generation.."); log.debug("Metadata not found, asking SIS/GEOTK for generation..");
invocations=Collections.singleton(new PluginInvocation(Constants.SIS_PLUGIN_ID)); PluginInvocation inv=new PluginInvocation(Constants.SIS_PLUGIN_ID);
inv.setParameters(Collections.singletonMap(Constants.SIS_PLUGIN_VALIDATE_PARAMETER, synchConfig.getValidateMetadata()+""));
invocations=Collections.singleton(inv);
} }
log.info("Transferring to {} with invocations {} ",toSetDestination,invocations); log.info("Transferring to {} with invocations {} ",toSetDestination,invocations);

View File

@ -26,7 +26,7 @@ public class SynchFolderConfiguration {
private String remotePersistence="thredds"; private String remotePersistence="thredds";
@NonNull @NonNull
private Boolean validateMetadata=true; private Boolean validateMetadata=false;
@NonNull @NonNull
private String rootFolderId; private String rootFolderId;

View File

@ -0,0 +1,36 @@
package org.gcube.usecases.ws.thredds;
import java.util.Map;
import org.gcube.common.storagehub.client.dsl.FolderContainer;
import org.gcube.common.storagehub.model.Metadata;
import org.gcube.common.storagehub.model.exceptions.StorageHubException;
import org.gcube.usecases.ws.thredds.engine.impl.WorkspaceFolderManager;
import org.gcube.usecases.ws.thredds.faults.WorkspaceInteractionException;
public class SetValidate {
public static void main(String[] args) throws WorkspaceInteractionException, StorageHubException {
String itemId="e4a0f901-5d8e-4b44-a947-4105d9b04a55";
String context="/pred4s/preprod/preVRE";
Boolean toSetValidate=false;
TokenSetter.set(context);
WorkspaceFolderManager mng=new WorkspaceFolderManager(itemId);
FolderContainer folder=mng.getTheFolder();
Metadata meta=folder.get().getMetadata();
Map<String,Object> map=meta.getMap();
map.put(Constants.WorkspaceProperties.VALIDATE_METADATA,toSetValidate+"");
meta.setMap(map);
folder.setMetadata(meta);
System.out.println("DONE");
}
}