Class ContentFeatureStore

Object
ContentFeatureSource
ContentFeatureStore
All Implemented Interfaces:
FeatureLocking<SimpleFeatureType,SimpleFeature>, FeatureSource<SimpleFeatureType,SimpleFeature>, FeatureStore<SimpleFeatureType,SimpleFeature>, SimpleFeatureLocking, SimpleFeatureSource, SimpleFeatureStore
Direct Known Subclasses:
CSVFeatureStore, GeoJSONFeatureStore, JDBCFeatureStore, MemoryFeatureStore, MongoFeatureStore, PropertyFeatureStore

public abstract class ContentFeatureStore extends ContentFeatureSource implements SimpleFeatureStore, SimpleFeatureLocking
Abstract implementation of FeatureStore.

List its base class ContentFeatureSource, this feature store works off of operations provided by FeatureCollection.

The addFeatures(SimpleFeatureCollection) method is used to add features to the feature store. The method should return the "persistent" feature id's which are generated after the feature has been added to persistent storage. Often the persistent fid is different from the fid specified by the actual feature being inserted. For this reason Property.getUserData() is used to report back persistent fids. It is up to the implementor of the feature collection to report this value back after a feature has been inserted. As an example, consider an implementation of FeatureCollection#add(Object).

  boolean add( Object o ) {
    SimpleFeature feature = (SimpleFeature) o;

    //1.add the feature to storage
    ...

    //2. derive the persistent fid
    String fid = ...;

    //3. set the user data
    feature.getUserData().put( "fid", fid );

  }
 
Author:
Justin Deoliveira, The Open Planning Project