diff --git a/CHANGELOG.md b/CHANGELOG.md index b2792dd..813c0a7 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm # Changelog for "dataminer" +## [v1.8.1-SNAPSHOT] - 2022-03-21 + +### Fixes + +- Fixed protocol parameter when persistence is disabled + ## [v1.8.0] - 2022-01-24 diff --git a/pom.xml b/pom.xml index b9d12f8..6ab09ef 100755 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ org.gcube.dataanalysis dataminer - 1.8.0 + 1.8.1-SNAPSHOT dataminer An e-Infrastructure service providing state-of-the art DataMining algorithms and ecological modelling approaches under the Web Processing Service (WPS) standard. @@ -55,7 +55,7 @@ org.gcube.distribution gcube-bom - 2.0.2 + 2.1.0-SNAPSHOT pom import 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 d3d0023..c3b5a60 100755 --- 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 @@ -22,25 +22,24 @@ public class ConfigurationManager { public static String usernameParameter = "user.name"; public static String scopeParameter = "scope"; public static String tokenParameter = "usertoken"; - public static String defaultScope= "/gcube/devsec"; - public static String defaultUsername= "statistical.wps"; + 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; - EnvironmentVariableManager env = null; - public static synchronized Integer getMaxComputations(){ + public static synchronized Integer getMaxComputations() { return maxComputations; } - public static synchronized Boolean useStorage(){ + public static synchronized Boolean useStorage() { return useStorage; } - public static synchronized Boolean isSimulationMode(){ + public static synchronized Boolean isSimulationMode() { return simulationMode; } @@ -57,12 +56,12 @@ public class ConfigurationManager { options.load(is); is.close(); maxComputations = Integer.parseInt(options.getProperty("maxcomputations")); - logger.info("setting max computation to {}",maxComputations); + logger.info("setting max computation to {}", maxComputations); useStorage = Boolean.parseBoolean(options.getProperty("saveond4sstorage")); - simulationMode=Boolean.parseBoolean(options.getProperty("simulationMode")); + simulationMode = Boolean.parseBoolean(options.getProperty("simulationMode")); } } catch (Exception e) { - logger.error("error initializing properties",e); + logger.error("error initializing properties", e); } } @@ -80,7 +79,8 @@ public class ConfigurationManager { } public ConfigurationManager(EnvironmentVariableManager env) { - if (env == null) inizializePropertiesUsingTemplateFile(); + if (env == null) + inizializePropertiesUsingTemplateFile(); else { maxComputations = env.getMaxComputation(); useStorage = env.isSaveOnStorage(); @@ -92,7 +92,7 @@ public class ConfigurationManager { return config; } - public void setComputationId(String computationId){ + public void setComputationId(String computationId) { config.setTaskID(computationId); } @@ -108,29 +108,31 @@ public class ConfigurationManager { configPath = "./cfg/"; persistencePath = "./"; } - logger.debug("Taking configuration from {}", configPath); - //+ " and persistence in " + persistencePath); + logger.debug("Taking configuration from {}", configPath); + // + " and persistence in " + persistencePath); // setting configuration and logger config.setPersistencePath(configPath); config.setConfigPath(configPath); config.setNumberOfResources(1); // setting application paths + String protocol = WPSConfig.getInstance().getWPSConfig().getServer().getProtocol(); String webapp = WPSConfig.getInstance().getWPSConfig().getServer().getWebappPath(); String host = WPSConfig.getInstance().getWPSConfig().getServer().getHostname(); String port = WPSConfig.getInstance().getWPSConfig().getServer().getHostport(); - logger.debug("Host: {} Port: {} Webapp: {} ", host, port, webapp ); - logger.debug("Web persistence path:{} ", webperspath); + logger.debug("Protocol: {} , Host: {} , Port: {} , Webapp: {} ", protocol, host, port, webapp); + logger.info("Web Path Persistence: {}", webperspath); - String webPath = "http://" + host + ":" + port + "/" + webapp + "/persistence/"; + String webPath = protocol + "://" + host + ":" + port + "/" + webapp + "/persistence/"; // logger.debug("Env Vars: \n"+System.getenv()); - logger.debug("Web app path: {} ", webPath); + logger.info("Web Path Persistence Url: {}", 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"); + throw new Exception( + "Error: scope parameter (scope) not set! This violates e-Infrastructure security policies"); if (!scope.startsWith("/")) scope = "/" + scope; @@ -141,7 +143,8 @@ public class ConfigurationManager { 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"); + 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");