Updated pom version at 1.3.0
Task #17348 - Migrate ws-thredds-sync components to SHUB git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portal/ws-synchronized-module-library@181399 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
31e1b6cc56
commit
5e7bc1177a
|
@ -10,6 +10,7 @@
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="optional" value="true"/>
|
<attribute name="optional" value="true"/>
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
<attribute name="test" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
|
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
|
||||||
|
|
|
@ -5,4 +5,5 @@ org.eclipse.jdt.core.compiler.compliance=1.8
|
||||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
||||||
|
org.eclipse.jdt.core.compiler.release=disabled
|
||||||
org.eclipse.jdt.core.compiler.source=1.8
|
org.eclipse.jdt.core.compiler.source=1.8
|
||||||
|
|
|
@ -1,21 +1,31 @@
|
||||||
<ReleaseNotes>
|
<ReleaseNotes>
|
||||||
<Changeset component="org.gcube.portal.ws-synchronized-module-library.1-2-0"
|
<Changeset
|
||||||
|
component="org.gcube.portal.ws-synchronized-module-library.1-3-0"
|
||||||
|
date="${buildDate}">
|
||||||
|
<Change>[Task #17348] Migrate ws-thredds-sync components to SHUB
|
||||||
|
</Change>
|
||||||
|
</Changeset>
|
||||||
|
<Changeset
|
||||||
|
component="org.gcube.portal.ws-synchronized-module-library.1-2-0"
|
||||||
date="${buildDate}">
|
date="${buildDate}">
|
||||||
<Change>Only changed the call getPropertMap -> getMetadata.getMap
|
<Change>Only changed the call getPropertMap -> getMetadata.getMap
|
||||||
</Change>
|
</Change>
|
||||||
</Changeset>
|
</Changeset>
|
||||||
<Changeset component="org.gcube.portal.ws-synchronized-module-library.1-1-0"
|
<Changeset
|
||||||
|
component="org.gcube.portal.ws-synchronized-module-library.1-1-0"
|
||||||
date="2018-11-20">
|
date="2018-11-20">
|
||||||
<Change>[Task #12909] Reading the "WS-SYNCH.SYNCH-STATUS" property
|
<Change>[Task #12909] Reading the "WS-SYNCH.SYNCH-STATUS" property
|
||||||
from StorageHub instead of HL
|
from StorageHub instead of HL
|
||||||
</Change>
|
</Change>
|
||||||
</Changeset>
|
</Changeset>
|
||||||
<Changeset component="org.gcube.portal.ws-synchronized-module-library.1-0-1"
|
<Changeset
|
||||||
|
component="org.gcube.portal.ws-synchronized-module-library.1-0-1"
|
||||||
date="2018-09-04">
|
date="2018-09-04">
|
||||||
<Change>[Task #12302] Fix ws-thredds dependency on workspace
|
<Change>[Task #12302] Fix ws-thredds dependency on workspace
|
||||||
</Change>
|
</Change>
|
||||||
</Changeset>
|
</Changeset>
|
||||||
<Changeset component="org.gcube.portal.ws-synchronized-module-library.1-0-0"
|
<Changeset
|
||||||
|
component="org.gcube.portal.ws-synchronized-module-library.1-0-0"
|
||||||
date="2018-03-16">
|
date="2018-03-16">
|
||||||
<Change>First Release</Change>
|
<Change>First Release</Change>
|
||||||
</Changeset>
|
</Changeset>
|
||||||
|
|
2
pom.xml
2
pom.xml
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
<groupId>org.gcube.portal</groupId>
|
<groupId>org.gcube.portal</groupId>
|
||||||
<artifactId>ws-synchronized-module-library</artifactId>
|
<artifactId>ws-synchronized-module-library</artifactId>
|
||||||
<version>1.2.0-SNAPSHOT</version>
|
<version>1.3.0-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>ws-synchronized-module-library</name>
|
<name>ws-synchronized-module-library</name>
|
||||||
|
|
|
@ -1,26 +1,8 @@
|
||||||
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.net.MalformedURLException;
|
|
||||||
|
|
||||||
import org.gcube.common.homelibrary.home.HomeLibrary;
|
|
||||||
import org.gcube.common.homelibrary.home.exceptions.HomeNotFoundException;
|
|
||||||
import org.gcube.common.homelibrary.home.exceptions.InternalErrorException;
|
|
||||||
import org.gcube.common.homelibrary.home.exceptions.UserNotFoundException;
|
|
||||||
import org.gcube.common.homelibrary.home.workspace.Workspace;
|
|
||||||
import org.gcube.common.homelibrary.home.workspace.WorkspaceFolder;
|
|
||||||
import org.gcube.common.homelibrary.home.workspace.exceptions.InsufficientPrivilegesException;
|
|
||||||
import org.gcube.common.homelibrary.home.workspace.exceptions.ItemAlreadyExistException;
|
|
||||||
import org.gcube.common.homelibrary.home.workspace.exceptions.ItemNotFoundException;
|
|
||||||
import org.gcube.common.homelibrary.home.workspace.exceptions.WorkspaceFolderNotFoundException;
|
|
||||||
import org.gcube.common.scope.api.ScopeProvider;
|
|
||||||
import org.gcube.common.scope.impl.ScopeBean;
|
|
||||||
import org.gcube.usecases.ws.thredds.SyncEngine;
|
import org.gcube.usecases.ws.thredds.SyncEngine;
|
||||||
import org.gcube.usecases.ws.thredds.engine.impl.ProcessDescriptor;
|
import org.gcube.usecases.ws.thredds.engine.impl.ProcessDescriptor;
|
||||||
import org.gcube.usecases.ws.thredds.engine.impl.ProcessStatus;
|
import org.gcube.usecases.ws.thredds.engine.impl.ProcessStatus;
|
||||||
import org.gcube.usecases.ws.thredds.faults.InternalException;
|
|
||||||
import org.gcube.usecases.ws.thredds.faults.ProcessNotFoundException;
|
|
||||||
import org.gcube.usecases.ws.thredds.faults.WorkspaceInteractionException;
|
|
||||||
import org.gcube.usecases.ws.thredds.faults.WorkspaceLockedException;
|
import org.gcube.usecases.ws.thredds.faults.WorkspaceLockedException;
|
||||||
import org.gcube.usecases.ws.thredds.faults.WorkspaceNotSynchedException;
|
import org.gcube.usecases.ws.thredds.faults.WorkspaceNotSynchedException;
|
||||||
import org.gcube.usecases.ws.thredds.model.SyncOperationCallBack;
|
import org.gcube.usecases.ws.thredds.model.SyncOperationCallBack;
|
||||||
|
@ -42,26 +24,11 @@ public class TestWsThreddsEngine {
|
||||||
|
|
||||||
public static String TEST_FOLDER_ID = "";
|
public static String TEST_FOLDER_ID = "";
|
||||||
|
|
||||||
public static void main(String[] args) throws ProcessNotFoundException, InternalErrorException, WorkspaceInteractionException, InternalException, WorkspaceFolderNotFoundException, ItemNotFoundException, InsufficientPrivilegesException, ItemAlreadyExistException, HomeNotFoundException, UserNotFoundException, MalformedURLException, IOException {
|
public static void main(String[] args) throws Exception{
|
||||||
|
|
||||||
// GET ENGINE : SINGLETON INSTANCE
|
// GET ENGINE : SINGLETON INSTANCE
|
||||||
SyncEngine engine=SyncEngine.get();
|
SyncEngine engine=SyncEngine.get();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Workspace ws = HomeLibrary
|
|
||||||
.getHomeManagerFactory()
|
|
||||||
.getHomeManager()
|
|
||||||
.getHome(TEST_USER)
|
|
||||||
.getWorkspace();
|
|
||||||
|
|
||||||
|
|
||||||
//TEST INFO...
|
|
||||||
//TestCommons.setScope();
|
|
||||||
ScopeBean scope = new ScopeBean(DEFAULT_SCOPE);
|
|
||||||
ScopeProvider.instance.set(scope.toString());
|
|
||||||
WorkspaceFolder folder=(WorkspaceFolder) ws.getItem(TEST_FOLDER_ID);
|
|
||||||
|
|
||||||
// FOLDER CONFIGURATION BEAN
|
// FOLDER CONFIGURATION BEAN
|
||||||
//SynchFolderConfiguration config=TestCommons.getSynchConfig();
|
//SynchFolderConfiguration config=TestCommons.getSynchConfig();
|
||||||
|
|
||||||
|
@ -69,33 +36,33 @@ public class TestWsThreddsEngine {
|
||||||
String remotePersistence = "";
|
String remotePersistence = "";
|
||||||
String remotePath = "";
|
String remotePath = "";
|
||||||
String targetToken = "";
|
String targetToken = "";
|
||||||
SynchFolderConfiguration config = new SynchFolderConfiguration(remotePath, filter, targetToken, remotePersistence, folder.getId());
|
SynchFolderConfiguration config = new SynchFolderConfiguration(remotePath, filter, targetToken, remotePersistence, TEST_FOLDER_ID);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
//try to clean it up, first..
|
//try to clean it up, first..
|
||||||
System.out.println("Cleaning it up..");
|
System.out.println("Cleaning it up..");
|
||||||
engine.unsetSynchronizedFolder(folder.getId(), false);
|
engine.unsetSynchronizedFolder(TEST_FOLDER_ID, false);
|
||||||
}catch(WorkspaceNotSynchedException e) {
|
}catch(WorkspaceNotSynchedException e) {
|
||||||
// it was already cleared
|
// it was already cleared
|
||||||
}catch(WorkspaceLockedException e) {
|
}catch(WorkspaceLockedException e) {
|
||||||
engine.forceUnlock(folder.getId());
|
engine.forceUnlock(TEST_FOLDER_ID);
|
||||||
engine.unsetSynchronizedFolder(folder.getId(), false);
|
engine.unsetSynchronizedFolder(TEST_FOLDER_ID, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// WHEN OPENING A FOLDER, INVOKE CHECK TO UPDATE SYNCH STATUS
|
// WHEN OPENING A FOLDER, INVOKE CHECK TO UPDATE SYNCH STATUS
|
||||||
engine.check(folder.getId(), false);
|
engine.check(TEST_FOLDER_ID, false);
|
||||||
}catch(WorkspaceNotSynchedException e) {
|
}catch(WorkspaceNotSynchedException e) {
|
||||||
System.out.println("Folder not synched, configurin it..");
|
System.out.println("Folder not synched, configurin it..");
|
||||||
engine.setSynchronizedFolder(config, folder.getId());
|
engine.setSynchronizedFolder(config, TEST_FOLDER_ID);
|
||||||
}catch(WorkspaceLockedException e) {
|
}catch(WorkspaceLockedException e) {
|
||||||
System.out.println("Workspace locked, going to force unlock.."); // MAINLY FOR TEST PURPOSES, OR WHEN SOMETHIGN GOES WRONG.. USE CAUTIOUSLY
|
System.out.println("Workspace locked, going to force unlock.."); // MAINLY FOR TEST PURPOSES, OR WHEN SOMETHIGN GOES WRONG.. USE CAUTIOUSLY
|
||||||
engine.forceUnlock(folder.getId());
|
engine.forceUnlock(TEST_FOLDER_ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
// INVOKE SYNCHRONIZATION ON FOLDER
|
// INVOKE SYNCHRONIZATION ON FOLDER
|
||||||
ProcessDescriptor descriptor=engine.doSync(folder.getId());
|
ProcessDescriptor descriptor=engine.doSync(TEST_FOLDER_ID);
|
||||||
|
|
||||||
System.out.println("Obtained descriptor : "+descriptor);
|
System.out.println("Obtained descriptor : "+descriptor);
|
||||||
|
|
||||||
|
@ -115,10 +82,10 @@ public class TestWsThreddsEngine {
|
||||||
};
|
};
|
||||||
|
|
||||||
// REGISTER CALLBACK TO MONITOR PROGRESS
|
// REGISTER CALLBACK TO MONITOR PROGRESS
|
||||||
engine.registerCallBack(folder.getId(), syncCall);
|
engine.registerCallBack(TEST_FOLDER_ID, syncCall);
|
||||||
|
|
||||||
|
|
||||||
engine.check(folder.getId(), true);
|
engine.check(TEST_FOLDER_ID, true);
|
||||||
|
|
||||||
|
|
||||||
// INVOKE WHEN PORTAL SHUTS DOWN TO FREE RESOURCES AND STOP SYNC PROCESSES
|
// INVOKE WHEN PORTAL SHUTS DOWN TO FREE RESOURCES AND STOP SYNC PROCESSES
|
||||||
|
|
Loading…
Reference in New Issue