org.deegree_impl.services.wfs.shape
Class ShapeDataStore

java.lang.Object
  extended byorg.deegree_impl.services.wfs.AbstractDataStore
      extended byorg.deegree_impl.services.wfs.shape.ShapeDataStore
All Implemented Interfaces:
DataStore, java.util.EventListener, Handler

public class ShapeDataStore
extends AbstractDataStore

The class provides reading and writing access to ESRI shapefiles. The access is capsulated within the query and transaction mechanism described at the OGC WFS specifications.

The data store uses a cache for keeping features once read from a shapefile in memory to provide a much faster access to them. The cache can be configured through the configuration XML-document that also contains the names and locations of the shapes handled by an instance of the ShapeDataStore.

Version:
$Revision: 1.29 $ $Date: 2004/06/07 11:49:35 $
Author:
Andreas Poth, Markus Schneider

Nested Class Summary
private  class ShapeDataStore.CDescribeFeatureType
          inner interface defining the processing of a DescribeFeatureType request
private  class ShapeDataStore.CGetFeature
          inner interface defining the processing of a getFeature request
(package private)  class ShapeDataStore.CGetFeatureWithLock
          class defining the processing of a getFeature request
private  class ShapeDataStore.CLockFeature
          inner interface defining the processing of a lockFeature request
private  class ShapeDataStore.CTransaction
          inner interface defining the processing of a transaction request
 
Field Summary
protected static Cache_Impl cache
           
 
Fields inherited from class org.deegree_impl.services.wfs.AbstractDataStore
config, pool
 
Constructor Summary
ShapeDataStore(java.net.URL config)
          Creates a new ShapeDataStore object.
 
Method Summary
 void describeFeatureType(WFSDescribeFeatureTypeRequest request)
          returns the describtion of one or more feature types
 void getFeature(WFSGetFeatureRequest request)
          returns the features that matches the submitted request
 void getFeatureWithLock(WFSGetFeatureWithLockRequest request)
          same as getFeature(..)
private  int[] getShapeIds(ShapeFile sf, FeatureType ft, Filter filter, int startPosition, int maxFeatures)
           
 void lockFeature(WFSLockFeatureRequest request)
          performs the locking/unlocking of one or more features.
private  Feature recreateFeature(Feature feature, FeatureType featureType)
          recreates the passed org.deegree.model.feature.Feature by performing a mapping between shapefile/dbase property names and user defined property names.
private  FeatureType recreateFeatureType(FeatureType featureType, FeatureType ft)
          recreates the passed org.deegree.model.feature.FeatureType by performing a mapping between shapefile/dbase property names and user defined property names.
 void transaction(WFSTransactionRequest request)
          performs a transaction against the data store.
 
Methods inherited from class org.deegree_impl.services.wfs.AbstractDataStore
fireResponse, getConfiguration, getConnectionPool, handleRequest, handleResponse, isInterested, isKnownFeatureType, registerFeatureType, registerHandler, removeFeatureType, removeHandler
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cache

protected static Cache_Impl cache
Constructor Detail

ShapeDataStore

public ShapeDataStore(java.net.URL config)
               throws DataStoreException
Creates a new ShapeDataStore object.

Parameters:
config -
Throws:
DataStoreException
Method Detail

describeFeatureType

public void describeFeatureType(WFSDescribeFeatureTypeRequest request)
returns the describtion of one or more feature types

Parameters:
request - conainting the list of feature types that should be described

getFeature

public void getFeature(WFSGetFeatureRequest request)
returns the features that matches the submitted request

Parameters:
request - containing the request for zero, one or more features. The request, may contains a filter that describes the request more detailed

getFeatureWithLock

public void getFeatureWithLock(WFSGetFeatureWithLockRequest request)
same as getFeature(..) but locking the feature during processing.

Parameters:
request - containing the request for zero, one or more features. The request, may contains a filter that describes the request more detailed.
See Also:
getFeature(WFSGetFeatureRequest)

transaction

public void transaction(WFSTransactionRequest request)
performs a transaction against the data store. This could be an update, an insert or a delete of one or more features.

Parameters:
request - containing the transaction instruction(s)

lockFeature

public void lockFeature(WFSLockFeatureRequest request)
performs the locking/unlocking of one or more features.

Parameters:
request - the features that should be (un)locked

getShapeIds

private int[] getShapeIds(ShapeFile sf,
                          FeatureType ft,
                          Filter filter,
                          int startPosition,
                          int maxFeatures)
                   throws java.lang.Exception
Throws:
java.lang.Exception

recreateFeatureType

private FeatureType recreateFeatureType(FeatureType featureType,
                                        FeatureType ft)
recreates the passed org.deegree.model.feature.FeatureType by performing a mapping between shapefile/dbase property names and user defined property names.

Parameters:
featureType - feature type to be re-created with new property names
ft - feature type configuration containing mapping informations
Returns:
feature type with new (mapped) property names

recreateFeature

private Feature recreateFeature(Feature feature,
                                FeatureType featureType)
recreates the passed org.deegree.model.feature.Feature by performing a mapping between shapefile/dbase property names and user defined property names.

Parameters:
feature - feature to be assigend with a new feature type
featureType - new feature type of the re-created feature
Returns:
feature with renamed properties