org.gvsig.remoteclient.wfs
Class WFSProtocolHandler

java.lang.Object
  extended by org.gvsig.remoteclient.ogc.OGCProtocolHandler
      extended by org.gvsig.remoteclient.wfs.WFSProtocolHandler
Direct Known Subclasses:
WFSProtocolHandler1_0_0

public abstract class WFSProtocolHandler
extends OGCProtocolHandler

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

Field Summary
protected  java.lang.String currentFeature
           
protected  java.util.Hashtable features
           
protected  WFSServiceInformation serviceInfo
          WFS metadata
protected  java.util.ArrayList wfsRequestInformations
          This class contains all the data that the library is able to retrieve of the server for all the requests.
 
Fields inherited from class org.gvsig.remoteclient.ogc.OGCProtocolHandler
downloader, host, name, port, version
 
Constructor Summary
WFSProtocolHandler()
           
 
Method Summary
 void addLastWfsRequestInformation(WFSRequestInformation wfsRequestInformation)
          Adds a new WFSRequestInformation
static java.lang.String buildCapabilitiesSuitableVersionRequest(java.lang.String _host, java.lang.String _version)
          Builds the GetCapabilitiesRequest according to the OGC WFS Specifications without a VERSION, to get the highest version than a WFS supports.
protected abstract  WFSDescribeFeatureTypeRequest createDescribeFeatureTypeRequest(WFSStatus status)
           
protected abstract  WFSGetFeatureRequest createGetFeatureRequest(WFSStatus status)
           
protected abstract  WFSTLockFeatureRequest createLockFeatureRequest(WFSStatus status)
           
protected abstract  WFSTransactionRequest createTransactionRequest(WFSStatus status)
           
 java.io.File describeFeatureType(WFSStatus status, boolean override, org.gvsig.compat.net.ICancellable cancel)
          Builds a describeFeatureType request that is sent to the WFS the response will be parse to extract the data needed by the WFS client
 void getCapabilities(WFSStatus status, boolean override, org.gvsig.compat.net.ICancellable cancel)
          Builds a GetCapabilities request that is sent to the WFS the response will be parse to extract the data needed by the WFS client
 java.lang.String getCurrentFeature()
           
 java.io.File getFeature(WFSStatus status, boolean override, org.gvsig.compat.net.ICancellable cancel)
          Builds a getFeature request that is sent to the WFS the response will be parse to extract the data needed by the WFS client
 java.util.Hashtable getFeatures()
           
 WFSRequestInformation getLastWfsRequestInformation()
           
 OGCServiceInformation getServiceInformation()
           
 void lockFeature(WFSStatus status, boolean override, org.gvsig.compat.net.ICancellable cancel)
          Builds a lockFeature request that is sent to the WFS the response will be parse to extract the data needed by the WFS client
protected abstract  boolean parseGetFeature(java.io.File f, java.lang.String nameSpace)
          parses the data retrieved by the GetFeature XML document.
protected abstract  boolean parseLockFeature(java.io.File f, java.lang.String nameSpace, WFSStatus status)
          parses the data retrieved by the LockFeature operation
protected  void parseNamespaces(org.kxml2.io.KXmlParser parser)
          It parses the attributes of the current KXMLParser and add the new namespaces to the service information
protected abstract  boolean parseTransaction(java.io.File f, WFSStatus status)
          parses the data retrieved by the transaction operation
 void setCurrentFeature(java.lang.String currentFeature)
           
 void transaction(WFSStatus status, boolean override, org.gvsig.compat.net.ICancellable cancel)
          Builds a transaction request that is sent to the WFS the response will be parse to extract the data needed by the WFS client
 
Methods inherited from class org.gvsig.remoteclient.ogc.OGCProtocolHandler
addOperationByAttribute, fileToBytes, getHost, getName, getPort, getSymbol, getVersion, parseCapabilities, parseHTTPTag, parserDcpType, setHost, setName, setPort, setVersion
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serviceInfo

protected WFSServiceInformation serviceInfo
WFS metadata


features

protected java.util.Hashtable features

currentFeature

protected java.lang.String currentFeature

wfsRequestInformations

protected java.util.ArrayList wfsRequestInformations
This class contains all the data that the library is able to retrieve of the server for all the requests.

Constructor Detail

WFSProtocolHandler

public WFSProtocolHandler()
Method Detail

getCapabilities

public void getCapabilities(WFSStatus status,
                            boolean override,
                            org.gvsig.compat.net.ICancellable cancel)
                     throws WFSException

