public class WFSClient extends Object
Modifier and Type | Field and Description |
---|---|
protected com.sun.jersey.api.client.Client |
client |
protected List<QName> |
featureTypes
The list of feature types recognized by the SUT.
|
protected Set<ProtocolBinding> |
globalBindings
The set of message bindings broadly implemented by the SUT.
|
protected Document |
wfsMetadata
A Document that describes the service under test.
|
Constructor and Description |
---|
WFSClient()
Default client constructor.
|
WFSClient(Document wfsMetadata)
Constructs a client that is aware of the capabilities of some WFS.
|
Modifier and Type | Method and Description |
---|---|
Document |
delete(Map<String,QName> features)
Submits a request to delete a collection of features specified by
identifier and type name.
|
(package private) Document |
executeTransaction(Document request) |
Document |
getCapabilities()
Retrieves a complete representation of the capabilities document from the
WFS implementation described by the service metadata.
|
Document |
getFeatureByType(QName typeName,
int count,
ProtocolBinding binding)
Retrieves feature representations by type name.
|
Document |
getServiceDescription() |
ProtocolBinding |
getTransactionBinding()
Returns a supported protocol binding suitable for transaction requests.
|
Document |
insert(List<Element> features)
Submits a request to insert a collection of GML feature instances.
|
Document |
invokeStoredQuery(String queryId,
Map<String,Object> params)
Invokes a stored query using any supported protocol binding (request
encoding).
|
Document |
replace(List<Element> features)
Submits a request to replace a collection of GML feature representations.
|
(package private) Document |
retrieveXMLResponseEntity(Document request,
ProtocolBinding binding)
Submits the given request entity and returns the response entity as a DOM
Document.
|
void |
setServiceDescription(InputStream srvMetadata)
Sets the service description obtained using the given InputStream.
|
com.sun.jersey.api.client.ClientResponse |
submitRequest(Document reqEntity,
ProtocolBinding binding)
Submits a request using the specified message binding and the content of
the given XML request entity.
|
com.sun.jersey.api.client.ClientResponse |
submitRequest(Source entity,
ProtocolBinding binding,
URI endpoint)
Submits an HTTP request message.
|
Document |
updateFeature(String id,
QName featureType,
Map<String,Object> properties)
Submits a request to update a feature.
|
protected com.sun.jersey.api.client.Client client
protected Document wfsMetadata
protected Set<ProtocolBinding> globalBindings
public WFSClient()
public WFSClient(Document wfsMetadata)
wfsMetadata
- A service description (e.g. WFS capabilities document).public Document getServiceDescription()
public void setServiceDescription(InputStream srvMetadata) throws SAXException, IOException
srvMetadata
- An InputStream supplying the service metadata.SAXException
- If any I/O errors occur.IOException
- If any parsing errors occur.public Document invokeStoredQuery(String queryId, Map<String,Object> params)
queryId
- The stored query identifier.params
- A collection of query parameters distinguished by name (may be
empty, e.g. Collections.null
if the response doesn't contain one.public Document getFeatureByType(QName typeName, int count, ProtocolBinding binding)
typeName
- A QName denoting the feature type.count
- The maximum number of features to fetch (> 0). If count < 1,
the default value (10) applies.binding
- The ProtocolBinding to use for this request; if null
a
global binding will be used.null
if the response doesn't contain one.public Document delete(Map<String,QName> features)
features
- A Map containing entries that specify a feature by identifier
(gml:id attribute value) and type name (QName).null
if the response doesn't contain one.public Document insert(List<Element> features)
features
- A Listnull
if the response doesn't contain one.public Document replace(List<Element> features)
features
- A List containing one or more replacement feature
representations (Element nodes).null
if the response doesn't contain one.public Document updateFeature(String id, QName featureType, Map<String,Object> properties)
id
- The GML identifier of the feature to be updated (gml:id
attribute).featureType
- The type of the feature instance.properties
- A Map containing the feature properties to be updated
(replaced). Each entry consists of a value reference (an XPath
expression) and a value object. The value may be a Node
representing a complex property value; otherwise it is treated
as a simple value by calling the object's toString() method.null
if the response doesn't contain one.public com.sun.jersey.api.client.ClientResponse submitRequest(Source entity, ProtocolBinding binding, URI endpoint)
entity
- An XML representation of the request entity.binding
- The ProtocolBinding
to use.endpoint
- The service endpoint.public com.sun.jersey.api.client.ClientResponse submitRequest(Document reqEntity, ProtocolBinding binding)
reqEntity
- A DOM Document representing the content of the request
message.binding
- The ProtocolBinding to use; may be ProtocolBinding.ANY
if any supported binding can be used.public Document getCapabilities()
null
if one could not be obtained.public ProtocolBinding getTransactionBinding()
ProtocolBinding.POST
is
preferred).Document retrieveXMLResponseEntity(Document request, ProtocolBinding binding)
request
- An XML representation of the request entity; the actual
request depends on the message binding in use.binding
- The ProtocolBinding to use (GET, POST, or SOAP).null
if
the request failed or the message body could not be parsed.Copyright © 2013. All Rights Reserved.