|
|
|
@ -43,6 +43,7 @@ import javax.xml.parsers.ParserConfigurationException;
|
|
|
|
|
import org.apache.commons.collections.map.CaseInsensitiveMap;
|
|
|
|
|
import org.apache.commons.io.IOUtils;
|
|
|
|
|
import org.gcube.common.authorization.library.AuthorizedTasks;
|
|
|
|
|
import org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mapping.EnvironmentVariableManager;
|
|
|
|
|
import org.gcube.smartgears.utils.InnerMethodName;
|
|
|
|
|
import org.n52.wps.server.ExceptionReport;
|
|
|
|
|
import org.n52.wps.server.WebProcessingService;
|
|
|
|
@ -74,6 +75,8 @@ public class RequestHandler {
|
|
|
|
|
|
|
|
|
|
protected Request req;
|
|
|
|
|
|
|
|
|
|
private EnvironmentVariableManager env;
|
|
|
|
|
|
|
|
|
|
// Empty constructor due to classes which extend the RequestHandler
|
|
|
|
|
protected RequestHandler() {
|
|
|
|
|
|
|
|
|
@ -90,10 +93,11 @@ public class RequestHandler {
|
|
|
|
|
* @throws ExceptionReport
|
|
|
|
|
* If the requested operation is not supported
|
|
|
|
|
*/
|
|
|
|
|
public RequestHandler(Map<String, String[]> params, OutputStream os)
|
|
|
|
|
public RequestHandler(Map<String, String[]> params, OutputStream os, EnvironmentVariableManager env)
|
|
|
|
|
throws ExceptionReport {
|
|
|
|
|
this.os = os;
|
|
|
|
|
this.params=params;
|
|
|
|
|
this.env = env;
|
|
|
|
|
//sleepingTime is 0, by default.
|
|
|
|
|
/*if(WPSConfiguration.getInstance().exists(PROPERTY_NAME_COMPUTATION_TIMEOUT)) {
|
|
|
|
|
this.sleepingTime = Integer.parseInt(WPSConfiguration.getInstance().getProperty(PROPERTY_NAME_COMPUTATION_TIMEOUT));
|
|
|
|
@ -138,7 +142,7 @@ public class RequestHandler {
|
|
|
|
|
InnerMethodName.instance.set("DescribeProcess");
|
|
|
|
|
}
|
|
|
|
|
else if (requestType.equalsIgnoreCase("Execute")) {
|
|
|
|
|
req = new ExecuteRequest(ciMap);
|
|
|
|
|
req = new ExecuteRequest(ciMap, env);
|
|
|
|
|
setResponseMimeType((ExecuteRequest)req);
|
|
|
|
|
InnerMethodName.instance.set("Execute");
|
|
|
|
|
}
|
|
|
|
@ -259,7 +263,7 @@ public class RequestHandler {
|
|
|
|
|
// get the request type
|
|
|
|
|
if (nodeURI.equals(WebProcessingService.WPS_NAMESPACE) && localName.equals("Execute")) {
|
|
|
|
|
LOGGER.debug("Detected Request to Execute!");
|
|
|
|
|
req = new ExecuteRequest(doc);
|
|
|
|
|
req = new ExecuteRequest(doc, env);
|
|
|
|
|
setResponseMimeType((ExecuteRequest)req);
|
|
|
|
|
InnerMethodName.instance.set("Execute");
|
|
|
|
|
LOGGER.debug("Request to Execute Configured!");
|
|
|
|
|