public class WFSClient extends Object
| Modifier and Type | Field and Description |
|---|---|
protected 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)
Executes a WFS transaction.
|
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).
|
(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.
|
ClientResponse |
submitRequest(Document reqEntity,
ProtocolBinding binding)
Submits a request using the specified message binding and the content of
the given XML request entity.
|
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 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 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 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 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)
request - A Document node representing a wfs:Transaction request entity.binding - The ProtocolBinding to useDocument 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 Open Geospatial Consortium. All rights reserved.