This commit is contained in:
Nunzio Andrea Galante 2017-05-15 16:44:37 +00:00
parent cece02a666
commit d59a41956d
4 changed files with 62 additions and 32 deletions

View File

@ -65,7 +65,8 @@ public class RestPoolManager implements PoolManager {
return service.getLogById(logUrl);
}
@Override
@Override
public Algorithm extractAlgorithm(String url) throws IOException {
// TODO Auto-generated method stub
return null;

View File

@ -17,9 +17,9 @@ public class DataminerPoolManager {
private SVNUpdater svnUpdater;
public DataminerPoolManager(){
public DataminerPoolManager() {
try {
//TODO: read this from configuration - fatto
//TODO: read this from configuration
this.svnUpdater = new SVNUpdater(new Props().getSVNrepo());
} catch (SVNException e) {
e.printStackTrace();

View File

@ -1,5 +1,6 @@
package org.gcube.dataanalysis.dataminer.poolmanager.util;
import java.io.FileNotFoundException;
import java.io.IOException;
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
@ -12,7 +13,7 @@ public class ClusterBuilder {
//1. to complete
public static Cluster getStagingDataminerCluster(){
public static Cluster getStagingDataminerCluster() throws FileNotFoundException{
Cluster cluster = new Cluster();
Props p = new Props();
Host h = new Host(p.getStagingHost());

View File

@ -1,6 +1,9 @@
package org.gcube.dataanalysis.dataminer.poolmanager.util;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
public class Props {
@ -11,17 +14,25 @@ public class Props {
public String getCSVUrl() {
Properties props = new Properties();
java.io.InputStream input = Props.class.getClassLoader().getResourceAsStream("service.properties");
// loading properites from properties file
//read from war
//java.io.InputStream input = Props.class.getClassLoader().getResourceAsStream("service.properties");
//read from filesystem
FileInputStream input;
try {
props.load(input);
} catch (IOException e) {
input = new FileInputStream(home+"/dpmConfig/service.properties");
// loading properites from properties file
try {
props.load(input);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} catch (FileNotFoundException e1) {
// TODO Auto-generated catch block
e.printStackTrace();
e1.printStackTrace();
}
// reading proeprty
// reading propeprty
String path = props.getProperty("HAPROXY_CSV");
return path;
@ -30,17 +41,25 @@ public class Props {
public String getSVNrepo() {
Properties props = new Properties();
java.io.InputStream input = Props.class.getClassLoader().getResourceAsStream("service.properties");
// loading properites from properties file
//read from war
//java.io.InputStream input = Props.class.getClassLoader().getResourceAsStream("service.properties");
//read from filesystem
FileInputStream input;
try {
props.load(input);
} catch (IOException e) {
input = new FileInputStream(home+"/dpmConfig/service.properties");
// loading properites from properties file
try {
props.load(input);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} catch (FileNotFoundException e1) {
// TODO Auto-generated catch block
e.printStackTrace();
e1.printStackTrace();
}
// reading proeprty
// reading propeprty
String path = props.getProperty("SVN_REPO");
return path;
@ -48,28 +67,37 @@ public class Props {
public String getStagingHost() {
Properties props = new Properties();
java.io.InputStream input = Props.class.getClassLoader().getResourceAsStream("service.properties");
// loading properites from properties file
//read from war
//java.io.InputStream input = Props.class.getClassLoader().getResourceAsStream("service.properties");
//read from filesystem
FileInputStream input;
try {
props.load(input);
} catch (IOException e) {
input = new FileInputStream(home+"/dpmConfig/service.properties");
// loading properites from properties file
try {
props.load(input);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} catch (FileNotFoundException e1) {
// TODO Auto-generated catch block
e.printStackTrace();
e1.printStackTrace();
}
// reading proeprty
// reading propeprty
String path = props.getProperty("STAGING_HOST");
return path;
}
public static void main(String[] args) {
//Props a = new Props();
public static void main(String[] args) throws FileNotFoundException {
Props a = new Props();
System.out.println(new Props().getSVNrepo());
//System.out.println(a.getStagingHost());
System.out.println(a.getStagingHost());
System.out.println(a.getCSVUrl());
}
}