use of org.geosdi.geoplatform.xml.wps.v100.DescribeProcess in project geo-platform by geosdi.
the class WPSDescribeProcessRequestV100 method createRequest.
/**
* @return {@link DescribeProcess}
* @throws Exception
*/
@Override
protected DescribeProcess createRequest() throws Exception {
checkArgument(this.isSetProcessIdentifiers(), "The Parameter ProcessIdentifiers must not be null or Empty.");
List<CodeType> processCodeTypes = this.processIdentifiers.stream().filter(value -> ((value != null) && !(value.trim().isEmpty()))).map(PROCESS_IDENTIFIER).collect(toList());
checkArgument((processCodeTypes != null) && !(processCodeTypes.isEmpty()), "The Parameter ProcessCodeTypes must not be null or an Empty List.");
DescribeProcess describeProcess = new DescribeProcess();
describeProcess.setIdentifier(processCodeTypes);
if (this.isLanguageSet())
describeProcess.setLanguage(this.language);
return describeProcess;
}
use of org.geosdi.geoplatform.xml.wps.v100.DescribeProcess in project geo-platform by geosdi.
the class WPSDescribeProcessUnmarshallerTest method unmarshallWPSDescribeProcessTest.
@Theory
public void unmarshallWPSDescribeProcessTest(String fileName) throws Exception {
String describeProcess = dirFiles.concat(fileName);
File file = new File(describeProcess);
Unmarshaller unmarshaller = wpsJAXBContext.acquireUnmarshaller();
ProcessDescriptions processDescriptions = (ProcessDescriptions) unmarshaller.unmarshal(file);
logger.info("##########################WPS_PROCESS_DESCRIPTIONS : \n{}\n for File : {}\n", processDescriptions, fileName);
}
use of org.geosdi.geoplatform.xml.wps.v100.DescribeProcess in project geotoolkit by Geomatys.
the class WebProcessingClient method createDescribeProcess.
/**
* Create a describe process request
*
* @return DescribeProcessRequest : describe process request.
*/
public DescribeProcessRequest createDescribeProcess() {
final WPSVersion version = ensureVersionSet();
final DescribeProcessRequest request = new DescribeProcessRequest(serverURL.toString(), getClientSecurity(), forceGET, getTimeOutValue());
DescribeProcess content = new DescribeProcess();
content.setService("WPS");
content.setVersion(version.getCode());
request.setContent(content);
return request;
}
use of org.geosdi.geoplatform.xml.wps.v100.DescribeProcess in project geotoolkit by Geomatys.
the class DescribeProcessTest method testRequestAndMarshall.
@Test
public void testRequestAndMarshall() throws Exception {
final WebProcessingClient client = new WebProcessingClient(new URL("http://test.com"), null, WPSVersion.v100);
final DescribeProcessRequest request = client.createDescribeProcess();
final DescribeProcess content = request.getContent();
content.setIdentifier(Arrays.asList("identifier1", "identifier2", "identifier3"));
final StringWriter stringWriter = new StringWriter();
final Marshaller marshaller = WPSMarshallerPool.getInstance().acquireMarshaller();
marshaller.marshal(content, stringWriter);
String result = stringWriter.toString();
final String expectedMarshalledRequest = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n" + "<wps:DescribeProcess version=\"1.0.0\" service=\"WPS\"" + " xmlns:wps=\"http://www.opengis.net/wps/1.0.0\"" + " xmlns:ows=\"http://www.opengis.net/ows/1.1\">\n" + " <ows:Identifier>identifier1</ows:Identifier>\n" + " <ows:Identifier>identifier2</ows:Identifier>\n" + " <ows:Identifier>identifier3</ows:Identifier>\n" + "</wps:DescribeProcess>\n";
assertXmlEquals(expectedMarshalledRequest, result, "xmlns:*");
WPSMarshallerPool.getInstance().recycle(marshaller);
}
use of org.geosdi.geoplatform.xml.wps.v100.DescribeProcess in project geotoolkit by Geomatys.
the class DescribeProcessTest method testDescribeProcess110.
/**
* Ensures the {@link DescribeProcess#getURL()} method returns a well-built url,
* with the parameters given.
*/
@Test
public void testDescribeProcess110() throws MalformedURLException {
final WebProcessingClient client = new WebProcessingClient(new URL("http://test.com"), null, WPSVersion.v100);
final DescribeProcessRequest request = client.createDescribeProcess();
final DescribeProcess content = request.getContent();
content.setIdentifier(Arrays.asList("identifier1", "identifier2", "identifier3"));
final URL url;
try {
url = request.getURL();
} catch (MalformedURLException ex) {
fail(ex.getLocalizedMessage());
return;
}
final String strUrl = url.toString();
// final String expectedURL = "http://test.com?VERSION=1.0.0&SERVICE=WPS&REQUEST=DescribeProcess&IDENTIFIER=identifier1,identifier2,identifier3";
assertTrue(strUrl.contains("VERSION=1.0.0"));
assertTrue(strUrl.contains("SERVICE=WPS"));
assertTrue(strUrl.contains("REQUEST=DescribeProcess"));
assertTrue(strUrl.contains("IDENTIFIER=identifier1%2Cidentifier2%2Cidentifier3"));
}
Aggregations