dataminer-pool-manager/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/clients/configuration/ConfigurationImpl.java

159 lines
3.1 KiB
Java
Raw Normal View History

package org.gcube.dataanalysis.dataminer.poolmanager.clients.configuration;
import org.gcube.dataanalysis.dataminer.poolmanager.clients.configurations.AbstractConfiguration;
import org.gcube.dataanalysis.dataminer.poolmanager.clients.configurations.Prod;
import org.gcube.dataanalysis.dataminer.poolmanager.clients.configurations.Stage;
2023-01-18 17:56:48 +01:00
public class ConfigurationImpl implements Configuration {
2023-01-18 17:56:48 +01:00
enum CONFIGURATIONS {
STAGE (new Stage ()),
PROD (new Prod ());
private AbstractConfiguration type;
2023-01-18 17:56:48 +01:00
private CONFIGURATIONS(AbstractConfiguration type) {
this.type = type;
2023-01-18 17:56:48 +01:00
}
2023-01-18 17:56:48 +01:00
@Override
public String toString() {
return this.type.getType();
2023-01-18 17:56:48 +01:00
}
public AbstractConfiguration getType ()
2023-01-18 17:56:48 +01:00
{
return this.type;
2023-01-18 17:56:48 +01:00
}
2023-01-18 17:56:48 +01:00
}
2023-01-18 17:56:48 +01:00
// enum REPOSITORIES {
// REPO ("svn.repository"),
// MAIN_ALGO ("svn.algo.main.repo");
//
// private String type;
//
// private REPOSITORIES(String type) {
// this.type = type;
// }
//
// @Override
// public String toString() {
// return this.type;
// }
// }
private CONFIGURATIONS type;
private ClientConfigurationCache cache;
2023-01-18 17:56:48 +01:00
public ConfigurationImpl(CONFIGURATIONS type,ClientConfigurationCache cache) {
this.type = type;
this.cache = cache;
2023-01-18 17:56:48 +01:00
}
2023-01-18 17:56:48 +01:00
@Override
public String getHost() {
return this.cache.getConfiguration(this.type).getHost ();
2023-01-18 17:56:48 +01:00
}
2023-01-18 17:56:48 +01:00
@Override
public String getSVNAlgorithmsList() {
return this.cache.getConfiguration(this.type).getAlgorithmsList();
2023-01-18 17:56:48 +01:00
}
2023-01-18 17:56:48 +01:00
@Override
public String getRepository() {
return this.cache.getConfiguration(this.type).getSoftwareRepo();
2023-01-18 17:56:48 +01:00
}
2023-01-18 17:56:48 +01:00
@Override
public String getSVNLinuxCompiledDepsList()
2023-01-18 17:56:48 +01:00
{
return this.cache.getConfiguration(this.type).getDepsLinuxCompiled();
2023-01-18 17:56:48 +01:00
}
2023-01-18 17:56:48 +01:00
@Override
public String getSVNPreInstalledDepsList() {
return this.cache.getConfiguration(this.type).getDepsPreInstalled();
2023-01-18 17:56:48 +01:00
}
2023-01-18 17:56:48 +01:00
@Override
public String getSVNRBDepsList()
2023-01-18 17:56:48 +01:00
{
return this.cache.getConfiguration(this.type).getDepsRBlackbox();
2023-01-18 17:56:48 +01:00
}
2023-01-18 17:56:48 +01:00
@Override
public String getSVNCRANDepsList() {
return this.cache.getConfiguration(this.type).getDepsR();
2023-01-18 17:56:48 +01:00
}
2023-01-18 17:56:48 +01:00
@Override
public String getSVNJavaDepsList() {
return this.cache.getConfiguration(this.type).getDepsJava();
2023-01-18 17:56:48 +01:00
}
2023-01-18 17:56:48 +01:00
@Override
public String getSVNKWDepsList() {
return this.cache.getConfiguration(this.type).getDepsKnimeWorkflow();
2023-01-18 17:56:48 +01:00
}
2023-01-18 17:56:48 +01:00
@Override
public String getSVNKW4_1DepsList() {
return this.cache.getConfiguration(this.type).getDepsKnimeWorkflow4_1();
2023-01-18 17:56:48 +01:00
}
2023-01-18 17:56:48 +01:00
@Override
public String getSVNOctaveDepsList() {
return this.cache.getConfiguration(this.type).getDepsOctave();
2023-01-18 17:56:48 +01:00
}
2023-01-18 17:56:48 +01:00
@Override
public String getSVNPythonDepsList() {
return this.cache.getConfiguration(this.type).getDepsPython();
2023-01-18 17:56:48 +01:00
}
2023-01-18 17:56:48 +01:00
@Override
public String getSVNPython3_6DepsList() {
return this.cache.getConfiguration(this.type).getDepsPython3_6();
2023-01-18 17:56:48 +01:00
}
2023-01-18 17:56:48 +01:00
@Override
public String getSVNWCDepsList() {
return this.cache.getConfiguration(this.type).getDepsWindowsCompiled();
2023-01-18 17:56:48 +01:00
}
2023-01-18 17:56:48 +01:00
@Override
public SVNRepository getSVNRepository()
2023-01-18 17:56:48 +01:00
{
return this.cache.getSVNRepository();
2023-01-18 17:56:48 +01:00
}
2023-01-18 17:56:48 +01:00
@Override
public String getGhostAlgoDirectory() {
return this.cache.getConfiguration(this.type).getGhostRepo();
2023-01-18 17:56:48 +01:00
}
}