git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-analysis/wps@179070 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
e2ad125949
commit
835c8737c8
4
pom.xml
4
pom.xml
|
@ -37,7 +37,7 @@
|
|||
<enabled>false</enabled>
|
||||
</snapshots>
|
||||
</repository>
|
||||
<repository>
|
||||
<repository>
|
||||
<id>Apache</id>
|
||||
<name>Apache repository</name>
|
||||
<url>http://repo1.maven.org/maven2</url>
|
||||
|
@ -56,7 +56,7 @@
|
|||
<repository>
|
||||
<id>OpenGEO</id>
|
||||
<name>opengeo repository</name>
|
||||
<url>http://repo.opengeo.org</url>
|
||||
<url>https://repo.boundlessgeo.com</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@ import org.gcube.data.analysis.wps.repository.GcubeAlgorithmRepository;
|
|||
import org.gcube.dataanalysis.ecoengine.processing.factories.ProcessorsFactory;
|
||||
import org.gcube.dataanalysis.wps.statisticalmanager.synchserver.infrastructure.InfrastructureDialoguer;
|
||||
import org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mapping.ConfigurationManager;
|
||||
import org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mapping.EnvironmentVariableManager;
|
||||
import org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mapping.TokenManager;
|
||||
import org.n52.wps.commons.WPSConfig;
|
||||
import org.slf4j.Logger;
|
||||
|
@ -43,7 +44,7 @@ public class GetCapabilitiesBuilder {
|
|||
return rightClassification;
|
||||
}
|
||||
|
||||
public String buildGetCapabilities(Map<String, String[]> parameters) throws Exception {
|
||||
public String buildGetCapabilities(Map<String, String[]> parameters, EnvironmentVariableManager env) throws Exception {
|
||||
|
||||
LinkedHashMap<String, Object> basicInputs = new LinkedHashMap<String, Object>();
|
||||
// DONE get scope and username from SmartGears to build the get
|
||||
|
@ -63,7 +64,7 @@ public class GetCapabilitiesBuilder {
|
|||
* basicInputs.put(ConfigurationManager.usernameParameter,
|
||||
* ConfigurationManager.defaultUsername); } }
|
||||
*/
|
||||
ConfigurationManager configManager = new ConfigurationManager();
|
||||
ConfigurationManager configManager = new ConfigurationManager(env);
|
||||
TokenManager tokenm = new TokenManager();
|
||||
tokenm.getCredentials();
|
||||
String scope = tokenm.getScope();
|
||||
|
|
|
@ -142,7 +142,7 @@ public class RequestHandler {
|
|||
InnerMethodName.instance.set("DescribeProcess");
|
||||
}
|
||||
else if (requestType.equalsIgnoreCase("Execute")) {
|
||||
req = new ExecuteRequest(ciMap, env);
|
||||
req = new ExecuteRequest(ciMap, this.env);
|
||||
setResponseMimeType((ExecuteRequest)req);
|
||||
InnerMethodName.instance.set("Execute");
|
||||
}
|
||||
|
@ -171,11 +171,12 @@ public class RequestHandler {
|
|||
* The OutputStream to write the response to.
|
||||
* @throws ExceptionReport
|
||||
*/
|
||||
public RequestHandler(InputStream is, OutputStream os)
|
||||
public RequestHandler(InputStream is, OutputStream os, EnvironmentVariableManager env)
|
||||
throws ExceptionReport {
|
||||
String nodeName, localName, nodeURI, version = null;
|
||||
Document doc;
|
||||
this.os = os;
|
||||
this.env= env;
|
||||
|
||||
boolean isCapabilitiesNode = false;
|
||||
|
||||
|
@ -263,7 +264,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, env);
|
||||
req = new ExecuteRequest(doc, this.env);
|
||||
setResponseMimeType((ExecuteRequest)req);
|
||||
InnerMethodName.instance.set("Execute");
|
||||
LOGGER.debug("Request to Execute Configured!");
|
||||
|
@ -396,7 +397,7 @@ public class RequestHandler {
|
|||
GetCapabilitiesBuilder builder = new GetCapabilitiesBuilder();
|
||||
String getCapabilitiesStringFromInfra = "";
|
||||
try {
|
||||
getCapabilitiesStringFromInfra = builder.buildGetCapabilities(params);
|
||||
getCapabilitiesStringFromInfra = builder.buildGetCapabilities(params, env);
|
||||
} catch (Exception e) {
|
||||
throw new ExceptionReport("Error in building GetCapabilities","getcapabilities",e);
|
||||
}
|
||||
|
|
|
@ -110,13 +110,18 @@ public class WebProcessingService extends HttpServlet {
|
|||
|
||||
String userWriteExcludedValue = context.application().getInitParameter(USER_WIRTE_EXCLUDED_PARAM);
|
||||
|
||||
|
||||
|
||||
List<String> excludedUserForWrite = null;
|
||||
if (userWriteExcludedValue.isEmpty() || userWriteExcludedValue==null)
|
||||
if (userWriteExcludedValue.isEmpty() || userWriteExcludedValue==null) {
|
||||
excludedUserForWrite = Collections.emptyList();
|
||||
else if(!userWriteExcludedValue.equals("*")){
|
||||
LOGGER.debug("none is excluded in write");
|
||||
}else if(!userWriteExcludedValue.equals("*")){
|
||||
excludedUserForWrite = Arrays.asList(userWriteExcludedValue.split(","));
|
||||
excludedUserForWrite.stream().forEach(i -> i.trim());
|
||||
}
|
||||
LOGGER.debug("users excluded in write are {}",excludedUserForWrite);
|
||||
} else
|
||||
LOGGER.debug("all users excluded in write");
|
||||
|
||||
env = new EnvironmentVariableManager(maxComp, saveOnStorage, simulationMode, excludedUserForWrite);
|
||||
LOGGER.info("WPS initialised");
|
||||
|
@ -391,7 +396,7 @@ public class WebProcessingService extends HttpServlet {
|
|||
LOGGER.info("This is a standard xml document");
|
||||
|
||||
RequestHandler handler = new RequestHandler(new ByteArrayInputStream(documentString.getBytes("UTF-8")),
|
||||
res.getOutputStream());
|
||||
res.getOutputStream(), env);
|
||||
LOGGER.debug("POST Request Handler created");
|
||||
String mimeType = handler.getResponseMimeType();
|
||||
LOGGER.debug("Request mimeType: "+mimeType);
|
||||
|
|
Loading…
Reference in New Issue