Gianpaolo Coro 2014-03-21 16:23:25 +00:00
parent af6db68fb8
commit 0a8a133065
3 changed files with 19 additions and 3 deletions

View File

@ -120,7 +120,19 @@ public class WPSClient {
public void describeProcess(String processID, URL processDescriptionURL) throws Exception {
WPSClientSession wpsClient = WPSClientSession.getInstance();
try {
ProcessDescriptionType processDescription = wpsClient.getProcessDescription(wpsServiceURL, processID);
AnalysisLogger.getLogger().debug("Describe Process WPS URL: "+wpsServiceURL);
ProcessDescriptionType processDescription = null;
for (int k=0;k<=3;k++){
try{
processDescription = wpsClient.getProcessDescription(wpsServiceURL, processID);
}catch(Exception e){
AnalysisLogger.getLogger().debug("Retrying with WPS URL: "+wpsServiceURL);
if (k==3)
throw e;
}
if (processDescription!=null)
break;
}
this.currentProcessDescription = processDescription;
// processDescription.set(XmlString.Factory.parse(new URL("http://schemas.opengis.net/wps/1.0.0/examples/40_wpsDescribeProcess_response.xml")));
if (processDescriptionURL != null)

View File

@ -51,7 +51,7 @@ public class DynamicWPSTransducerer implements DynamicTransducer{
static Map<String, Transducerer> transducerersP = null;
static long t0 = System.currentTimeMillis();
static long maxtime = 60*60*1000; //1h
static long maxtime = 2*60*60*1000; //1h
public static boolean isTooMuchTime(){
if (System.currentTimeMillis()-t0>maxtime){
t0 = System.currentTimeMillis();

View File

@ -154,9 +154,13 @@ public class WPSProcess implements Transducerer {
if (wpsclient ==null)
{
// here we build the WPS process by means of the client
try{
wpsclient = new WPSClient(wpsurl);
wpsclient.describeProcess(processid);
inputsCache.put(processid, wpsclient);
}catch(Exception e){
AnalysisLogger.getLogger().debug("Error in getting process description with ID: "+processid);
}
}
inputTypes = wpsclient.getCurrentInputStatisticalTypes();
@ -184,7 +188,7 @@ public class WPSProcess implements Transducerer {
}
public INFRASTRUCTURE getInfrastructure() {
return INFRASTRUCTURE.LOCAL;
return INFRASTRUCTURE.EXTERNAL_WPS;
}
public StatisticalType getOutput() {