Builds a GetCapabilities request that is sent to the WFS the response will be parse to extract the data needed by the WFS client

Throws:
WFSException

buildCapabilitiesSuitableVersionRequest

public static java.lang.String buildCapabilitiesSuitableVersionRequest(java.lang.String _host,
                                                                       java.lang.String _version)
Builds the GetCapabilitiesRequest according to the OGC WFS Specifications without a VERSION, to get the highest version than a WFS supports.


describeFeatureType

public java.io.File describeFeatureType(WFSStatus status,
                                        boolean override,
                                        org.gvsig.compat.net.ICancellable cancel)
                                 throws WFSException

Builds a describeFeatureType request that is sent to the WFS the response will be parse to extract the data needed by the WFS client

Parameters:
status - WFS client status. Contains all the information to create the query. In this case, the only the feature name is needed.
Throws:
WFSException

getFeature

public java.io.File getFeature(WFSStatus status,
                               boolean override,
                               org.gvsig.compat.net.ICancellable cancel)
                        throws WFSException

Builds a getFeature request that is sent to the WFS the response will be parse to extract the data needed by the WFS client

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

parseGetFeature

protected abstract boolean parseGetFeature(java.io.File f,
                                           java.lang.String nameSpace)
                                    throws WFSException
parses the data retrieved by the GetFeature XML document. It is used just to find errors

Throws:
WFSException

transaction

public void transaction(WFSStatus status,
                        boolean override,
                        org.gvsig.compat.net.ICancellable cancel)
                 throws WFSException

Builds a transaction request that is sent to the WFS the response will be parse to extract the data needed by the WFS client

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

parseTransaction

protected abstract boolean parseTransaction(java.io.File f,
                                            WFSStatus status)
                                     throws WFSException
parses the data retrieved by the transaction operation

Parameters:
f - The retrieved file
nameSpace - The namespace
Throws:
WFSException

lockFeature

public void lockFeature(WFSStatus status,
                        boolean override,
                        org.gvsig.compat.net.ICancellable cancel)
                 throws WFSException

Builds a lockFeature request that is sent to the WFS the response will be parse to extract the data needed by the WFS client

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

parseLockFeature

protected abstract boolean parseLockFeature(java.io.File f,
                                            java.lang.String nameSpace,
                                            WFSStatus status)
                                     throws WFSException
parses the data retrieved by the LockFeature operation

Throws:
WFSException

getFeatures

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

getCurrentFeature

public java.lang.String getCurrentFeature()
Returns:
Returns the currentFeature.

setCurrentFeature

public void setCurrentFeature(java.lang.String currentFeature)
Parameters:
currentFeature - The currentFeature to set.

parseNamespaces

protected void parseNamespaces(org.kxml2.io.KXmlParser parser)
It parses the attributes of the current KXMLParser and add the new namespaces to the service information

Parameters:
parser - The KXML parser

getServiceInformation

public OGCServiceInformation getServiceInformation()
Specified by:
getServiceInformation in class OGCProtocolHandler

createDescribeFeatureTypeRequest

protected abstract WFSDescribeFeatureTypeRequest createDescribeFeatureTypeRequest(WFSStatus status)
Parameters:
status - The WFS status
protocolHandler - The handler to parse the requests
Returns:
an object to send the DescribeFeatureType requests

createGetFeatureRequest

protected abstract WFSGetFeatureRequest createGetFeatureRequest(WFSStatus status)
Parameters:
status - The WFS status
protocolHandler - The handler to parse the requests
Returns:
an object to send the GetFeature requests

createLockFeatureRequest

protected abstract WFSTLockFeatureRequest createLockFeatureRequest(WFSStatus status)
Parameters:
status - The WFS status
protocolHandler - The handler to parse the requests
Returns:
an object to send the LockFeature requests

createTransactionRequest

protected abstract WFSTransactionRequest createTransactionRequest(WFSStatus status)
Parameters:
status - The WFS status
protocolHandler - The handler to parse the requests
Returns:
an object to send the Transaction request

addLastWfsRequestInformation

public void addLastWfsRequestInformation(WFSRequestInformation wfsRequestInformation)
Adds a new WFSRequestInformation

Parameters:
wfsRequestInformation -

getLastWfsRequestInformation

public WFSRequestInformation getLastWfsRequestInformation()
Returns:
the lastWfsRequestInformation


Copyright © 2004-2013 gvSIG. All Rights Reserved.