diff --git a/CHANGELOG.md b/CHANGELOG.md index 430b186..d7ba5dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,9 @@ # Changelog -## [v1.76.0] - 2020-11-20 +## [v1.7.0-SNAPSHOT] - 2020-11-20 -- Config path passed as parameter +- import range modified to resolve old repositories invalid url ## [v1.6.0] - 2020-05-12 diff --git a/pom.xml b/pom.xml index 3bb1d57..c341087 100644 --- a/pom.xml +++ b/pom.xml @@ -101,12 +101,12 @@ org.gcube.dataanalysis ecological-engine-wps-extension - [1.0.4,2.0.0-SNAPSHOT) + [1.0.5,2.0.0-SNAPSHOT) org.gcube.dataanalysis ecological-engine-geospatial-extensions - [1.5.0,2.0.0-SNAPSHOT) + [1.5.2,2.0.0-SNAPSHOT) log4j @@ -117,12 +117,12 @@ org.gcube.dataanalysis ecological-engine-external-algorithms - [1.2.0,2.0.0-SNAPSHOT) + [1.2.1,2.0.0-SNAPSHOT) org.gcube.dataanalysis ecological-engine-smart-executor - [1.6.2,2.0.0-SNAPSHOT) + [1.6.4,2.0.0-SNAPSHOT) org.glassfish.jersey.core 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 0cd815a..d3d0023 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 @@ -14,7 +14,7 @@ import org.slf4j.LoggerFactory; public class ConfigurationManager { private static final Logger logger = LoggerFactory.getLogger(ConfigurationManager.class); - + public static String serviceUserNameParameterVariable = "ServiceUserName"; public static String processingSessionVariable = "Session"; public static String webpathVariable = "WebPath"; @@ -24,30 +24,29 @@ public class ConfigurationManager { public static String tokenParameter = "usertoken"; public static String defaultScope= "/gcube/devsec"; public static String defaultUsername= "statistical.wps"; - + private static Integer maxComputations = null; private static Boolean useStorage = null; static boolean simulationMode = false; - private String baseConfigPath; - - + + EnvironmentVariableManager env = null; - + public static synchronized Integer getMaxComputations(){ return maxComputations; } - + public static synchronized Boolean useStorage(){ return useStorage; } - + public static synchronized Boolean isSimulationMode(){ return simulationMode; } - + @Deprecated public void getInitializationProperties() { - + } private void inizializePropertiesUsingTemplateFile() { @@ -66,7 +65,7 @@ public class ConfigurationManager { logger.error("error initializing properties",e); } } - + private AlgorithmConfiguration config; private String scope; private String username; @@ -86,10 +85,9 @@ public class ConfigurationManager { maxComputations = env.getMaxComputation(); useStorage = env.isSaveOnStorage(); simulationMode = env.isSimulationMode(); - baseConfigPath = env.getConfigPath(); } } - + public AlgorithmConfiguration getConfig() { return config; } @@ -97,25 +95,21 @@ public class ConfigurationManager { public void setComputationId(String computationId){ config.setTaskID(computationId); } - + public void configAlgorithmEnvironment(LinkedHashMap inputs) throws Exception { // set config container config = new AlgorithmConfiguration(); config.setAlgorithmClassLoader(Thread.currentThread().getContextClassLoader()); String webperspath = WPSConfig.getConfigDir() + "../persistence/"; // selecting persistence path -// String persistencePath = File.createTempFile("wpsstatcheck", ".sm").getParent() + "/../cfg/"; - - //String webperspath = baseConfigPath + "/persistence/"; - - //String persistencePath = baseConfigPath; WPSConfig.getConfigDir() + "../ecocfg/"; - String configPath = baseConfigPath + "/ecocfg/"; //persistencePath; - /*if (!new File(configPath).isDirectory()) { + String persistencePath = WPSConfig.getConfigDir() + "../ecocfg/"; + String configPath = persistencePath; + if (!new File(configPath).isDirectory()) { configPath = "./cfg/"; persistencePath = "./"; - }*/ + } logger.debug("Taking configuration from {}", configPath); - //+ " and persistence in " + persistencePath); + //+ " and persistence in " + persistencePath); // setting configuration and logger config.setPersistencePath(configPath); config.setConfigPath(configPath); @@ -126,9 +120,9 @@ public class ConfigurationManager { String port = WPSConfig.getInstance().getWPSConfig().getServer().getHostport(); 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); @@ -142,13 +136,13 @@ 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); - + if (username == null || username.trim().length() == 0) throw new Exception("Error: user name parameter (user.name) not set! This violates e-Infrastructure security policies"); - + if (token == null || token.trim().length() == 0) throw new Exception("Error: token parameter not set! This violates e-Infrastructure security policies"); 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 34d1512..87b85e8 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,12 @@ import java.util.List; public class EnvironmentVariableManager { - public EnvironmentVariableManager(int maxComputation, boolean saveOnStorage, boolean simulationMode, List shubUsersExcluded, String configPath ) { + public EnvironmentVariableManager(int maxComputation, boolean saveOnStorage, boolean simulationMode, List shubUsersExcluded) { super(); this.maxComputation = maxComputation; this.saveOnStorage = saveOnStorage; this.simulationMode = simulationMode; this.shubUsersExcluded = shubUsersExcluded; - this.configPath = configPath; } private int maxComputation; @@ -22,8 +21,6 @@ public class EnvironmentVariableManager { //filled: users reported will not write on Shub private List shubUsersExcluded; - private String configPath; - public int getMaxComputation() { return maxComputation; } @@ -37,8 +34,5 @@ public class EnvironmentVariableManager { public List getShubUsersExcluded() { return shubUsersExcluded; } - - public String getConfigPath() { - return configPath; - } + }