org.geotools.data
Interface VersioningFeatureSource

All Superinterfaces:
FeatureSource<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature>
All Known Subinterfaces:
VersioningFeatureLocking, VersioningFeatureStore
All Known Implementing Classes:
VersionedPostgisFeatureStore

public interface VersioningFeatureSource
extends FeatureSource<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature>

Extension to feature source to provide the read only methods needed to work against a versioned data store.

Thought a read only versioned data store does not make sense, it may happen that a VersioningFeatureSource gets returned, for instance, because of limited authorizations from the caller code.

Author:
Andrea Aime, TOPP TODO: this shall be moved in a more generic module (api?) once the interfaces are good

Method Summary
 FeatureDiffReader getDifferences(java.lang.String fromVersion, java.lang.String toVersion, org.opengis.filter.Filter filter, java.lang.String[] userIds)
          Returns a feature difference reader providing the changes occurred on filtered features between the two specified versions
 FeatureCollection<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> getLog(java.lang.String fromVersion, java.lang.String toVersion, org.opengis.filter.Filter filter, java.lang.String[] userIds, int maxRows)
          Returns a log of changes performed between fromVersion and toVersion against the features matched by the specified filter.
 FeatureCollection<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> getVersionedFeatures()
          Returns the same features as FeatureSource.getFeatures() but providing more attributes, namely, revision, author and date of the version.
 FeatureCollection<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> getVersionedFeatures(org.opengis.filter.Filter f)
          Returns the same features as FeatureSource.getFeatures(Filter) but providing more attributes, namely, revision, author and date of the version.
 FeatureCollection<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> getVersionedFeatures(Query q)
          Returns the same features as FeatureSource.getFeatures(Query) but providing more attributes, namely, revision, author and date of the version.
 
Methods inherited from interface org.geotools.data.FeatureSource
addFeatureListener, getBounds, getBounds, getCount, getDataStore, getFeatures, getFeatures, getFeatures, getInfo, getName, getQueryCapabilities, getSchema, getSupportedHints, removeFeatureListener
 

Method Detail

getLog

FeatureCollection<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> getLog(java.lang.String fromVersion,
                                                                                                                java.lang.String toVersion,
                                                                                                                org.opengis.filter.Filter filter,
                                                                                                                java.lang.String[] userIds,
                                                                                                                int maxRows)
                                                                                                                throws java.io.IOException
Returns a log of changes performed between fromVersion and toVersion against the features matched by the specified filter.

This is equivalent to gathering the ids of features changed between the two versions and matching the filter, getting a list of revision involving those feaures between fromVersion and toVersion, and then query VersionedPostgisDataStore.TBL_CHANGESETS against these revision numbers.

Parameters:
fromVersion - the start revision
toVersion - the end revision, may be null to imply the latest one
filter - will match features whose log will be reported *
users - limits the features whose log will be returned, by catching only those that have been modified by at least one of the specified users. May be null to avoid user filtering.
maxRows - the maximum number of log rows returned from this call
Returns:
a feature collection of the logs, sorted on revision, descending
Throws:
java.io.IOException

getDifferences

FeatureDiffReader getDifferences(java.lang.String fromVersion,
                                 java.lang.String toVersion,
                                 org.opengis.filter.Filter filter,
                                 java.lang.String[] userIds)
                                 throws java.io.IOException
Returns a feature difference reader providing the changes occurred on filtered features between the two specified versions

Parameters:
fromVersion - the start version
toVersion - the end version, may be null to imply the latest one
filter - matches features whose differences will be reported *
users - limits the features whose diff will be returned, by catching only those that have been modified by at least one of the specified users. May be null to avoid user filtering.
Returns:
a difference reader
Throws:
java.io.IOException

getVersionedFeatures

FeatureCollection<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> getVersionedFeatures(Query q)
                                                                                                                              throws java.io.IOException
Returns the same features as FeatureSource.getFeatures(Query) but providing more attributes, namely, revision, author and date of the version.

Returns:
Throws:
java.io.IOException

getVersionedFeatures

FeatureCollection<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> getVersionedFeatures(org.opengis.filter.Filter f)
                                                                                                                              throws java.io.IOException
Returns the same features as FeatureSource.getFeatures(Filter) but providing more attributes, namely, revision, author and date of the version.

Returns:
Throws:
java.io.IOException

getVersionedFeatures

FeatureCollection<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> getVersionedFeatures()
                                                                                                                              throws java.io.IOException
Returns the same features as FeatureSource.getFeatures() but providing more attributes, namely, revision, author and date of the version.

Returns:
Throws:
java.io.IOException


Copyright © 1996-2010 Geotools. All Rights Reserved.