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,
ProtocolBinding binding)
Submits a request to delete a collection of features specified by
identifier and type name.
|
(package private) Document |
executeTransaction(Document request,
ProtocolBinding binding) |
ProtocolBinding |
getAnyTransactionBinding()
Returns a protocol binding suitable for transaction requests.
|
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() |
Document |
insert(List<Element> features,
ProtocolBinding binding)
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,
ProtocolBinding binding)
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(Document req,
String id,
QName featureType,
Map<String,Object> properties,
ProtocolBinding binding)
Submits a request to update a feature.
|
Document |
updateFeature(String id,
QName featureType,
Map<String,Object> properties)
Submits a request to update a feature using the POST protocol binding.
|
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, ProtocolBinding binding)
features
- A Map containing entries that specify a feature by identifier
(gml:id attribute value) and type name (QName).binding
- The ProtocolBinding to use.null
if the response doesn't contain one.public Document insert(List<Element> features, ProtocolBinding binding)
features
- A Listbinding
- The ProtocolBinding to use.null
if the response doesn't contain one.public Document replace(List<Element> features, ProtocolBinding binding)
features
- A List containing one or more replacement feature
representations (Element nodes).binding
- The ProtocolBinding to use.null
if the response doesn't contain one.public Document updateFeature(String id, QName featureType, Map<String,Object> properties)
public Document updateFeature(Document req, String id, QName featureType, Map<String,Object> properties, ProtocolBinding binding)
req
- An empty wfs:Transaction request entity.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.binding
- The ProtocolBinding to use.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 getAnyTransactionBinding()
Document executeTransaction(Document request, ProtocolBinding binding)
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 © 2014. All rights reserved.