347 lines
14 KiB
Java
347 lines
14 KiB
Java
package org.gcube.dataanalysis.dataminer.poolmanager.util;
|
|
|
|
import java.io.FileInputStream;
|
|
import java.io.FileNotFoundException;
|
|
***REMOVED***
|
|
import java.util.Properties;
|
|
|
|
***REMOVED***
|
|
import org.gcube.dataanalysis.dataminer.poolmanager.clients.DMPMClientConfigurator;
|
|
import org.gcube.dataanalysis.dataminer.poolmanager.clients.ISClient;
|
|
|
|
public class ServiceConfiguration ***REMOVED***
|
|
***REMOVED*** public static String home = System.getProperty("user.home");
|
|
DMPMClientConfigurator dmpc = new DMPMClientConfigurator();
|
|
***REMOVED*** private Properties props;
|
|
|
|
public ServiceConfiguration() ***REMOVED***
|
|
***REMOVED*** this(home+"/dataminer-pool-manager/dpmConfig/service.properties");
|
|
***REMOVED***
|
|
|
|
***REMOVED*** public ServiceConfiguration(String configFile) ***REMOVED***
|
|
***REMOVED*** this.props = new Properties();
|
|
***REMOVED***
|
|
***REMOVED*** FileInputStream input;
|
|
***REMOVED***
|
|
***REMOVED*** try ***REMOVED***
|
|
***REMOVED*** input = new FileInputStream(configFile);
|
|
***REMOVED*** ***REMOVED*** loading properites from properties file
|
|
***REMOVED*** try ***REMOVED***
|
|
***REMOVED*** props.load(input);
|
|
***REMOVED*** ***REMOVED*** catch (IOException e) ***REMOVED***
|
|
***REMOVED*** ***REMOVED*** TODO Auto-generated catch block
|
|
***REMOVED*** e.printStackTrace();
|
|
***REMOVED*** ***REMOVED***
|
|
***REMOVED*** ***REMOVED*** catch (FileNotFoundException e1) ***REMOVED***
|
|
***REMOVED*** ***REMOVED*** TODO Auto-generated catch block
|
|
***REMOVED*** e1.printStackTrace();
|
|
***REMOVED*** ***REMOVED***
|
|
***REMOVED*** ***REMOVED***
|
|
|
|
public String getSVNRepository() ***REMOVED***
|
|
***REMOVED*** return props.getProperty("svn.repository");
|
|
return dmpc.getSVNRepository();
|
|
***REMOVED***
|
|
|
|
public String getSVNMainAlgoRepo() ***REMOVED***
|
|
***REMOVED*** return props.getProperty("svn.algo.main.repo");
|
|
return dmpc.getSVNMainAlgoRepo();
|
|
***REMOVED***
|
|
|
|
public String getStageRepository() ***REMOVED***
|
|
***REMOVED*** return props.getProperty("svn.stage.software.repo");
|
|
return dmpc.getStageRepository();
|
|
***REMOVED***
|
|
|
|
public String getProdRepository() ***REMOVED***
|
|
***REMOVED*** return props.getProperty("svn.prod.software.repo");
|
|
return dmpc.getProdRepository();
|
|
***REMOVED***
|
|
|
|
public String getGhostAlgoDirectory() ***REMOVED***
|
|
***REMOVED*** return props.getProperty("svn.stage.algo.ghost.repo");
|
|
return dmpc.getGhostAlgoDirectory();
|
|
***REMOVED***
|
|
|
|
public String getProdGhostAlgoDirectory() ***REMOVED***
|
|
***REMOVED*** return props.getProperty("svn.prod.algo.ghost.repo");
|
|
return dmpc.getProdGhostAlgoDirectory();
|
|
***REMOVED***
|
|
|
|
***REMOVED*** RProto
|
|
***REMOVED*** public String getSVNRProtoAlgorithmsList()***REMOVED***
|
|
***REMOVED*** return props.getProperty("svn.rproto.algorithms-list");
|
|
***REMOVED*** ***REMOVED***
|
|
***REMOVED***
|
|
***REMOVED*** public String getSVNRProtoLinuxCompiledDepsList()***REMOVED***
|
|
***REMOVED*** return props.getProperty("svn.rproto.deps-linux-compiled");
|
|
***REMOVED*** ***REMOVED***
|
|
***REMOVED***
|
|
***REMOVED*** public String getSVNRProtoCRANDepsList()***REMOVED***
|
|
***REMOVED*** return props.getProperty("svn.rproto.deps-r");
|
|
***REMOVED*** ***REMOVED***
|
|
***REMOVED***
|
|
***REMOVED*** public String getSVNRProtoPreInstalledDepsList()***REMOVED***
|
|
***REMOVED*** return props.getProperty("svn.rproto.deps-pre-installed");
|
|
***REMOVED*** ***REMOVED***
|
|
***REMOVED***
|
|
***REMOVED*** public String getSVNRProtoRBDepsList()***REMOVED***
|
|
***REMOVED*** return props.getProperty("svn.rproto.deps-r-blackbox");
|
|
***REMOVED*** ***REMOVED***
|
|
***REMOVED***
|
|
***REMOVED*** public String getSVNRProtoJavaDepsList()***REMOVED***
|
|
***REMOVED*** return props.getProperty("svn.rproto.deps-java");
|
|
***REMOVED*** ***REMOVED***
|
|
***REMOVED***
|
|
***REMOVED*** public String getSVNRProtoKWDepsList()***REMOVED***
|
|
***REMOVED*** return props.getProperty("svn.rproto.deps-knime-workflow");
|
|
***REMOVED*** ***REMOVED***
|
|
***REMOVED***
|
|
***REMOVED*** public String getSVNRProtoOctaveDepsList()***REMOVED***
|
|
***REMOVED*** return props.getProperty("svn.rproto.deps-octave");
|
|
***REMOVED*** ***REMOVED***
|
|
***REMOVED***
|
|
***REMOVED*** public String getSVNRProtoPythonDepsList()***REMOVED***
|
|
***REMOVED*** return props.getProperty("svn.rproto.deps-python");
|
|
***REMOVED*** ***REMOVED***
|
|
***REMOVED***
|
|
***REMOVED*** public String getSVNRProtoWCDepsList()***REMOVED***
|
|
***REMOVED*** return props.getProperty("svn.rproto.deps-windows-compiled");
|
|
***REMOVED*** ***REMOVED***
|
|
|
|
***REMOVED*** Prod
|
|
public String getSVNProdAlgorithmsList() ***REMOVED***
|
|
***REMOVED*** return props.getProperty("svn.prod.algorithms-list");
|
|
return dmpc.getSVNProdAlgorithmsList();
|
|
***REMOVED***
|
|
|
|
public String getSVNProdLinuxCompiledDepsList() ***REMOVED***
|
|
***REMOVED*** return props.getProperty("svn.prod.deps-linux-compiled");
|
|
return dmpc.getSVNProdLinuxCompiledDepsList();
|
|
***REMOVED***
|
|
|
|
public String getSVNProdCRANDepsList() ***REMOVED***
|
|
***REMOVED*** return props.getProperty("svn.prod.deps-r");
|
|
return dmpc.getSVNProdCRANDepsList();
|
|
***REMOVED***
|
|
|
|
public String getSVNProdPreInstalledDepsList() ***REMOVED***
|
|
***REMOVED*** return props.getProperty("svn.prod.deps-pre-installed");
|
|
return dmpc.getSVNProdPreInstalledDepsList();
|
|
***REMOVED***
|
|
|
|
public String getSVNProdRBDepsList() ***REMOVED***
|
|
***REMOVED*** return props.getProperty("svn.prod.deps-r-blackbox");
|
|
return dmpc.getSVNProdRBDepsList();
|
|
***REMOVED***
|
|
|
|
public String getSVNProdJavaDepsList() ***REMOVED***
|
|
***REMOVED*** return props.getProperty("svn.prod.deps-java");
|
|
return dmpc.getSVNProdJavaDepsList();
|
|
***REMOVED***
|
|
|
|
public String getSVNProdKWDepsList() ***REMOVED***
|
|
***REMOVED*** return props.getProperty("svn.prod.deps-knime-workflow");
|
|
return dmpc.getSVNProdKWDepsList();
|
|
***REMOVED***
|
|
|
|
public String getSVNProdOctaveDepsList() ***REMOVED***
|
|
***REMOVED*** return props.getProperty("svn.prod.deps-octave");
|
|
return dmpc.getSVNProdOctaveDepsList();
|
|
***REMOVED***
|
|
|
|
public String getSVNProdPythonDepsList() ***REMOVED***
|
|
***REMOVED*** return props.getProperty("svn.prod.deps-python");
|
|
return dmpc.getSVNProdPythonDepsList();
|
|
***REMOVED***
|
|
|
|
public String getSVNProdWCDepsList() ***REMOVED***
|
|
***REMOVED*** return props.getProperty("svn.prod.deps-windows-compiled");
|
|
return dmpc.getSVNProdWCDepsList();
|
|
***REMOVED***
|
|
|
|
***REMOVED*** PreProd
|
|
***REMOVED*** public String getSVNPreProdAlgorithmsList()***REMOVED***
|
|
***REMOVED*** return props.getProperty("svn.preprod.algorithms-list");
|
|
***REMOVED*** ***REMOVED***
|
|
***REMOVED***
|
|
***REMOVED*** public String getSVNPreProdLinuxCompiledDepsList()***REMOVED***
|
|
***REMOVED*** return props.getProperty("svn.preprod.deps-linux-compiled");
|
|
***REMOVED*** ***REMOVED***
|
|
***REMOVED***
|
|
***REMOVED*** public String getSVNPreProdCRANDepsList()***REMOVED***
|
|
***REMOVED*** return props.getProperty("svn.preprod.deps-r");
|
|
***REMOVED*** ***REMOVED***
|
|
***REMOVED***
|
|
***REMOVED*** public String getSVNPreProdPreInstalledDepsList()***REMOVED***
|
|
***REMOVED*** return props.getProperty("svn.preprod.deps-pre-installed");
|
|
***REMOVED*** ***REMOVED***
|
|
***REMOVED***
|
|
***REMOVED*** public String getSVNPreProdRBDepsList()***REMOVED***
|
|
***REMOVED*** return props.getProperty("svn.preprod.deps-r-blackbox");
|
|
***REMOVED*** ***REMOVED***
|
|
***REMOVED***
|
|
***REMOVED*** public String getSVNPreProdJavaDepsList()***REMOVED***
|
|
***REMOVED*** return props.getProperty("svn.preprod.deps-java");
|
|
***REMOVED*** ***REMOVED***
|
|
***REMOVED***
|
|
***REMOVED*** public String getSVNPreProdKWDepsList()***REMOVED***
|
|
***REMOVED*** return props.getProperty("svn.preprod.deps-knime-workflow");
|
|
***REMOVED*** ***REMOVED***
|
|
***REMOVED***
|
|
***REMOVED*** public String getSVNPreProdOctaveDepsList()***REMOVED***
|
|
***REMOVED*** return props.getProperty("svn.preprod.deps-octave");
|
|
***REMOVED*** ***REMOVED***
|
|
***REMOVED***
|
|
***REMOVED*** public String getSVNPreProdPythonDepsList()***REMOVED***
|
|
***REMOVED*** return props.getProperty("svn.preprod.deps-python");
|
|
***REMOVED*** ***REMOVED***
|
|
***REMOVED***
|
|
***REMOVED*** public String getSVNPreProdWCDepsList()***REMOVED***
|
|
***REMOVED*** return props.getProperty("svn.preprod.deps-windows-compiled");
|
|
***REMOVED*** ***REMOVED***
|
|
|
|
***REMOVED*** dev
|
|
***REMOVED*** public String getSVNDevAlgorithmsList()***REMOVED***
|
|
***REMOVED*** return props.getProperty("svn.dev.algorithms-list");
|
|
***REMOVED*** ***REMOVED***
|
|
***REMOVED***
|
|
***REMOVED*** public String getSVNDevLinuxCompiledDepsList()***REMOVED***
|
|
***REMOVED*** return props.getProperty("svn.dev.deps-linux-compiled");
|
|
***REMOVED*** ***REMOVED***
|
|
***REMOVED***
|
|
***REMOVED*** public String getSVNDevCRANDepsList()***REMOVED***
|
|
***REMOVED*** return props.getProperty("svn.dev.deps-r");
|
|
***REMOVED*** ***REMOVED***
|
|
***REMOVED***
|
|
***REMOVED*** public String getSVNDevPreInstalledDepsList()***REMOVED***
|
|
***REMOVED*** return props.getProperty("svn.dev.deps-pre-installed");
|
|
***REMOVED*** ***REMOVED***
|
|
***REMOVED***
|
|
***REMOVED*** public String getSVNDevRBDepsList()***REMOVED***
|
|
***REMOVED*** return props.getProperty("svn.dev.deps-r-blackbox");
|
|
***REMOVED*** ***REMOVED***
|
|
***REMOVED***
|
|
***REMOVED*** public String getSVNDevJavaDepsList()***REMOVED***
|
|
***REMOVED*** return props.getProperty("svn.dev.deps-java");
|
|
***REMOVED*** ***REMOVED***
|
|
***REMOVED***
|
|
***REMOVED*** public String getSVNDevKWDepsList()***REMOVED***
|
|
***REMOVED*** return props.getProperty("svn.dev.deps-knime-workflow");
|
|
***REMOVED*** ***REMOVED***
|
|
***REMOVED***
|
|
***REMOVED*** public String getSVNDevOctaveDepsList()***REMOVED***
|
|
***REMOVED*** return props.getProperty("svn.dev.deps-octave");
|
|
***REMOVED*** ***REMOVED***
|
|
***REMOVED***
|
|
***REMOVED*** public String getSVNDevPythonDepsList()***REMOVED***
|
|
***REMOVED*** return props.getProperty("svn.dev.deps-python");
|
|
***REMOVED*** ***REMOVED***
|
|
***REMOVED***
|
|
***REMOVED*** public String getSVNDevWCDepsList()***REMOVED***
|
|
***REMOVED*** return props.getProperty("svn.dev.deps-windows-compiled");
|
|
***REMOVED*** ***REMOVED***
|
|
***REMOVED***
|
|
***REMOVED***
|
|
|
|
***REMOVED*** public String getCSVUrl() ***REMOVED***
|
|
***REMOVED*** return props.getProperty("HAPROXY_CSV");
|
|
***REMOVED*** ***REMOVED***
|
|
|
|
***REMOVED*** public String getHost(String env)***REMOVED***
|
|
***REMOVED*** String a = "";
|
|
***REMOVED***
|
|
***REMOVED*** if (env.equals("Dev")||(env.equals("Preprod")))***REMOVED***
|
|
***REMOVED*** a = this.getDevStagingHost().trim();
|
|
***REMOVED*** ***REMOVED***
|
|
***REMOVED***
|
|
***REMOVED*** if (env.equals("Prod")||(env.equals("Proto")))***REMOVED***
|
|
***REMOVED*** a = this.getProtoProdStagingHost().trim();
|
|
***REMOVED*** ***REMOVED***
|
|
***REMOVED*** return a;
|
|
***REMOVED*** ***REMOVED***
|
|
|
|
***REMOVED*** public String getDevStagingHost() ***REMOVED***
|
|
***REMOVED*** return props.getProperty("DEV_STAGING_HOST");
|
|
***REMOVED*** ***REMOVED***
|
|
|
|
public String getStagingHost() ***REMOVED***
|
|
***REMOVED*** return props.getProperty("STAGE_GHOST");
|
|
return dmpc.getStagingHost();
|
|
***REMOVED***
|
|
|
|
public String getProdHost() ***REMOVED***
|
|
***REMOVED*** return props.getProperty("PROD_GHOST");
|
|
return dmpc.getProdHost();
|
|
***REMOVED***
|
|
|
|
***REMOVED*** public String getProtoProdStagingHost() ***REMOVED***
|
|
***REMOVED*** return props.getProperty("PROTO_PROD_STAGING_HOST");
|
|
***REMOVED*** ***REMOVED***
|
|
|
|
***REMOVED*** Staging
|
|
public String getSVNStagingAlgorithmsList() ***REMOVED***
|
|
***REMOVED*** return props.getProperty("svn.stage.algorithms-list");
|
|
return dmpc.getSVNStagingAlgorithmsList();
|
|
***REMOVED***
|
|
|
|
public String getSVNStagingLinuxCompiledDepsList() ***REMOVED***
|
|
***REMOVED*** return props.getProperty("svn.stage.deps-linux-compiled");
|
|
return dmpc.getSVNStagingLinuxCompiledDepsList();
|
|
***REMOVED***
|
|
|
|
public String getSVNStagingCRANDepsList() ***REMOVED***
|
|
***REMOVED*** return props.getProperty("svn.stage.deps-r");
|
|
return dmpc.getSVNStagingCRANDepsList();
|
|
***REMOVED***
|
|
|
|
public String getSVNStagingPreInstalledDepsList() ***REMOVED***
|
|
***REMOVED*** return props.getProperty("svn.stage.deps-pre-installed");
|
|
return dmpc.getSVNStagingPreInstalledDepsList();
|
|
***REMOVED***
|
|
|
|
public String getSVNStagingRBDepsList() ***REMOVED***
|
|
***REMOVED*** return props.getProperty("svn.stage.deps-r-blackbox");
|
|
return dmpc.getSVNStagingRBDepsList();
|
|
***REMOVED***
|
|
|
|
public String getSVNStagingJavaDepsList() ***REMOVED***
|
|
***REMOVED*** return props.getProperty("svn.stage.deps-java");
|
|
return dmpc.getSVNStagingJavaDepsList();
|
|
***REMOVED***
|
|
|
|
public String getSVNStagingKWDepsList() ***REMOVED***
|
|
***REMOVED*** return props.getProperty("svn.stage.deps-knime-workflow");
|
|
return dmpc.getSVNStagingKWDepsList();
|
|
***REMOVED***
|
|
|
|
public String getSVNStagingOctaveDepsList() ***REMOVED***
|
|
***REMOVED*** return props.getProperty("svn.stage.deps-octave");
|
|
return dmpc.getSVNStagingOctaveDepsList();
|
|
***REMOVED***
|
|
|
|
public String getSVNStagingPythonDepsList() ***REMOVED***
|
|
***REMOVED*** return props.getProperty("svn.stage.deps-python");
|
|
return dmpc.getSVNStagingPythonDepsList();
|
|
***REMOVED***
|
|
|
|
public String getSVNStagingWCDepsList() ***REMOVED***
|
|
***REMOVED*** return props.getProperty("svn.stage.deps-windows-compiled");
|
|
return dmpc.getSVNStagingWCDepsList();
|
|
***REMOVED***
|
|
|
|
public static void main(String[] args) throws FileNotFoundException ***REMOVED***
|
|
***REMOVED***ServiceConfiguration a = new ServiceConfiguration();
|
|
ScopeProvider.instance.set("/gcube/devNext/NextNext");
|
|
***REMOVED*** System.out.println(a.getStagingHost());
|
|
***REMOVED*** System.out.println(a.getDevStagingHost());
|
|
***REMOVED*** System.out.println(a.getProtoProdStagingHost());
|
|
***REMOVED*** System.out.println(a.getCSVUrl());
|
|
***REMOVED*** System.out.println(a.getSVNMainAlgoRepo());
|
|
***REMOVED*** System.out.println(a.getSVNRProtoCRANDepsList());
|
|
***REMOVED*** System.out.println(a.getProdHost());
|
|
***REMOVED***System.out.println(a.getSVNProdRBDepsList());
|
|
***REMOVED***
|
|
|
|
***REMOVED***
|