EnvironmentVariableManager added

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-analysis/DataMiner@173383 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Lucio Lelii 2018-10-12 13:53:36 +00:00
parent 607f49125c
commit 908e7e57f4
3 changed files with 48 additions and 5 deletions

View File

@ -62,6 +62,8 @@ public class AbstractEcologicalEngineMapper extends AbstractAnnotatedAlgorithm i
private TokenManager tokenm = null;
private EnvironmentVariableManager env = null;
// inputs and outputs
public LinkedHashMap<String, Object> inputs = new LinkedHashMap<String, Object>();
public LinkedHashMap<String, Object> outputs = new LinkedHashMap<String, Object>();
@ -262,6 +264,10 @@ public class AbstractEcologicalEngineMapper extends AbstractAnnotatedAlgorithm i
}
public void setEnvironmentVariableManager(EnvironmentVariableManager env) {
}
public void updateComputationOnWS(float status, String exception) {
updateComputationOnWS(status, exception, null, null);
}
@ -301,6 +307,8 @@ public class AbstractEcologicalEngineMapper extends AbstractAnnotatedAlgorithm i
}
}
@Execute
public void run() throws Exception {
if (observer!=null)
@ -324,7 +332,7 @@ public class AbstractEcologicalEngineMapper extends AbstractAnnotatedAlgorithm i
} else
LOGGER.info("Wps External ID not set");
InputsManager inputsManager = null;
ConfigurationManager configManager = new ConfigurationManager(); // initializes parameters from file
ConfigurationManager configManager = new ConfigurationManager(this.env); // initializes parameters from web.xml
manageUserToken();
Path dir = Paths.get(System.getProperty("java.io.tmpdir"), "dmlocks");
if (!Files.exists(dir))

View File

@ -41,7 +41,12 @@ public class ConfigurationManager {
return simulationMode;
}
@Deprecated
public void getInitializationProperties() {
}
private void inizializePropertiesUsingTemplateFile() {
try {
if (maxComputations == null) {
Properties options = new Properties();
@ -71,8 +76,12 @@ public class ConfigurationManager {
return username;
}
public ConfigurationManager(EnvironmentVariableManager env) {
if (env == null) inizializePropertiesUsingTemplateFile();
}
public ConfigurationManager() {
getInitializationProperties();
inizializePropertiesUsingTemplateFile();
}
public AlgorithmConfiguration getConfig() {

View File

@ -0,0 +1,26 @@
package org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mapping;
public class EnvironmentVariableManager {
public EnvironmentVariableManager(int maxComputation, boolean saveOnStorage, boolean simulationMode) {
super();
this.maxComputation = maxComputation;
this.saveOnStorage = saveOnStorage;
this.simulationMode = simulationMode;
}
private int maxComputation;
private boolean saveOnStorage;
private boolean simulationMode;
public int getMaxComputation() {
return maxComputation;
}
public boolean isSaveOnStorage() {
return saveOnStorage;
}
public boolean isSimulationMode() {
return simulationMode;
}
}