org.geotools.data.wps
Class WebProcessingService
java.lang.Object
org.geotools.data.ows.AbstractWPS<WPSCapabilitiesType,java.lang.Object>
org.geotools.data.wps.WebProcessingService
public class WebProcessingService
- extends AbstractWPS<WPSCapabilitiesType,java.lang.Object>
WebProcessingService is a class representing a WPS. It is used to access the
Capabilities document and perform requests. It currently only supports version
1.0.0 but will have future versions added and it
will perform version negotiation automatically and use the highest
known version that the server can communicate.
If restriction of versions to be used is desired, this class should be
subclassed and it's setupSpecifications() method over-ridden. It should
add which version/specifications are to be used to the specs array. See
the current implementation for an example.
Example usage:
WebProcessingService wps = new WebProcessingService("http://some.example.com/wps");
WPSCapabilitiesType capabilities = wps.getCapabilities();
... //configure request
- Author:
- gdavis
Constructor Summary |
WebProcessingService(java.net.URL serverURL)
Creates a new WebProcessingService instance and attempts to retrieve the
Capabilities document specified by serverURL. |
WebProcessingService(WPSCapabilitiesType capabilities)
Creates a new WebProcessingService from a WPSCapablitiles document. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
WebProcessingService
public WebProcessingService(WPSCapabilitiesType capabilities)
throws java.io.IOException,
ServiceException
- Creates a new WebProcessingService from a WPSCapablitiles document.
The implementation assumes that the server is located at:
capabilities.getRequest().getGetCapabilities().getGet()
- Parameters:
capabilities
-
- Throws:
java.io.IOException
ServiceException
WebProcessingService
public WebProcessingService(java.net.URL serverURL)
throws java.io.IOException,
ServiceException
- Creates a new WebProcessingService instance and attempts to retrieve the
Capabilities document specified by serverURL.
- Parameters:
serverURL
- a URL that points to the capabilities document of a server
- Throws:
java.io.IOException
- if there is an error communicating with the server
ServiceException
- if the server responds with an error
getOperationURL
public static java.net.URL getOperationURL(java.lang.String operation,
WPSCapabilitiesType cap,
boolean getGet)
- Utility method to fetch the GET or POST URL of the given operation from
the capabilities document
- Parameters:
operation
- the operation URL to find in the capabilities doccap
- the capabilities document (need to pass as the method is static)getGet
- if true, return the GET URL, otherwise return the POST URL
- Returns:
- the URL of the given operation from the capabilities doc, or null
if not found
setupSpecifications
protected void setupSpecifications()
- Sets up the specifications/versions that this server is capable of
communicating with.
- Specified by:
setupSpecifications
in class AbstractWPS<WPSCapabilitiesType,java.lang.Object>
createInfo
protected ServiceInfo createInfo()
- Description copied from class:
AbstractWPS
- Implemented by a subclass to describe service
- Specified by:
createInfo
in class AbstractWPS<WPSCapabilitiesType,java.lang.Object>
- Returns:
- ServiceInfo
createInfo
protected ResourceInfo createInfo(java.lang.Object resource)
- Specified by:
createInfo
in class AbstractWPS<WPSCapabilitiesType,java.lang.Object>
issueRequest
public AbstractWPSGetCapabilitiesResponse issueRequest(GetCapabilitiesRequest request)
throws java.io.IOException,
ServiceException
- Overrides:
issueRequest
in class AbstractWPS<WPSCapabilitiesType,java.lang.Object>
- Throws:
java.io.IOException
ServiceException
issueRequest
public DescribeProcessResponse issueRequest(DescribeProcessRequest request)
throws java.io.IOException,
ServiceException
- Throws:
java.io.IOException
ServiceException
issueRequest
public ExecuteProcessResponse issueRequest(ExecuteProcessRequest request)
throws java.io.IOException,
ServiceException
- Throws:
java.io.IOException
ServiceException
getCapabilities
public WPSCapabilitiesType getCapabilities()
- Get the getCapabilities document. If there was an error parsing it
during creation, it will return null (and it should have thrown an
exception during creation).
- Returns:
- a WPSCapabilitiesType object, representing the Capabilities of the server
createDescribeProcessRequest
public DescribeProcessRequest createDescribeProcessRequest()
throws java.lang.UnsupportedOperationException
- Throws:
java.lang.UnsupportedOperationException
createExecuteProcessRequest
public ExecuteProcessRequest createExecuteProcessRequest()
throws java.lang.UnsupportedOperationException
- Throws:
java.lang.UnsupportedOperationException
Copyright © 1996-2010 Geotools. All Rights Reserved.