moved to 1.5.0-SNAPSHOT. Starting migration to ws-thredds.1.x
This commit is contained in:
parent
59498cd6b3
commit
38c4012194
|
@ -4,6 +4,10 @@
|
||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [v1.5.0-SNAPSHOT] - 2021-05-07
|
||||||
|
|
||||||
|
[#21374] Moved to ws-thredds 1.x
|
||||||
|
|
||||||
|
|
||||||
## [v1.4.0] - 2021-03-10
|
## [v1.4.0] - 2021-03-10
|
||||||
|
|
||||||
|
|
6
pom.xml
6
pom.xml
|
@ -12,7 +12,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.4.0</version>
|
<version>1.5.0-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<name>ws-synchronized-module-library</name>
|
<name>ws-synchronized-module-library</name>
|
||||||
<description>
|
<description>
|
||||||
|
@ -37,7 +37,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.distribution</groupId>
|
<groupId>org.gcube.distribution</groupId>
|
||||||
<artifactId>maven-portal-bom</artifactId>
|
<artifactId>maven-portal-bom</artifactId>
|
||||||
<version>3.6.0</version>
|
<version>3.6.1</version>
|
||||||
<type>pom</type>
|
<type>pom</type>
|
||||||
<scope>import</scope>
|
<scope>import</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
@ -49,7 +49,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.spatial.data</groupId>
|
<groupId>org.gcube.spatial.data</groupId>
|
||||||
<artifactId>ws-thredds</artifactId>
|
<artifactId>ws-thredds</artifactId>
|
||||||
<version>[0.1.0, 1.0.0-SNAPSHOT)</version>
|
<version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,9 @@
|
||||||
package org.gcube.portal.wssynclibrary;
|
package org.gcube.portal.wssynclibrary;
|
||||||
|
|
||||||
|
|
||||||
// TODO: Auto-generated Javadoc
|
|
||||||
/**
|
/**
|
||||||
* The Interface DoConnectRepository.
|
* The Interface DoConnectRepository.
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it Feb 14, 2018
|
||||||
* Feb 14, 2018
|
|
||||||
*/
|
*/
|
||||||
public interface DoConnectRepository {
|
public interface DoConnectRepository {
|
||||||
|
|
||||||
|
@ -14,8 +11,9 @@ public interface DoConnectRepository {
|
||||||
* Inits the repository.
|
* Inits the repository.
|
||||||
*
|
*
|
||||||
* @return true, if successful
|
* @return true, if successful
|
||||||
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
Boolean initRepository();
|
Boolean initRepository() throws Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shutdown repository.
|
* Shutdown repository.
|
||||||
|
|
|
@ -2,13 +2,11 @@ package org.gcube.portal.wssynclibrary.shared.thredds;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
|
||||||
// TODO: Auto-generated Javadoc
|
// TODO: Auto-generated Javadoc
|
||||||
/**
|
/**
|
||||||
* The Class ThSynchFolderConfiguration.
|
* The Class ThSynchFolderConfiguration.
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it Feb 8, 2018
|
||||||
* Feb 8, 2018
|
|
||||||
*/
|
*/
|
||||||
public class ThSynchFolderConfiguration implements Serializable {
|
public class ThSynchFolderConfiguration implements Serializable {
|
||||||
|
|
||||||
|
@ -21,8 +19,7 @@ public class ThSynchFolderConfiguration implements Serializable{
|
||||||
/** The filter. */
|
/** The filter. */
|
||||||
private String filter;
|
private String filter;
|
||||||
|
|
||||||
/** The target token. */
|
private String targetContext;
|
||||||
private String targetToken;
|
|
||||||
|
|
||||||
/** The to create catalog name. */
|
/** The to create catalog name. */
|
||||||
private String toCreateCatalogName;
|
private String toCreateCatalogName;
|
||||||
|
@ -32,25 +29,37 @@ public class ThSynchFolderConfiguration implements Serializable{
|
||||||
|
|
||||||
private String rootFolderId;
|
private String rootFolderId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Instantiates a new th synch folder configuration.
|
||||||
|
*/
|
||||||
public ThSynchFolderConfiguration() {
|
public ThSynchFolderConfiguration() {
|
||||||
// TODO Auto-generated constructor stub
|
// TODO Auto-generated constructor stub
|
||||||
}
|
}
|
||||||
|
|
||||||
public ThSynchFolderConfiguration(String remotePath, String filter, String targetToken, String toCreateCatalogName,
|
/**
|
||||||
String remotePersistence, String rootFolderId) {
|
* Instantiates a new th synch folder configuration.
|
||||||
|
*
|
||||||
|
* @param remotePath the remote path
|
||||||
|
* @param filter the filter
|
||||||
|
* @param targetContext the target context
|
||||||
|
* @param toCreateCatalogName the to create catalog name
|
||||||
|
* @param remotePersistence the remote persistence
|
||||||
|
* @param rootFolderId the root folder id
|
||||||
|
*/
|
||||||
|
public ThSynchFolderConfiguration(String remotePath, String filter, String targetContext,
|
||||||
|
String toCreateCatalogName, String remotePersistence, String rootFolderId) {
|
||||||
super();
|
super();
|
||||||
this.remotePath = remotePath;
|
this.remotePath = remotePath;
|
||||||
this.filter = filter;
|
this.filter = filter;
|
||||||
this.targetToken = targetToken;
|
this.targetContext = targetContext;
|
||||||
this.toCreateCatalogName = toCreateCatalogName;
|
this.toCreateCatalogName = toCreateCatalogName;
|
||||||
this.remotePersistence = remotePersistence;
|
this.remotePersistence = remotePersistence;
|
||||||
this.rootFolderId = rootFolderId;
|
this.rootFolderId = rootFolderId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Gets the root folder id.
|
||||||
|
*
|
||||||
* @return the rootFolderId
|
* @return the rootFolderId
|
||||||
*/
|
*/
|
||||||
public String getRootFolderId() {
|
public String getRootFolderId() {
|
||||||
|
@ -58,8 +67,9 @@ public class ThSynchFolderConfiguration implements Serializable{
|
||||||
return rootFolderId;
|
return rootFolderId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Sets the root folder id.
|
||||||
|
*
|
||||||
* @param rootFolderId the rootFolderId to set
|
* @param rootFolderId the rootFolderId to set
|
||||||
*/
|
*/
|
||||||
public void setRootFolderId(String rootFolderId) {
|
public void setRootFolderId(String rootFolderId) {
|
||||||
|
@ -67,87 +77,105 @@ public class ThSynchFolderConfiguration implements Serializable{
|
||||||
this.rootFolderId = rootFolderId;
|
this.rootFolderId = rootFolderId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the remote path.
|
||||||
|
*
|
||||||
|
* @return the remote path
|
||||||
|
*/
|
||||||
public String getRemotePath() {
|
public String getRemotePath() {
|
||||||
return remotePath;
|
return remotePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the remote path.
|
||||||
|
*
|
||||||
|
* @param remotePath the new remote path
|
||||||
|
*/
|
||||||
public void setRemotePath(String remotePath) {
|
public void setRemotePath(String remotePath) {
|
||||||
this.remotePath = remotePath;
|
this.remotePath = remotePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the filter.
|
||||||
|
*
|
||||||
|
* @return the filter
|
||||||
|
*/
|
||||||
public String getFilter() {
|
public String getFilter() {
|
||||||
return filter;
|
return filter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the filter.
|
||||||
|
*
|
||||||
|
* @param filter the new filter
|
||||||
|
*/
|
||||||
public void setFilter(String filter) {
|
public void setFilter(String filter) {
|
||||||
this.filter = filter;
|
this.filter = filter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the target context.
|
||||||
|
*
|
||||||
public String getTargetToken() {
|
* @return the target context
|
||||||
return targetToken;
|
*/
|
||||||
|
public String getTargetContext() {
|
||||||
|
return targetContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the target context.
|
||||||
|
*
|
||||||
public void setTargetToken(String targetToken) {
|
* @param targetContext the new target context
|
||||||
this.targetToken = targetToken;
|
*/
|
||||||
|
public void setTargetContext(String targetContext) {
|
||||||
|
this.targetContext = targetContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the to create catalog name.
|
||||||
|
*
|
||||||
|
* @return the to create catalog name
|
||||||
|
*/
|
||||||
public String getToCreateCatalogName() {
|
public String getToCreateCatalogName() {
|
||||||
return toCreateCatalogName;
|
return toCreateCatalogName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the to create catalog name.
|
||||||
|
*
|
||||||
|
* @param toCreateCatalogName the new to create catalog name
|
||||||
|
*/
|
||||||
public void setToCreateCatalogName(String toCreateCatalogName) {
|
public void setToCreateCatalogName(String toCreateCatalogName) {
|
||||||
this.toCreateCatalogName = toCreateCatalogName;
|
this.toCreateCatalogName = toCreateCatalogName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the remote persistence.
|
||||||
|
*
|
||||||
|
* @return the remote persistence
|
||||||
|
*/
|
||||||
public String getRemotePersistence() {
|
public String getRemotePersistence() {
|
||||||
return remotePersistence;
|
return remotePersistence;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the remote persistence.
|
||||||
|
*
|
||||||
|
* @param remotePersistence the new remote persistence
|
||||||
|
*/
|
||||||
public void setRemotePersistence(String remotePersistence) {
|
public void setRemotePersistence(String remotePersistence) {
|
||||||
this.remotePersistence = remotePersistence;
|
this.remotePersistence = remotePersistence;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see java.lang.Object#toString()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
|
||||||
StringBuilder builder = new StringBuilder();
|
StringBuilder builder = new StringBuilder();
|
||||||
builder.append("ThSynchFolderConfiguration [remotePath=");
|
builder.append("ThSynchFolderConfiguration [remotePath=");
|
||||||
builder.append(remotePath);
|
builder.append(remotePath);
|
||||||
builder.append(", filter=");
|
builder.append(", filter=");
|
||||||
builder.append(filter);
|
builder.append(filter);
|
||||||
builder.append(", targetToken=");
|
builder.append(", targetContext=");
|
||||||
builder.append(targetToken);
|
builder.append(targetContext);
|
||||||
builder.append(", toCreateCatalogName=");
|
builder.append(", toCreateCatalogName=");
|
||||||
builder.append(toCreateCatalogName);
|
builder.append(toCreateCatalogName);
|
||||||
builder.append(", remotePersistence=");
|
builder.append(", remotePersistence=");
|
||||||
|
@ -159,4 +187,6 @@ public class ThSynchFolderConfiguration implements Serializable{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,15 +16,10 @@ import org.gcube.usecases.ws.thredds.model.gui.CatalogBean;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// TODO: Auto-generated Javadoc
|
|
||||||
/**
|
/**
|
||||||
* The Class ThreddsConverter.
|
* The Class ThreddsConverter.
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it Feb 14, 2018
|
||||||
* Feb 14, 2018
|
|
||||||
*/
|
*/
|
||||||
public class ThreddsConverter {
|
public class ThreddsConverter {
|
||||||
|
|
||||||
|
@ -38,7 +33,8 @@ public class ThreddsConverter {
|
||||||
public ThSyncFolderDescriptor apply(SyncFolderDescriptor t) {
|
public ThSyncFolderDescriptor apply(SyncFolderDescriptor t) {
|
||||||
ThSyncFolderDescriptor mySync = new ThSyncFolderDescriptor();
|
ThSyncFolderDescriptor mySync = new ThSyncFolderDescriptor();
|
||||||
if (t == null) {
|
if (t == null) {
|
||||||
logger.info("Input "+SyncFolderDescriptor.class.getSimpleName()+" is null, returning empty "+ThSyncFolderDescriptor.class.getSimpleName());
|
logger.info("Input " + SyncFolderDescriptor.class.getSimpleName() + " is null, returning empty "
|
||||||
|
+ ThSyncFolderDescriptor.class.getSimpleName());
|
||||||
return mySync;
|
return mySync;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,39 +75,41 @@ public class ThreddsConverter {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
String filter = t.getFilter()!=null && !t.getFilter().isEmpty()?t.getFilter():THREDDS_FILTER_NC_NCML_ASC;
|
String filter = t.getFilter() != null && !t.getFilter().isEmpty() ? t.getFilter()
|
||||||
return new SynchFolderConfiguration(t.getRemotePath(), filter, t.getTargetToken(), t.getToCreateCatalogName(), t.getRootFolderId());
|
: THREDDS_FILTER_NC_NCML_ASC;
|
||||||
|
return new SynchFolderConfiguration(t.getRemotePath(), filter, t.getTargetContext(),
|
||||||
|
t.getToCreateCatalogName(), t.getRootFolderId());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/** The to S synch folder configuration. */
|
/** The to S synch folder configuration. */
|
||||||
public static Function<SynchFolderConfiguration, ThSynchFolderConfiguration> toThSynchFolderConfiguration = new Function<SynchFolderConfiguration, ThSynchFolderConfiguration>() {
|
public static Function<SynchFolderConfiguration, ThSynchFolderConfiguration> toThSynchFolderConfiguration = new Function<SynchFolderConfiguration, ThSynchFolderConfiguration>() {
|
||||||
|
|
||||||
public ThSynchFolderConfiguration apply(SynchFolderConfiguration t) {
|
public ThSynchFolderConfiguration apply(SynchFolderConfiguration t) {
|
||||||
ThSynchFolderConfiguration mySync = new ThSynchFolderConfiguration();
|
ThSynchFolderConfiguration mySync = new ThSynchFolderConfiguration();
|
||||||
if (t == null) {
|
if (t == null) {
|
||||||
logger.info("Input "+SynchFolderConfiguration.class.getSimpleName()+" is null, returning empty "+ThSynchFolderConfiguration.class.getSimpleName());
|
logger.info("Input " + SynchFolderConfiguration.class.getSimpleName() + " is null, returning empty "
|
||||||
|
+ ThSynchFolderConfiguration.class.getSimpleName());
|
||||||
return mySync;
|
return mySync;
|
||||||
}
|
}
|
||||||
mySync.setFilter(t.getFilter());
|
mySync.setFilter(t.getFilter());
|
||||||
mySync.setRemotePath(t.getRemotePath());
|
mySync.setRemotePath(t.getRemotePath());
|
||||||
mySync.setRemotePersistence(t.getRemotePersistence());
|
mySync.setRemotePersistence(t.getRemotePersistence());
|
||||||
mySync.setTargetToken(t.getTargetToken());
|
mySync.setTargetContext(t.getTargetContext());
|
||||||
mySync.setToCreateCatalogName(t.getToCreateCatalogName());
|
mySync.setToCreateCatalogName(t.getToCreateCatalogName());
|
||||||
mySync.setRootFolderId(t.getRootFolderId());
|
mySync.setRootFolderId(t.getRootFolderId());
|
||||||
return mySync;
|
return mySync;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/** The to S sync folder descriptor. */
|
/** The to S sync folder descriptor. */
|
||||||
public static Function<ProcessDescriptor, ThProcessDescriptor> toThProcessDescriptor = new Function<ProcessDescriptor, ThProcessDescriptor>() {
|
public static Function<ProcessDescriptor, ThProcessDescriptor> toThProcessDescriptor = new Function<ProcessDescriptor, ThProcessDescriptor>() {
|
||||||
|
|
||||||
public ThProcessDescriptor apply(ProcessDescriptor t) {
|
public ThProcessDescriptor apply(ProcessDescriptor t) {
|
||||||
ThProcessDescriptor mySync = new ThProcessDescriptor();
|
ThProcessDescriptor mySync = new ThProcessDescriptor();
|
||||||
if (t == null) {
|
if (t == null) {
|
||||||
logger.info("Input "+ProcessDescriptor.class.getSimpleName()+" is null, returning empty "+ThProcessDescriptor.class.getSimpleName());
|
logger.info("Input " + ProcessDescriptor.class.getSimpleName() + " is null, returning empty "
|
||||||
|
+ ThProcessDescriptor.class.getSimpleName());
|
||||||
return mySync;
|
return mySync;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -124,7 +122,6 @@ public class ThreddsConverter {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/** The to th catalogue bean. */
|
/** The to th catalogue bean. */
|
||||||
public static Function<CatalogBean, ThCatalogueBean> toThCatalogueBean = new Function<CatalogBean, ThCatalogueBean>() {
|
public static Function<CatalogBean, ThCatalogueBean> toThCatalogueBean = new Function<CatalogBean, ThCatalogueBean>() {
|
||||||
|
|
||||||
|
@ -138,14 +135,14 @@ public class ThreddsConverter {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/** The to th process status. */
|
/** The to th process status. */
|
||||||
public static Function<ProcessStatus, ThProcessStatus> toThProcessStatus = new Function<ProcessStatus, ThProcessStatus>() {
|
public static Function<ProcessStatus, ThProcessStatus> toThProcessStatus = new Function<ProcessStatus, ThProcessStatus>() {
|
||||||
|
|
||||||
public ThProcessStatus apply(ProcessStatus t) {
|
public ThProcessStatus apply(ProcessStatus t) {
|
||||||
ThProcessStatus mySync = new ThProcessStatus();
|
ThProcessStatus mySync = new ThProcessStatus();
|
||||||
if (t == null) {
|
if (t == null) {
|
||||||
logger.info("Input "+ProcessStatus.class.getSimpleName()+" is null, returning empty "+ThProcessStatus.class.getSimpleName());
|
logger.info("Input " + ProcessStatus.class.getSimpleName() + " is null, returning empty "
|
||||||
|
+ ThProcessStatus.class.getSimpleName());
|
||||||
return mySync;
|
return mySync;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -189,6 +186,4 @@ public class ThreddsConverter {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,15 +34,13 @@ import org.gcube.usecases.ws.thredds.model.gui.CatalogBean;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
|
||||||
// TODO: Auto-generated Javadoc
|
|
||||||
/**
|
/**
|
||||||
* The Class WorkspaceThreddsSynchronize.
|
* The Class WorkspaceThreddsSynchronize.
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it Feb 14, 2018
|
||||||
* Feb 14, 2018
|
|
||||||
*/
|
*/
|
||||||
public class WorkspaceThreddsSynchronize implements WorkspaceThreddsSynchronizedRepository<ThSyncStatus, ThSyncFolderDescriptor>{
|
public class WorkspaceThreddsSynchronize
|
||||||
|
implements WorkspaceThreddsSynchronizedRepository<ThSyncStatus, ThSyncFolderDescriptor> {
|
||||||
|
|
||||||
/** The logger. */
|
/** The logger. */
|
||||||
private static Logger logger = LoggerFactory.getLogger(WorkspaceThreddsSynchronize.class);
|
private static Logger logger = LoggerFactory.getLogger(WorkspaceThreddsSynchronize.class);
|
||||||
|
@ -69,7 +67,6 @@ public class WorkspaceThreddsSynchronize implements WorkspaceThreddsSynchronized
|
||||||
engine = SyncEngine.get();
|
engine = SyncEngine.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the single instance of WorkspaceThreddsSynchronize.
|
* Gets the single instance of WorkspaceThreddsSynchronize.
|
||||||
*
|
*
|
||||||
|
@ -97,10 +94,11 @@ public class WorkspaceThreddsSynchronize implements WorkspaceThreddsSynchronized
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
/* (non-Javadoc)
|
*
|
||||||
* @see org.gcube.portal.wssynclibrary.WorkspaceSynchronizedRepository#isItemSynchronized(java.lang.String)
|
* @see org.gcube.portal.wssynclibrary.WorkspaceSynchronizedRepository#
|
||||||
|
* isItemSynchronized(java.lang.String)
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* Check item synched.
|
* Check item synched.
|
||||||
|
@ -112,7 +110,8 @@ public class WorkspaceThreddsSynchronize implements WorkspaceThreddsSynchronized
|
||||||
* @throws Exception the exception
|
* @throws Exception the exception
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public ThSyncFolderDescriptor checkItemSynched(String itemId) throws ItemNotSynched, WorkspaceFolderLocked, Exception {
|
public ThSyncFolderDescriptor checkItemSynched(String itemId)
|
||||||
|
throws ItemNotSynched, WorkspaceFolderLocked, Exception {
|
||||||
logger.debug("Perfoming checkItemSynched for id: " + itemId);
|
logger.debug("Perfoming checkItemSynched for id: " + itemId);
|
||||||
try {
|
try {
|
||||||
// WHEN OPENING A FOLDER, INVOKE CHECK TO UPDATE SYNCH STATUS
|
// WHEN OPENING A FOLDER, INVOKE CHECK TO UPDATE SYNCH STATUS
|
||||||
|
@ -131,21 +130,25 @@ public class WorkspaceThreddsSynchronize implements WorkspaceThreddsSynchronized
|
||||||
// engine.setSynchronizedFolder(config, folder.getId());
|
// engine.setSynchronizedFolder(config, folder.getId());
|
||||||
} catch (WorkspaceLockedException e) {
|
} catch (WorkspaceLockedException e) {
|
||||||
// logger.warn("Workspace locked, going to force unlock..");
|
// logger.warn("Workspace locked, going to force unlock..");
|
||||||
throw new WorkspaceFolderLocked(itemId, "The folder id: "+itemId +" is currently locked. Another sync process is in progress");
|
throw new WorkspaceFolderLocked(itemId,
|
||||||
|
"The folder id: " + itemId + " is currently locked. Another sync process is in progress");
|
||||||
// engine.forceUnlock(itemId);
|
// engine.forceUnlock(itemId);
|
||||||
} catch (WorkspaceInteractionException | InternalException e) {
|
} catch (WorkspaceInteractionException | InternalException e) {
|
||||||
logger.error("Error: ", e);
|
logger.error("Error: ", e);
|
||||||
if (e instanceof WorkspaceInteractionException)
|
if (e instanceof WorkspaceInteractionException)
|
||||||
throw new Exception("Sorry, an error occurred during check syncronization due to WS interection for the itemId: "+itemId);
|
throw new Exception(
|
||||||
|
"Sorry, an error occurred during check syncronization due to WS interection for the itemId: "
|
||||||
|
+ itemId);
|
||||||
else if (e instanceof InternalException)
|
else if (e instanceof InternalException)
|
||||||
throw new Exception("Sorry, an Internal Exception occurred during check syncronization for the itemId: "+itemId);
|
throw new Exception(
|
||||||
|
"Sorry, an Internal Exception occurred during check syncronization for the itemId: " + itemId);
|
||||||
|
|
||||||
throw new Exception("Sorry, an error occurred server side during chck syncronization for the itemId: "+itemId);
|
throw new Exception(
|
||||||
|
"Sorry, an error occurred server side during chck syncronization for the itemId: " + itemId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the synchronized folder.
|
* Sets the synchronized folder.
|
||||||
*
|
*
|
||||||
|
@ -154,7 +157,8 @@ public class WorkspaceThreddsSynchronize implements WorkspaceThreddsSynchronized
|
||||||
* @return the th sync folder descriptor
|
* @return the th sync folder descriptor
|
||||||
* @throws Exception the exception
|
* @throws Exception the exception
|
||||||
*/
|
*/
|
||||||
public ThSyncFolderDescriptor setSynchronizedFolder(ThSynchFolderConfiguration thConfig, String itemId) throws Exception {
|
public ThSyncFolderDescriptor setSynchronizedFolder(ThSynchFolderConfiguration thConfig, String itemId)
|
||||||
|
throws Exception {
|
||||||
SynchFolderConfiguration config = ThreddsConverter.toSynchFolderConfiguration.apply(thConfig);
|
SynchFolderConfiguration config = ThreddsConverter.toSynchFolderConfiguration.apply(thConfig);
|
||||||
|
|
||||||
if (thConfig.getRemotePath() == null || thConfig.getRemotePath().isEmpty())
|
if (thConfig.getRemotePath() == null || thConfig.getRemotePath().isEmpty())
|
||||||
|
@ -163,9 +167,6 @@ public class WorkspaceThreddsSynchronize implements WorkspaceThreddsSynchronized
|
||||||
if (thConfig.getToCreateCatalogName() == null || thConfig.getToCreateCatalogName().isEmpty())
|
if (thConfig.getToCreateCatalogName() == null || thConfig.getToCreateCatalogName().isEmpty())
|
||||||
throw new Exception("A valid Catalogue Name must be provided");
|
throw new Exception("A valid Catalogue Name must be provided");
|
||||||
|
|
||||||
if(thConfig.getTargetToken()==null || thConfig.getTargetToken().isEmpty())
|
|
||||||
throw new Exception("A valid Target Token must be provided");
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
engine.setSynchronizedFolder(config, itemId);
|
engine.setSynchronizedFolder(config, itemId);
|
||||||
} catch (WorkspaceInteractionException | InternalException e) {
|
} catch (WorkspaceInteractionException | InternalException e) {
|
||||||
|
@ -176,10 +177,11 @@ public class WorkspaceThreddsSynchronize implements WorkspaceThreddsSynchronized
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
/* (non-Javadoc)
|
*
|
||||||
* @see org.gcube.portal.wssynclibrary.WorkspaceSynchronizedRepository#doSynchronization(java.lang.String)
|
* @see org.gcube.portal.wssynclibrary.WorkspaceSynchronizedRepository#
|
||||||
|
* doSynchronization(java.lang.String)
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* Do sync.
|
* Do sync.
|
||||||
|
@ -211,18 +213,24 @@ public class WorkspaceThreddsSynchronize implements WorkspaceThreddsSynchronized
|
||||||
logger.error("Error: ", e);
|
logger.error("Error: ", e);
|
||||||
|
|
||||||
if (e instanceof WorkspaceInteractionException)
|
if (e instanceof WorkspaceInteractionException)
|
||||||
throw new Exception("Sorry, an error occurred during syncronization due to WS interection for the itemId: "+itemId);
|
throw new Exception(
|
||||||
|
"Sorry, an error occurred during syncronization due to WS interection for the itemId: "
|
||||||
|
+ itemId);
|
||||||
else if (e instanceof InternalException)
|
else if (e instanceof InternalException)
|
||||||
throw new Exception("Sorry, an Internal Exception occurred during syncronization for the itemId: "+itemId);
|
throw new Exception(
|
||||||
|
"Sorry, an Internal Exception occurred during syncronization for the itemId: " + itemId);
|
||||||
|
|
||||||
throw new Exception("Sorry, an error occurred server side during syncronization for the itemId: "+itemId);
|
throw new Exception(
|
||||||
|
"Sorry, an error occurred server side during syncronization for the itemId: " + itemId);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
/* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
* @see org.gcube.portal.wssynclibrary.DoSyncItem#getSyncStatus(java.lang.String)
|
*
|
||||||
|
* @see
|
||||||
|
* org.gcube.portal.wssynclibrary.DoSyncItem#getSyncStatus(java.lang.String)
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* Monitor sync status.
|
* Monitor sync status.
|
||||||
|
@ -253,7 +261,8 @@ public class WorkspaceThreddsSynchronize implements WorkspaceThreddsSynchronized
|
||||||
return thSyncStatus;
|
return thSyncStatus;
|
||||||
|
|
||||||
} catch (ProcessNotFoundException e) {
|
} catch (ProcessNotFoundException e) {
|
||||||
throw new Exception("Monitor is not available here. The sync process is in progress on another machine");
|
throw new Exception(
|
||||||
|
"Monitor is not available here. The sync process is in progress on another machine");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -274,57 +283,67 @@ public class WorkspaceThreddsSynchronize implements WorkspaceThreddsSynchronized
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
/* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
* @see org.gcube.portal.wssynclibrary.WorkspaceSynchronizedRepository#removeSync(java.lang.String)
|
*
|
||||||
|
* @see
|
||||||
|
* org.gcube.portal.wssynclibrary.WorkspaceSynchronizedRepository#removeSync(
|
||||||
|
* java.lang.String)
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* Removes the sync.
|
* Removes the sync.
|
||||||
*
|
*
|
||||||
* @param itemId the item id
|
* @param itemId the item id
|
||||||
* @return the boolean
|
* @return the boolean
|
||||||
|
* @throws Exception the exception
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Boolean removeSync(String itemId) {
|
public Boolean removeSync(String itemId) throws Exception {
|
||||||
return null;
|
throw new Exception("removeSync not implemented");
|
||||||
// TODO Auto-generated method stub
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
/* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
* @see org.gcube.portal.wssynclibrary.WorkspaceSynchronizedRepository#stopSync(java.lang.String)
|
*
|
||||||
|
* @see
|
||||||
|
* org.gcube.portal.wssynclibrary.WorkspaceSynchronizedRepository#stopSync(java.
|
||||||
|
* lang.String)
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* Stop sync.
|
* Stop sync.
|
||||||
*
|
*
|
||||||
* @param itemId the item id
|
* @param itemId the item id
|
||||||
* @return the boolean
|
* @return the boolean
|
||||||
|
* @throws Exception the exception
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Boolean stopSync(String itemId) {
|
public Boolean stopSync(String itemId) throws Exception {
|
||||||
return false;
|
throw new Exception("stopSync not implemented");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
/* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
* @see org.gcube.portal.wssynclibrary.WorkspaceSynchronizedRepository#initRepository()
|
*
|
||||||
|
* @see
|
||||||
|
* org.gcube.portal.wssynclibrary.WorkspaceSynchronizedRepository#initRepository
|
||||||
|
* ()
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* Inits the repository.
|
* Inits the repository.
|
||||||
*
|
*
|
||||||
* @return the boolean
|
* @return the boolean
|
||||||
|
* @throws Exception the exception
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Boolean initRepository() {
|
public Boolean initRepository() throws Exception {
|
||||||
return false;
|
throw new Exception("initRepository not implemented");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
/* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
* @see org.gcube.portal.wssynclibrary.WorkspaceSynchronizedRepository#shutDownRepository()
|
*
|
||||||
|
* @see org.gcube.portal.wssynclibrary.WorkspaceSynchronizedRepository#
|
||||||
|
* shutDownRepository()
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* Shut down repository.
|
* Shut down repository.
|
||||||
|
@ -342,9 +361,12 @@ public class WorkspaceThreddsSynchronize implements WorkspaceThreddsSynchronized
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
/* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
* @see org.gcube.portal.wssynclibrary.thredds.WorkspaceThreddsSynchronizedRepository#decribeSyncRepository()
|
*
|
||||||
|
* @see
|
||||||
|
* org.gcube.portal.wssynclibrary.thredds.WorkspaceThreddsSynchronizedRepository
|
||||||
|
* #decribeSyncRepository()
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* Decribe sync repository.
|
* Decribe sync repository.
|
||||||
|
@ -356,7 +378,6 @@ public class WorkspaceThreddsSynchronize implements WorkspaceThreddsSynchronized
|
||||||
return "Sync repository for Thredds";
|
return "Sync repository for Thredds";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the synched status from item property.
|
* Gets the synched status from item property.
|
||||||
*
|
*
|
||||||
|
@ -366,7 +387,8 @@ public class WorkspaceThreddsSynchronize implements WorkspaceThreddsSynchronized
|
||||||
* @throws ItemNotSynched the item not synched
|
* @throws ItemNotSynched the item not synched
|
||||||
* @throws Exception the exception
|
* @throws Exception the exception
|
||||||
*/
|
*/
|
||||||
public Sync_Status getSynchedStatusFromItemProperty(String itemId, String username) throws ItemNotSynched, Exception{
|
public Sync_Status getSynchedStatusFromItemProperty(String itemId, String username)
|
||||||
|
throws ItemNotSynched, Exception {
|
||||||
|
|
||||||
if (itemId == null)
|
if (itemId == null)
|
||||||
throw new Exception("Invalid parameter itemId is null");
|
throw new Exception("Invalid parameter itemId is null");
|
||||||
|
@ -380,7 +402,8 @@ public class WorkspaceThreddsSynchronize implements WorkspaceThreddsSynchronized
|
||||||
|
|
||||||
Map<String, Object> map = storageHubInstance.open(itemId).asItem().get().getMetadata().getMap();
|
Map<String, Object> map = storageHubInstance.open(itemId).asItem().get().getMetadata().getMap();
|
||||||
wsSyncStatus = (String) map.get(WS_SYNCH_SYNCH_STATUS);
|
wsSyncStatus = (String) map.get(WS_SYNCH_SYNCH_STATUS);
|
||||||
logger.debug("Item id: "+itemId+" read from Shub has current: "+WS_SYNCH_SYNCH_STATUS +" value at: "+wsSyncStatus);
|
logger.debug("Item id: " + itemId + " read from Shub has current: " + WS_SYNCH_SYNCH_STATUS + " value at: "
|
||||||
|
+ wsSyncStatus);
|
||||||
if (wsSyncStatus == null)
|
if (wsSyncStatus == null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
@ -391,7 +414,6 @@ public class WorkspaceThreddsSynchronize implements WorkspaceThreddsSynchronized
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register callback for id.
|
* Register callback for id.
|
||||||
*
|
*
|
||||||
|
@ -429,7 +451,6 @@ public class WorkspaceThreddsSynchronize implements WorkspaceThreddsSynchronized
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update map callback.
|
* Update map callback.
|
||||||
*
|
*
|
||||||
|
@ -444,44 +465,37 @@ public class WorkspaceThreddsSynchronize implements WorkspaceThreddsSynchronized
|
||||||
logger.debug("Update map for " + itemId + " with new " + thStatus);
|
logger.debug("Update map for " + itemId + " with new " + thStatus);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the available catalogues by token.
|
* Gets the available catalogues. you need to set the context caller.
|
||||||
*
|
*
|
||||||
* @param token the token
|
* @return the available catalogues
|
||||||
* @return the available catalogues by token
|
|
||||||
* @throws Exception the exception
|
* @throws Exception the exception
|
||||||
*/
|
*/
|
||||||
public List<ThCatalogueBean> getAvailableCataloguesByToken(String token) throws Exception{
|
public List<ThCatalogueBean> getAvailableCatalogues() throws Exception {
|
||||||
|
logger.debug("called Get Available Catalogues");
|
||||||
if(token==null || token.isEmpty())
|
Set<CatalogBean> ctlgs = engine.getAvailableCatalogs();
|
||||||
throw new Exception("Invalid parameter token null or empty");
|
|
||||||
|
|
||||||
String printToken = token.substring(0, token.length()-5)+"XXXXX";
|
|
||||||
logger.debug("Get Available Catalogues by token: "+printToken);
|
|
||||||
Set<CatalogBean> ctlgs = engine.getAvailableCatalogsByToken(token);
|
|
||||||
|
|
||||||
if (ctlgs == null || ctlgs.size() == 0) {
|
if (ctlgs == null || ctlgs.size() == 0) {
|
||||||
logger.debug("No Catalogue available for token: "+printToken +" returning empty list");
|
logger.info("No Catalogue available in the current context, returning empty list");
|
||||||
return new ArrayList<ThCatalogueBean>(1);
|
return new ArrayList<ThCatalogueBean>(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
List<ThCatalogueBean> listCtlgs = new ArrayList<ThCatalogueBean>(ctlgs.size());
|
List<ThCatalogueBean> listCtlgs = new ArrayList<ThCatalogueBean>(ctlgs.size());
|
||||||
for (CatalogBean bean : ctlgs) {
|
for (CatalogBean bean : ctlgs) {
|
||||||
System.out.println(bean.getName()+" in "+bean.getPath()+" Default : "+bean.getIsDefault());
|
logger.debug(bean.getName() + " in " + bean.getPath() + " Default : " + bean.getIsDefault());
|
||||||
ThCatalogueBean toBean = ThreddsConverter.toThCatalogueBean.apply(bean);
|
ThCatalogueBean toBean = ThreddsConverter.toThCatalogueBean.apply(bean);
|
||||||
if (toBean != null)
|
if (toBean != null)
|
||||||
listCtlgs.add(toBean);
|
listCtlgs.add(toBean);
|
||||||
}
|
}
|
||||||
|
|
||||||
Collections.sort(listCtlgs);
|
Collections.sort(listCtlgs);
|
||||||
logger.debug("Returning sorted Catalogue list with: "+listCtlgs.size() +" item/s");
|
logger.info("Returning sorted Catalogue list with: " + listCtlgs.size() + " item/s");
|
||||||
return listCtlgs;
|
return listCtlgs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
/* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.gcube.portal.wssynclibrary.DoSyncItem#doUnSync(java.lang.String)
|
* @see org.gcube.portal.wssynclibrary.DoSyncItem#doUnSync(java.lang.String)
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -4,8 +4,6 @@ import org.gcube.portal.wssynclibrary.DoCheckSyncItem;
|
||||||
import org.gcube.portal.wssynclibrary.DoConnectRepository;
|
import org.gcube.portal.wssynclibrary.DoConnectRepository;
|
||||||
import org.gcube.portal.wssynclibrary.DoSyncItem;
|
import org.gcube.portal.wssynclibrary.DoSyncItem;
|
||||||
|
|
||||||
|
|
||||||
// TODO: Auto-generated Javadoc
|
|
||||||
/**
|
/**
|
||||||
* The Interface WorkspaceThreddsSynchronizedRepository.
|
* The Interface WorkspaceThreddsSynchronizedRepository.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue