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 a WFS
implementation.
|
Modifier and Type | Method and Description |
---|---|
com.sun.jersey.api.client.ClientResponse |
deleteFeature(Document reqEntity,
String id,
QName typeName)
Submits a request to delete a feature.
|
Document |
deleteFeatures(Map<String,QName> features,
ProtocolBinding binding)
Submits a request to delete a collection of features specified by
identifier and type name.
|
int |
deleteStoredQuery(String queryId)
Submits a request to delete a stored query.
|
(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.
|
com.sun.jersey.api.client.Client |
getClient()
Returns the underlying JAX-RS client.
|
com.sun.jersey.api.client.ClientResponse |
getFeature(Source reqEntity,
ProtocolBinding binding)
Submits a GetFeature request.
|
Document |
getFeatureByType(QName typeName,
int count,
ProtocolBinding binding)
Retrieves feature representations by type name.
|
com.sun.jersey.api.client.ClientResponse |
GetFeatureVersion(ResourceId rid,
QName typeName)
Submits a request to retrieve one or more feature versions as specified
by the given resource identifier.
|
Document |
getServiceDescription()
Returns the WFS service description set for this client.
|
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).
|
List<String> |
listStoredQueries()
Requests a list of stored queries.
|
(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 com.sun.jersey.api.client.Client getClient()
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
- A stored query identifier.params
- A collection of query parameters distinguished by name (may be
empty, e.g. Collections.<String, Object>.emptyMap()
).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 com.sun.jersey.api.client.ClientResponse getFeature(Source reqEntity, ProtocolBinding binding)
reqEntity
- A Source representing the content of the request entity; if
necessary it will be transformed into the query component of a
GET request.binding
- The HTTP method binding to use.public Document deleteFeatures(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 com.sun.jersey.api.client.ClientResponse deleteFeature(Document reqEntity, String id, QName typeName)
reqEntity
- A WFS transaction request entity (wfs:Transaction).id
- A feature identifier.typeName
- The type name of the feature.public com.sun.jersey.api.client.ClientResponse GetFeatureVersion(ResourceId rid, QName typeName)
rid
- A resource identifier that selects members of the version
chain to which this identified version belongs.typeName
- The name of a feature type.public Document insert(List<Element> features, ProtocolBinding binding)
features
- A List<Element> containing one or more feature
representations.binding
- The ProtocolBinding to use.null
if the response doesn't contain one.public Document updateFeature(String id, QName featureType, Map<String,Object> properties)
id
- A feature identifier.featureType
- The qualified name of the feature type.properties
- A Map containing the feature properties to be updated.updateFeature(Document, String, QName, Map, ProtocolBinding)
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()
acceptVersions
parameter is omitted, so the response shall
reflect the latest version supported by the SUT.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.public int deleteStoredQuery(String queryId)
queryId
- A URI value that identifies the query to be dropped.Copyright © 2022 Open Geospatial Consortium. All rights reserved.