org.gvsig.remoteclient.wfs
Class WFSClient

java.lang.Object
  extended by org.gvsig.remoteclient.RemoteClient
      extended by org.gvsig.remoteclient.wfs.WFSClient

public class WFSClient
extends RemoteClient

Represents the class the with the necessary logic to connect to a OGCWFS and interpretate the data

Author:
Jorge Piera LlodrĂ¡ (piera_jor@gva.es)

Field Summary
 
Fields inherited from class org.gvsig.remoteclient.RemoteClient
hostName, port, serviceName
 
Constructor Summary
WFSClient(java.lang.String host)
          Constructor.
WFSClient(java.lang.String host, java.lang.String version)
           
 
Method Summary
 void close()
          Does ...
 boolean connect(boolean override, org.gvsig.compat.net.ICancellable cancel)
          Checks the connection to de remote WFS and requests its capabilities.
 boolean connect(org.gvsig.compat.net.ICancellable cancel)
           
 java.io.File describeFeatureType(WFSStatus status, boolean override, org.gvsig.compat.net.ICancellable cancel)
          The function of the DescribeFeatureType operation is to generate a schema description of feature types serviced by a WFS implementation.
 void getCapabilities(WFSStatus status, boolean override, org.gvsig.compat.net.ICancellable cancel)
          Every OGC Web Service (OWS), including a Web Feature Service, must have the ability to describe its capabilities by returning service metadata in response to a GetCapabilities request.
 WFSFeature getFeature(java.lang.String nameSpace, java.lang.String localName)
           
 java.io.File getFeature(WFSStatus status, boolean override, org.gvsig.compat.net.ICancellable cancel)
          The GetFeature operation allows retrieval of features from a web feature service.
 java.util.Hashtable getFeatures()
          Returns the features list
 WFSRequestInformation getLastWfsRequestInformation()
           
 WFSServiceInformation getServiceInformation()
          Gets the Service information included in the Capabilities
 java.lang.String getVersion()
           
 WFSRequestInformation getWFSRequestInformationAt(int index)
          Return the information of a request
 int getWFSRequestInformationCount()
           
 void lockFeature(WFSStatus status, boolean override, org.gvsig.compat.net.ICancellable cancel)
          Web connections are inherently stateless.
 void transaction(WFSStatus status, boolean override, org.gvsig.compat.net.ICancellable cancel)
          The Transaction operation is used to describe data transformation operations that are to be applied to web accessible feature instances.
 
Methods inherited from class org.gvsig.remoteclient.RemoteClient
getHost, getPort, getServiceName, getSubtype, getType, setHost, setPort, setServiceName, setSubtype, setType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WFSClient

public WFSClient(java.lang.String host)
          throws java.net.ConnectException,
                 java.io.IOException
Constructor. the parameter host, indicates the WFS host to connect.

Throws:
ConnectException,IOException
java.net.ConnectException
java.io.IOException

WFSClient

public WFSClient(java.lang.String host,
                 java.lang.String version)
          throws java.io.IOException
Throws:
java.io.IOException
Method Detail

getCapabilities

public void getCapabilities(WFSStatus status,
                            boolean override,
                            org.gvsig.compat.net.ICancellable cancel)
                     throws WFSException
Every OGC Web Service (OWS), including a Web Feature Service, must have the ability to describe its capabilities by returning service metadata in response to a GetCapabilities request.

Parameters:
status - WFS client status. Contains all the information to create the query
Throws:
WFSException

describeFeatureType

public java.io.File describeFeatureType(WFSStatus status,
                                        boolean override,
                                        org.gvsig.compat.net.ICancellable cancel)
                                 throws WFSException
The function of the DescribeFeatureType operation is to generate a schema description of feature types serviced by a WFS implementation. The schema descriptions define how a WFS implementation expects feature instances to be encoded on input (via Insert and Update requests) and how feature instances will be generated on output (in response to GetFeature and GetGmlObject requests).

Parameters:
status - WFS client status. Contains all the information to create the query
Throws:
WFSException

getFeature

public java.io.File getFeature(WFSStatus status,
                               boolean override,
                               org.gvsig.compat.net.ICancellable cancel)
                        throws WFSException
The GetFeature operation allows retrieval of features from a web feature service. A GetFeature request is processed by a WFS and when the value of the outputFormat attribute is set to text/gml a GML instance document, containing the result set, is returned to the client.

Parameters:
status - WFS client status. Contains all the information to create the query
Returns:
File GML File
Throws:
WFSException

transaction

public void transaction(WFSStatus status,
                        boolean override,
                        org.gvsig.compat.net.ICancellable cancel)
                 throws WFSException
The Transaction operation is used to describe data transformation operations that are to be applied to web accessible feature instances. A web feature service may process a Transaction operation directly or possibly translate it into the language of a target datastore to which it is connected and then have the datastore execute the transaction. When the transaction has been completed, a web feature service will generate an XML response document indicating the completion status of the transaction.

Parameters:
status - WFS client status. Contains all the information to create the query
Throws:
WFSException

lockFeature

public void lockFeature(WFSStatus status,
                        boolean override,
                        org.gvsig.compat.net.ICancellable cancel)
                 throws WFSException
Web connections are inherently stateless. As a consequence of this, the semantics of serializable transactions are not preserved. To understand the issue, consider an update operation. The client fetches a feature instance. The feature is then modified on the client side, and submitted back to the database via a Transaction request for update. Serializability is lost since there is nothing to guarantee that while the feature was being modified on the client side, another client did not come along and update that same feature in the database. One way to ensure serializability is to require that access to data be done in a mutually exclusive manner; that is while one transaction accesses a data item, no other transaction can modify the same data item. This can be accomplished by using locks that control access to the data. The purpose of the LockFeature operation is to expose a long term feature locking mechanism to ensure consistency. The lock is considered long term because network latency would make feature locks last relatively longer than native commercial database locks. The LockFeature operation is optional and does not need to be implemented for a WFS implementation to conform to this specification. If a WFS implements the LockFeature operation, this fact must be advertised in the capabilities document

Parameters:
status -
Throws:
WFSException

connect

public boolean connect(boolean override,
                       org.gvsig.compat.net.ICancellable cancel)

Checks the connection to de remote WFS and requests its capabilities.

Specified by:
connect in class RemoteClient

connect

public boolean connect(org.gvsig.compat.net.ICancellable cancel)

close

public void close()
Description copied from class: RemoteClient

Does ...

Specified by:
close in class RemoteClient

getVersion

public java.lang.String getVersion()

getServiceInformation

public WFSServiceInformation getServiceInformation()
Gets the Service information included in the Capabilities


getFeatures

public java.util.Hashtable getFeatures()
Returns the features list

Returns:

getFeature

public WFSFeature getFeature(java.lang.String nameSpace,
                             java.lang.String localName)

getLastWfsRequestInformation

public WFSRequestInformation getLastWfsRequestInformation()
Returns:
the lastWfsRequestInformation

getWFSRequestInformationCount

public int getWFSRequestInformationCount()
Returns:
the number requests

getWFSRequestInformationAt

public WFSRequestInformation getWFSRequestInformationAt(int index)
Return the information of a request

Parameters:
index - The position of the request
Returns:


Copyright © 2004-2013 gvSIG. All Rights Reserved.