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

View File

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

View File

@ -19,7 +19,7 @@ public class DataminerPoolManager {
public DataminerPoolManager() {
try {
***REMOVED***TODO: read this from configuration - fatto
***REMOVED***TODO: read this from configuration
this.svnUpdater = new SVNUpdater(new Props().getSVNrepo());
***REMOVED*** catch (SVNException e) {
e.printStackTrace();

View File

@ -1,5 +1,6 @@
package org.gcube.dataanalysis.dataminer.poolmanager.util;
import java.io.FileNotFoundException;
***REMOVED***
***REMOVED***
@ -12,7 +13,7 @@ public class ClusterBuilder {
***REMOVED***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;
***REMOVED***
import java.io.InputStream;
import java.util.Properties;
public class Props {
@ -11,8 +14,13 @@ public class Props {
public String getCSVUrl() {
Properties props = new Properties();
java.io.InputStream input = Props.class.getClassLoader().getResourceAsStream("service.properties");
***REMOVED***read from war
***REMOVED***java.io.InputStream input = Props.class.getClassLoader().getResourceAsStream("service.properties");
***REMOVED***read from filesystem
FileInputStream input;
try {
input = new FileInputStream(home+"/dpmConfig/service.properties");
***REMOVED*** loading properites from properties file
try {
props.load(input);
@ -20,8 +28,11 @@ public class Props {
***REMOVED*** TODO Auto-generated catch block
e.printStackTrace();
***REMOVED***
***REMOVED*** reading proeprty
***REMOVED*** catch (FileNotFoundException e1) {
***REMOVED*** TODO Auto-generated catch block
e1.printStackTrace();
***REMOVED***
***REMOVED*** reading propeprty
String path = props.getProperty("HAPROXY_CSV");
return path;
@ -30,8 +41,13 @@ public class Props {
public String getSVNrepo() {
Properties props = new Properties();
java.io.InputStream input = Props.class.getClassLoader().getResourceAsStream("service.properties");
***REMOVED***read from war
***REMOVED***java.io.InputStream input = Props.class.getClassLoader().getResourceAsStream("service.properties");
***REMOVED***read from filesystem
FileInputStream input;
try {
input = new FileInputStream(home+"/dpmConfig/service.properties");
***REMOVED*** loading properites from properties file
try {
props.load(input);
@ -39,8 +55,11 @@ public class Props {
***REMOVED*** TODO Auto-generated catch block
e.printStackTrace();
***REMOVED***
***REMOVED*** reading proeprty
***REMOVED*** catch (FileNotFoundException e1) {
***REMOVED*** TODO Auto-generated catch block
e1.printStackTrace();
***REMOVED***
***REMOVED*** reading propeprty
String path = props.getProperty("SVN_REPO");
return path;
@ -48,11 +67,15 @@ public class Props {
public String getStagingHost() {
Properties props = new Properties();
java.io.InputStream input = Props.class.getClassLoader().getResourceAsStream("service.properties");
***REMOVED***read from war
***REMOVED***java.io.InputStream input = Props.class.getClassLoader().getResourceAsStream("service.properties");
***REMOVED***read from filesystem
FileInputStream input;
try {
input = new FileInputStream(home+"/dpmConfig/service.properties");
***REMOVED*** loading properites from properties file
try {
props.load(input);
@ -60,16 +83,21 @@ public class Props {
***REMOVED*** TODO Auto-generated catch block
e.printStackTrace();
***REMOVED***
***REMOVED*** catch (FileNotFoundException e1) {
***REMOVED*** TODO Auto-generated catch block
e1.printStackTrace();
***REMOVED***
***REMOVED*** reading proeprty
***REMOVED*** reading propeprty
String path = props.getProperty("STAGING_HOST");
return path;
***REMOVED***
public static void main(String[] args) {
***REMOVED***Props a = new Props();
public static void main(String[] args) throws FileNotFoundException {
Props a = new Props();
System.out.println(new Props().getSVNrepo());
***REMOVED***System.out.println(a.getStagingHost());
System.out.println(a.getStagingHost());
System.out.println(a.getCSVUrl());
***REMOVED***
***REMOVED***