package org.gcube.dataanalysis.dataminer.poolmanager.util; import java.io.FileNotFoundException; ***REMOVED*** ***REMOVED*** ***REMOVED*** import org.gcube.dataanalysis.dataminer.poolmanager.clients.HAProxy; ***REMOVED*** ***REMOVED*** public class ClusterBuilder { ***REMOVED***1. to complete public static Cluster getStagingDataminerCluster() throws FileNotFoundException{ Cluster cluster = new Cluster(); ServiceConfiguration p = new ServiceConfiguration(); Host h = new Host(p.getStagingHost()); ***REMOVED***TODO: read this from configuration or IS? h.setName(p.getStagingHost()); cluster.addHost(h); return cluster; ***REMOVED*** public static Cluster getVRECluster(String targetVREToken, String targetVRE) throws IOException{ Cluster cluster = new Cluster(); for (Host h : new HAProxy().listDataMinersByCluster(targetVREToken,targetVRE)) { cluster.addHost(h); ***REMOVED*** return cluster; ***REMOVED*** public static Cluster getRProtoCluster() throws IOException{ ***REMOVED***Assumes the service is running in RPrototypingLab String token = SecurityTokenProvider.instance.get(); String targetVRE = ScopeProvider.instance.get(); return getVRECluster(token, targetVRE); ***REMOVED*** ***REMOVED***