public class WorkspaceThreddsSynchronize extends Object implements WorkspaceThreddsSynchronizedRepository<ThSyncStatus,ThSyncFolderDescriptor>
| Modifier and Type | Method and Description |
|---|---|
ThSyncFolderDescriptor |
checkItemSynched(String itemId)
Check item synched.
|
String |
decribeSyncRepository()
Decribe sync repository.
|
ThSyncStatus |
doSync(String itemId)
Do sync.
|
Boolean |
doUnSync(String itemId,
boolean deleteRemoteContent)
Do un sync.
|
List<ThCatalogueBean> |
getAvailableCatalogues()
Gets the available catalogues.
|
ThSyncFolderDescriptor |
getConfiguration(String itemId)
Gets the configuration.
|
ThSyncElementInfo |
getElementInfo(Map<String,Object> itemProperties,
org.gcube.usecases.ws.thredds.model.ContainerType itemType)
Gets the element info.
|
static WorkspaceThreddsSynchronize |
getInstance()
Gets the single instance of WorkspaceThreddsSynchronize.
|
Boolean |
initRepository()
Inits the repository.
|
boolean |
isItemSynched(String itemId,
Map<String,Object> itemProperties,
org.gcube.usecases.ws.thredds.model.ContainerType itemType)
Checks if is item synched.
|
ThSyncStatus |
monitorSyncStatus(String itemId)
Monitor sync status.
|
void |
registerCallbackForId(String itemId)
Register callback for id.
|
Boolean |
removeSync(String itemId)
Removes the sync.
|
ThSyncFolderDescriptor |
setSynchronizedFolder(ThSynchFolderConfiguration thConfig,
String itemId)
Sets the synchronized folder.
|
Boolean |
shutDownRepository()
Shut down repository.
|
Boolean |
stopSync(String itemId)
Stop sync.
|
public static WorkspaceThreddsSynchronize getInstance()
public ThSyncFolderDescriptor checkItemSynched(String itemId) throws ItemNotSynched, WorkspaceFolderLocked, Exception
checkItemSynched in interface DoCheckSyncItem<ThSyncFolderDescriptor>itemId - the item idItemNotSynched - the item not synchedWorkspaceFolderLocked - the workspace folder lockedException - the exceptionpublic ThSyncFolderDescriptor setSynchronizedFolder(ThSynchFolderConfiguration thConfig, String itemId) throws Exception
thConfig - the th configitemId - the item idException - the exceptionpublic ThSyncStatus doSync(String itemId) throws Exception
doSync in interface DoSyncItem<ThSyncStatus>itemId - the item idException - the exceptionpublic ThSyncStatus monitorSyncStatus(String itemId) throws ItemNotSynched, Exception
monitorSyncStatus in interface DoSyncItem<ThSyncStatus>itemId - the item idItemNotSynched - the item not synchedException - the exceptionpublic void registerCallbackForId(String itemId) throws org.gcube.usecases.ws.thredds.faults.ProcessNotFoundException, Exception
registerCallbackForId in interface DoSyncItem<ThSyncStatus>itemId - the item idorg.gcube.usecases.ws.thredds.faults.ProcessNotFoundException - the process not found exceptionException - the exceptionpublic List<ThCatalogueBean> getAvailableCatalogues() throws Exception
Exception - the exceptionpublic Boolean doUnSync(String itemId, boolean deleteRemoteContent) throws Exception
doUnSync in interface DoSyncItem<ThSyncStatus>itemId - the item iddeleteRemoteContent - the delete remote contentException - the exceptionpublic ThSyncFolderDescriptor getConfiguration(String itemId) throws org.gcube.usecases.ws.thredds.faults.WorkspaceInteractionException, org.gcube.usecases.ws.thredds.faults.WorkspaceNotSynchedException, Exception
getConfiguration in interface DoCheckSyncItem<ThSyncFolderDescriptor>itemId - the item idorg.gcube.usecases.ws.thredds.faults.WorkspaceInteractionException - the workspace interaction exceptionorg.gcube.usecases.ws.thredds.faults.WorkspaceNotSynchedException - the workspace not synched exceptionException - the exception
NB. it is time consuming due to it
calls the SHUBpublic ThSyncElementInfo getElementInfo(Map<String,Object> itemProperties, org.gcube.usecases.ws.thredds.model.ContainerType itemType) throws org.gcube.usecases.ws.thredds.faults.WorkspaceNotSynchedException
itemProperties - the item properties read from SHUB by accessing to
Metadata.Map() of a itemitemType - the item typeorg.gcube.usecases.ws.thredds.faults.WorkspaceNotSynchedException - the workspace not synched exceptionpublic boolean isItemSynched(String itemId, Map<String,Object> itemProperties, org.gcube.usecases.ws.thredds.model.ContainerType itemType)
SyncEngine.parseInfo(Map, ContainerType)itemId - the item iditemProperties - the item propertiesitemType - the item typepublic Boolean removeSync(String itemId) throws Exception
removeSync in interface DoSyncItem<ThSyncStatus>itemId - the item idException - the exceptionpublic Boolean stopSync(String itemId) throws Exception
stopSync in interface DoSyncItem<ThSyncStatus>itemId - the item idException - the exceptionpublic Boolean initRepository() throws Exception
initRepository in interface DoConnectRepositoryException - the exceptionpublic Boolean shutDownRepository()
shutDownRepository in interface DoConnectRepositorypublic String decribeSyncRepository()
decribeSyncRepository in interface WorkspaceThreddsSynchronizedRepository<ThSyncStatus,ThSyncFolderDescriptor>Copyright © 2021. All Rights Reserved.