diff --git a/.classpath b/.classpath
index 50e1776..d05bd53 100644
--- a/.classpath
+++ b/.classpath
@@ -21,11 +21,13 @@
+
+
diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs
index df46a9a..9de2ed6 100644
--- a/.settings/org.eclipse.jdt.core.prefs
+++ b/.settings/org.eclipse.jdt.core.prefs
@@ -7,6 +7,9 @@ org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
+org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
+org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.8
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1e114af..430b186 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,7 +1,11 @@
# Changelog
-## [v1.6.0] [r4.23.0] - 2020-05-12
+## [v1.76.0] - 2020-11-20
+
+- Config path passed as parameter
+
+## [v1.6.0] - 2020-05-12
### Fixes
diff --git a/pom.xml b/pom.xml
index 70b61d8..3bb1d57 100644
--- a/pom.xml
+++ b/pom.xml
@@ -9,7 +9,7 @@
org.gcube.dataanalysis
dataminer
- 1.6.0
+ 1.7.0-SNAPSHOT
dataminer
An e-Infrastructure service providing state-of-the art DataMining algorithms and ecological modelling approaches under the Web Processing Service (WPS) standard.
@@ -46,6 +46,23 @@
UTF-8
UTF-8
+
+
+
+
+
+ org.gcube.distribution
+ gcube-bom
+ 2.0.0
+ pom
+ import
+
+
+
+
+
@@ -162,7 +179,6 @@
org.gcube.accounting
accounting-lib
- [3.0.0,4.0.0-SNAPSHOT)
provided
@@ -174,31 +190,11 @@
org.apache.maven.plugins
maven-surefire-plugin
- 2.18.1
true
-
-
- org.apache.maven.plugins
- maven-assembly-plugin
-
-
- descriptor.xml
-
-
-
-
- servicearchive
- install
-
- single
-
-
-
-
diff --git a/src/main/java/org/gcube/dataanalysis/wps/statisticalmanager/synchserver/mapping/ConfigurationManager.java b/src/main/java/org/gcube/dataanalysis/wps/statisticalmanager/synchserver/mapping/ConfigurationManager.java
index 97dc538..0cd815a 100644
--- a/src/main/java/org/gcube/dataanalysis/wps/statisticalmanager/synchserver/mapping/ConfigurationManager.java
+++ b/src/main/java/org/gcube/dataanalysis/wps/statisticalmanager/synchserver/mapping/ConfigurationManager.java
@@ -28,6 +28,8 @@ public class ConfigurationManager {
private static Integer maxComputations = null;
private static Boolean useStorage = null;
static boolean simulationMode = false;
+ private String baseConfigPath;
+
EnvironmentVariableManager env = null;
@@ -84,6 +86,7 @@ public class ConfigurationManager {
maxComputations = env.getMaxComputation();
useStorage = env.isSaveOnStorage();
simulationMode = env.isSimulationMode();
+ baseConfigPath = env.getConfigPath();
}
}
@@ -103,33 +106,35 @@ public class ConfigurationManager {
// selecting persistence path
// String persistencePath = File.createTempFile("wpsstatcheck", ".sm").getParent() + "/../cfg/";
- //TODO: REMOVE this shit (the persistence must be the persistence dir of the webapp)
- String persistencePath = WPSConfig.getConfigDir() + "../ecocfg/";
- String configPath = persistencePath;
- if (!new File(configPath).isDirectory()) {
+ //String webperspath = baseConfigPath + "/persistence/";
+
+ //String persistencePath = baseConfigPath; WPSConfig.getConfigDir() + "../ecocfg/";
+ String configPath = baseConfigPath + "/ecocfg/"; //persistencePath;
+ /*if (!new File(configPath).isDirectory()) {
configPath = "./cfg/";
persistencePath = "./";
- }
- logger.debug("Taking configuration from " + (new File(configPath).getAbsolutePath()) + " and persistence in " + persistencePath);
+ }*/
+ logger.debug("Taking configuration from {}", configPath);
+ //+ " and persistence in " + persistencePath);
// setting configuration and logger
- config.setPersistencePath(persistencePath);
+ config.setPersistencePath(configPath);
config.setConfigPath(configPath);
config.setNumberOfResources(1);
// setting application paths
String webapp = WPSConfig.getInstance().getWPSConfig().getServer().getWebappPath();
String host = WPSConfig.getInstance().getWPSConfig().getServer().getHostname();
String port = WPSConfig.getInstance().getWPSConfig().getServer().getHostport();
- logger.debug("Host: " + host + " Port: " + port + " Webapp: " + webapp + " ");
- logger.debug("Web persistence path: " + webperspath);
+ logger.debug("Host: {} Port: {} Webapp: {} ", host, port, webapp );
+ logger.debug("Web persistence path:{} ", webperspath);
String webPath = "http://" + host + ":" + port + "/" + webapp + "/persistence/";
// logger.debug("Env Vars: \n"+System.getenv());
- logger.debug("Web app path: " + webPath);
+ logger.debug("Web app path: {} ", webPath);
// retrieving scope
scope = (String) inputs.get(scopeParameter);
- logger.debug("Retrieved scope: " + scope);
+ logger.debug("Retrieved scope: {} ", scope);
if (scope == null)
throw new Exception("Error: scope parameter (scope) not set! This violates e-Infrastructure security policies");
if (!scope.startsWith("/"))
@@ -138,8 +143,8 @@ public class ConfigurationManager {
username = (String) inputs.get(usernameParameter);
token = (String) inputs.get(tokenParameter);
- logger.debug("User name used by the client: " + username);
- logger.debug("User token used by the client: " + token);
+ logger.debug("User name used by the client:{} ", username);
+ logger.debug("User token used by the client:{} ", token);
if (username == null || username.trim().length() == 0)
throw new Exception("Error: user name parameter (user.name) not set! This violates e-Infrastructure security policies");
@@ -152,7 +157,7 @@ public class ConfigurationManager {
config.setGcubeToken(token);
// DONE get username from request
config.setParam(serviceUserNameParameterVariable, username);
- config.setParam(processingSessionVariable, "" + UUID.randomUUID());
+ config.setParam(processingSessionVariable, UUID.randomUUID().toString());
config.setParam(webpathVariable, webPath);
config.setParam(webPersistencePathVariable, webperspath);
diff --git a/src/main/java/org/gcube/dataanalysis/wps/statisticalmanager/synchserver/mapping/EnvironmentVariableManager.java b/src/main/java/org/gcube/dataanalysis/wps/statisticalmanager/synchserver/mapping/EnvironmentVariableManager.java
index 5470d08..34d1512 100644
--- a/src/main/java/org/gcube/dataanalysis/wps/statisticalmanager/synchserver/mapping/EnvironmentVariableManager.java
+++ b/src/main/java/org/gcube/dataanalysis/wps/statisticalmanager/synchserver/mapping/EnvironmentVariableManager.java
@@ -4,13 +4,15 @@ import java.util.List;
public class EnvironmentVariableManager {
- public EnvironmentVariableManager(int maxComputation, boolean saveOnStorage, boolean simulationMode, List shubUsersExcluded) {
+ public EnvironmentVariableManager(int maxComputation, boolean saveOnStorage, boolean simulationMode, List shubUsersExcluded, String configPath ) {
super();
this.maxComputation = maxComputation;
this.saveOnStorage = saveOnStorage;
this.simulationMode = simulationMode;
this.shubUsersExcluded = shubUsersExcluded;
+ this.configPath = configPath;
}
+
private int maxComputation;
private boolean saveOnStorage;
private boolean simulationMode;
@@ -20,6 +22,8 @@ public class EnvironmentVariableManager {
//filled: users reported will not write on Shub
private List shubUsersExcluded;
+ private String configPath;
+
public int getMaxComputation() {
return maxComputation;
}
@@ -34,5 +38,7 @@ public class EnvironmentVariableManager {
return shubUsersExcluded;
}
-
+ public String getConfigPath() {
+ return configPath;
+ }
}