integrated with methods
https://support.d4science.org/issues/21346#note-4
This commit is contained in:
parent
38c4012194
commit
3816d9f04b
|
@ -4,6 +4,8 @@
|
||||||
package org.gcube.portal.wssynclibrary;
|
package org.gcube.portal.wssynclibrary;
|
||||||
|
|
||||||
import org.gcube.portal.wssynclibrary.shared.ItemNotSynched;
|
import org.gcube.portal.wssynclibrary.shared.ItemNotSynched;
|
||||||
|
import org.gcube.usecases.ws.thredds.faults.WorkspaceInteractionException;
|
||||||
|
import org.gcube.usecases.ws.thredds.faults.WorkspaceNotSynchedException;
|
||||||
|
|
||||||
// TODO: Auto-generated Javadoc
|
// TODO: Auto-generated Javadoc
|
||||||
/**
|
/**
|
||||||
|
@ -26,4 +28,16 @@ public interface DoCheckSyncItem<T> {
|
||||||
*/
|
*/
|
||||||
T checkItemSynched(String itemId) throws ItemNotSynched, Exception;
|
T checkItemSynched(String itemId) throws ItemNotSynched, Exception;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the configuration.
|
||||||
|
*
|
||||||
|
* @param itemId the item id
|
||||||
|
* @return the configuration
|
||||||
|
* @throws WorkspaceInteractionException the workspace interaction exception
|
||||||
|
* @throws WorkspaceNotSynchedException the workspace not synched exception
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
T getConfiguration(String itemId) throws WorkspaceInteractionException, WorkspaceNotSynchedException, Exception;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,10 +2,6 @@ package org.gcube.portal.wssynclibrary.shared.thredds;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// TODO: Auto-generated Javadoc
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Class ThSyncFolderDescriptor.
|
* The Class ThSyncFolderDescriptor.
|
||||||
*
|
*
|
||||||
|
|
|
@ -520,4 +520,24 @@ public class WorkspaceThreddsSynchronize
|
||||||
throw new Exception("An error occurred on deleting configuration to the item id: " + itemId, e);
|
throw new Exception("An error occurred on deleting configuration to the item id: " + itemId, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ThSyncFolderDescriptor getConfiguration(String itemId)
|
||||||
|
throws WorkspaceInteractionException, WorkspaceNotSynchedException, Exception {
|
||||||
|
|
||||||
|
if (itemId == null)
|
||||||
|
throw new Exception("Invalid parameter: itemId is null");
|
||||||
|
|
||||||
|
try {
|
||||||
|
SynchFolderConfiguration syncFolderConfig = engine.getConfig(itemId);
|
||||||
|
ThSynchFolderConfiguration toFolderConfig = ThreddsConverter.toThSynchFolderConfiguration
|
||||||
|
.apply(syncFolderConfig);
|
||||||
|
|
||||||
|
return new ThSyncFolderDescriptor(itemId, null, toFolderConfig, false, null);
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("GetConfig error on folder: "+itemId, e);
|
||||||
|
throw new Exception("An error occurred on getting (sync) configuration for the item id: " + itemId, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue