Updated to fix protocol parameters when persistence is disabled

This commit is contained in:
Giancarlo Panichi 2022-03-21 15:57:29 +01:00
parent 5f1fee5ca9
commit 6d74cf7fc3
3 changed files with 31 additions and 22 deletions

View File

@ -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

View File

@ -9,7 +9,7 @@
</parent>
<groupId>org.gcube.dataanalysis</groupId>
<artifactId>dataminer</artifactId>
<version>1.8.0</version>
<version>1.8.1-SNAPSHOT</version>
<name>dataminer</name>
<description>An e-Infrastructure service providing state-of-the art DataMining algorithms and ecological modelling approaches under the Web Processing Service (WPS) standard.</description>
@ -55,7 +55,7 @@
<dependency>
<groupId>org.gcube.distribution</groupId>
<artifactId>gcube-bom</artifactId>
<version>2.0.2</version>
<version>2.1.0-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>

View File

@ -29,7 +29,6 @@ public class ConfigurationManager {
private static Boolean useStorage = null;
static boolean simulationMode = false;
EnvironmentVariableManager env = null;
public static synchronized Integer getMaxComputations() {
@ -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();
@ -115,22 +115,24 @@ public class ConfigurationManager {
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);
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");