org.geotools.data.postgis
Class VersionedPostgisDataStore

java.lang.Object
  extended by org.geotools.data.postgis.VersionedPostgisDataStore
All Implemented Interfaces:
DataAccess<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature>, DataStore, VersioningDataStore

public class VersionedPostgisDataStore
extends java.lang.Object
implements VersioningDataStore

Postgis datastore with versioning support. On the implementation level, this subclass basically acts as a mapper between the base class, that sees the data structures as how they really are, and the outside view, that hides versioning columns and extra versioning tables from feature types.

Assumptions made by the data store:

Since:
2.4
Author:
aaime

Field Summary
static java.lang.String DIRTYTYPES
          Key used to store the feature types touched by the current transaction
protected  org.opengis.filter.FilterFactory2 ff
          The filter factory used for all filter operations
protected  FeatureListenerManager listenerManager
          Manages listener lists for FeatureSource implementations
protected static java.util.logging.Logger LOGGER
          The logger for the postgis module.
static java.lang.String TBL_CHANGESETS
           
static java.lang.String TBL_TABLESCHANGED
           
static java.lang.String TBL_VERSIONEDTABLES
           
protected  java.util.Map versionedMap
          Holds boolean markers used to determine wheter a table is versioned or not (caching to increase speed since isVersioned() check is required in every other public API)
protected  org.geotools.data.postgis.WrappedPostgisDataStore wrapped
          The wrapped postgis datastore that we leverage for most operations
 
Fields inherited from interface org.geotools.data.VersioningDataStore
AUTHOR, MESSAGE
 
Constructor Summary
VersionedPostgisDataStore(javax.sql.DataSource dataSource)
           
VersionedPostgisDataStore(javax.sql.DataSource dataSource, java.lang.String namespace)
           
VersionedPostgisDataStore(javax.sql.DataSource dataSource, java.lang.String schema, java.lang.String namespace)
           
VersionedPostgisDataStore(javax.sql.DataSource dataSource, java.lang.String schema, java.lang.String namespace, int optimizeMode)
           
 
Method Summary
protected  void checkVersioningDataStructures()
          Makes sure the required versioning data structures are available in the database
 void createSchema(org.opengis.feature.simple.SimpleFeatureType featureType)
          Creates storage for a new featureType.
 void dispose()
          Disposes of this data store and releases any resource that it is using.
protected  void execute(java.sql.Statement st, java.lang.String sql)
          Logs the sql at info level, then executes the command
protected  java.sql.ResultSet executeQuery(java.sql.Statement st, java.lang.String sql)
          Logs the sql at info level, then executes the command
protected  JDBCDataStoreConfig getConfig()
           
 java.sql.Connection getConnection(Transaction t)
          Gets a connection for the provided transaction.
 FeatureReader<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> getFeatureReader(Query query, Transaction trans)
          Access a FeatureReader providing access to Feature information.
 FeatureSource<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> getFeatureSource(org.opengis.feature.type.Name typeName)
          Delegates to getFeatureSource(String) with name.getLocalPart()
 FeatureSource<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> getFeatureSource(java.lang.String typeName)
          Access a FeatureSource for typeName providing a high-level API.
 FeatureWriter<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> getFeatureWriter(java.lang.String typeName, org.opengis.filter.Filter filter, Transaction transaction)
          Access FeatureWriter for modification of existing DataStore contents.
 FeatureWriter<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> getFeatureWriter(java.lang.String typeName, Transaction transaction)
          Access FeatureWriter for modification of the DataStore typeName.
 FeatureWriter<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> getFeatureWriterAppend(java.lang.String typeName, Transaction transaction)
          Aquire a FeatureWriter for adding new content to a FeatureType.
protected  FeatureWriter<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> getFeatureWriterInternal(java.lang.String typeName, org.opengis.filter.Filter filter, Transaction transaction, boolean append)
          Returns either a standard feature writer, or a pure append feature writer
 FIDMapper getFIDMapper(java.lang.String tableName)
           
 ServiceInfo getInfo()
          Information about this service.
 long getLastRevision()
          Returns the last revision of the repository
 LockingManager getLockingManager()
          Retrieve a per featureID based locking service from this DataStore.
 ModifiedFeatureIds getModifiedFeatureFIDs(java.lang.String typeName, java.lang.String version1, java.lang.String version2, org.opengis.filter.Filter originalFilter, java.lang.String[] users, Transaction transaction)
          Returns a set of feature ids for features that where modified, created or deleted between version1 and version2 and that matched the specified filter at least in one revision between version1 and version2.
 java.lang.String[] getModifiedFeatureTypes(java.lang.String version1, java.lang.String version2)
          Returns a list of type names modified between version1 and version2, with the first version excluded.
 java.util.List<org.opengis.feature.type.Name> getNames()
          Returns the same list of names than getTypeNames() meaning the returned Names have no namespace set.
 org.opengis.feature.simple.SimpleFeatureType getSchema(org.opengis.feature.type.Name name)
          Delegates to getSchema(String) with name.getLocalPart()
 org.opengis.feature.simple.SimpleFeatureType getSchema(java.lang.String typeName)
          Retrieve FeatureType metadata by typeName.
 java.lang.String[] getTypeNames()
          Retrieves a list of of the available FeatureTypes.
static java.lang.String getVFCTableName(java.lang.String vfcTypeName)
          Given a versioned feature collection view name returns the base table name
static java.lang.String getVFCViewName(java.lang.String typeName)
          Given a type name returns the name of the versioned feature collection view associated to it
 FeatureSource<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> getView(Query query)
          Access a FeatureSource for Query providing a high-level API.
 boolean isVersioned(java.lang.String typeName)
          Returns true if the specified feature type is versioned, false otherwise
protected  boolean isVersioned(java.lang.String typeName, Transaction transaction)
          Checks wheter a type name is versioned or not.
 boolean isVersionedFeatureCollection(java.lang.String typeName)
           
 void setLooseBbox(boolean enabled)
           
 void setVersioned(java.lang.String typeName, boolean versioned, java.lang.String author, java.lang.String message)
          Alters the versioned state of a feature type
 void setWKBEnabled(boolean enabled)
           
protected  org.opengis.filter.Filter transformFidFilter(java.lang.String featureTypeName, org.opengis.filter.Filter filter)
          Takes a fid filter with external fids and turns it into a set of filters against internal feature type attributes, that is, an equivalent filter that can run against the internal, versioned feature type
 void updateSchema(org.opengis.feature.type.Name typeName, org.opengis.feature.simple.SimpleFeatureType featureType)
          Delegates to updateSchema(String, SimpleFeatureType) with name.getLocalPart()
 void updateSchema(java.lang.String typeName, org.opengis.feature.simple.SimpleFeatureType featureType)
          Used to force namespace and CS info into a persistent change.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGGER

protected static final java.util.logging.Logger LOGGER
The logger for the postgis module.


TBL_VERSIONEDTABLES

public static final java.lang.String TBL_VERSIONEDTABLES
See Also:
Constant Field Values

TBL_TABLESCHANGED

public static final java.lang.String TBL_TABLESCHANGED
See Also:
Constant Field Values

TBL_CHANGESETS

public static final java.lang.String TBL_CHANGESETS
See Also:
Constant Field Values

DIRTYTYPES

public static final java.lang.String DIRTYTYPES
Key used to store the feature types touched by the current transaction

See Also:
Constant Field Values

wrapped

protected org.geotools.data.postgis.WrappedPostgisDataStore wrapped
The wrapped postgis datastore that we leverage for most operations


versionedMap

protected java.util.Map versionedMap
Holds boolean markers used to determine wheter a table is versioned or not (caching to increase speed since isVersioned() check is required in every other public API)


ff

protected org.opengis.filter.FilterFactory2 ff
The filter factory used for all filter operations


listenerManager

protected FeatureListenerManager listenerManager
Manages listener lists for FeatureSource implementations

Constructor Detail

VersionedPostgisDataStore

public VersionedPostgisDataStore(javax.sql.DataSource dataSource,
                                 java.lang.String schema,
                                 java.lang.String namespace,
                                 int optimizeMode)
                          throws java.io.IOException
Throws:
java.io.IOException

VersionedPostgisDataStore

public VersionedPostgisDataStore(javax.sql.DataSource dataSource,
                                 java.lang.String schema,
                                 java.lang.String namespace)
                          throws java.io.IOException
Throws:
java.io.IOException

VersionedPostgisDataStore

public VersionedPostgisDataStore(javax.sql.DataSource dataSource,
                                 java.lang.String namespace)
                          throws java.io.IOException
Throws:
java.io.IOException

VersionedPostgisDataStore

public VersionedPostgisDataStore(javax.sql.DataSource dataSource)
                          throws java.io.IOException
Throws:
java.io.IOException
Method Detail

getConfig

protected JDBCDataStoreConfig getConfig()

getInfo

public ServiceInfo getInfo()
Description copied from interface: DataAccess
Information about this service.

This method offers access to a summary of header or metadata information describing the service.

Subclasses may return a specific ServiceInfo instance that has additional information (such as FilterCapabilities).

Specified by:
getInfo in interface DataAccess<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature>
Returns:
SeviceInfo

getTypeNames

public java.lang.String[] getTypeNames()
                                throws java.io.IOException
Description copied from interface: DataStore
Retrieves a list of of the available FeatureTypes.

This is simply a list of the FeatureType names as aquiring the actual FeatureType schemas may be expensive.

Warning: this list may not be unique - the types may be in separate namespaces.

If you need to worry about such things please consider the use of the Catalog and CatalogEntry interface - many DataStores support this. getTypeNames is really a convience method for a Catalog.iterator() where the name of each entry is returned.

Specified by:
getTypeNames in interface DataStore
Returns:
typeNames for available FeatureTypes.
Throws:
java.io.IOException

getSchema

public org.opengis.feature.simple.SimpleFeatureType getSchema(java.lang.String typeName)
                                                       throws java.io.IOException
Description copied from interface: DataStore
Retrieve FeatureType metadata by typeName.

Retrieves the Schema information as a FeatureType object.

Specified by:
getSchema in interface DataStore
Parameters:
typeName - typeName of requested FeatureType
Returns:
FeatureType for the provided typeName
Throws:
java.io.IOException - If typeName cannot be found

createSchema

public void createSchema(org.opengis.feature.simple.SimpleFeatureType featureType)
                  throws java.io.IOException
Description copied from interface: DataAccess
Creates storage for a new featureType.

The provided featureType we be accessable by the typeName provided by featureType.getTypeName().

Specified by:
createSchema in interface DataAccess<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature>
Parameters:
featureType - FetureType to add to DataStore
Throws:
java.io.IOException - If featureType cannot be created

updateSchema

public void updateSchema(java.lang.String typeName,
                         org.opengis.feature.simple.SimpleFeatureType featureType)
                  throws java.io.IOException
Description copied from interface: DataStore
Used to force namespace and CS info into a persistent change.

The provided featureType should completely cover the existing schema. All attributes should be accounted for and the typeName should match.

Suggestions:

Specified by:
updateSchema in interface DataStore
Throws:
java.io.IOException

getFeatureReader

public FeatureReader<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> getFeatureReader(Query query,
                                                                                                                             Transaction trans)
                                                                                                                      throws java.io.IOException
Description copied from interface: DataStore
Access a FeatureReader providing access to Feature information.

Filter is used as a low-level indication of constraints. (Implementations may resort to using a FilteredFeatureReader, or provide their own optimizations)

FeatureType provides a template for the returned FeatureReader

Transaction to externalize DataStore state on a per Transaction basis. The most common example is a JDBC datastore saving a Connection for use across several FeatureReader requests. Similarly a Shapefile reader may wish to redirect FeatureReader requests to a alternate filename over the course of a Transaction.

Notes For Implementing DataStore

Subclasses may need to retrieve additional attributes, beyond those requested by featureType.getAttributeTypes(), in order to correctly apply the filter.
These Additional attribtues should be not be returned by FeatureReader. Subclasses may use ReTypeFeatureReader to aid in acomplishing this.

Helper classes for implementing a FeatureReader (in order):

Sample use (not optimized):


 if (filter == Filter.EXCLUDE) {
      return new EmptyFeatureReader(featureType);
  }

  String typeName = featureType.getTypeName();
  FeatureType schema = getSchema( typeName );
  FeatureReader reader = new DefaultFeatureReader( getAttributeReaders(), schema );

  if (filter != Filter.INCLUDE) {
      reader = new FilteringFeatureReader(reader, filter);
  }

  if (transaction != Transaction.AUTO_COMMIT) {
      Map diff = state(transaction).diff(typeName);
      reader = new DiffFeatureReader(reader, diff);
  }

  if (!featureType.equals(reader.getFeatureType())) {
      reader = new ReTypeFeatureReader(reader, featureType);
  }
 return reader
 

Locking support does not need to be provided for FeatureReaders.

Specified by:
getFeatureReader in interface DataStore
Parameters:
query - Requested form of the returned Features and the filter used to constraints the results
trans - Transaction this query operates against
Returns:
FeatureReader Allows Sequential Processing of featureType
Throws:
java.io.IOException

getLockingManager

public LockingManager getLockingManager()
Description copied from interface: DataStore
Retrieve a per featureID based locking service from this DataStore.

It is common to return an instanceof InProcessLockingManager for DataStores that do not provide native locking.

AbstractFeatureLocking makes use of this service to provide locking support. You are not limitied by this implementation and may simply return null for this value.

Specified by:
getLockingManager in interface DataStore
Returns:
DataStores may return null, if the handling locking in another fashion.

getFeatureWriter

public FeatureWriter<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> getFeatureWriter(java.lang.String typeName,
                                                                                                                             Transaction transaction)
                                                                                                                      throws java.io.IOException
Description copied from interface: DataStore
Access FeatureWriter for modification of the DataStore typeName.

FeatureWriters will need to be limited to the FeatureTypes defined by the DataStore, the easiest way to express this limitation is to the FeatureType by a provided typeName.

The returned FeatureWriter will return false for getNext() when it reaches the end of the Query.

Specified by:
getFeatureWriter in interface DataStore
Parameters:
typeName - Indicates featureType to be modified
transaction - Transaction to operates against
Returns:
FeatureReader Allows Sequential Processing of featureType
Throws:
java.io.IOException

getFeatureWriter

public FeatureWriter<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> getFeatureWriter(java.lang.String typeName,
                                                                                                                             org.opengis.filter.Filter filter,
                                                                                                                             Transaction transaction)
                                                                                                                      throws java.io.IOException
Description copied from interface: DataStore
Access FeatureWriter for modification of existing DataStore contents.

To limit FeatureWriter to the FeatureTypes defined by this DataStore, typeName is used to indicate FeatureType. The resulting feature writer will allow modifications against the same FeatureType provided by getSchema( typeName )

The FeatureWriter will provide access to the existing contents of the FeatureType referenced by typeName. The provided filter will be used to skip over Features as required.

Notes For Implementing DataStore

The returned FeatureWriter does not support the addition of new Features to FeatureType (it would need to police your modifications to agree with filer). As such it will return false for getNext() when it reaches the end of the Query and NoSuchElementException when next() is called.

Helper classes for implementing a FeatureWriter (in order):

  • InProcessLockingManager.checkedWriter( writer ) - provides a check against locks before allowing modification
  • FilteringFeatureWriter - filtering support for FeatureWriter (does not allow new content)
  • DiffFeatureWriter - In-Process Transaction Support (see TransactionStateDiff)
  • EmptyFeatureWriter - provides no content for Filter.EXCLUDE optimizations
  • Specified by:
    getFeatureWriter in interface DataStore
    Parameters:
    typeName - Indicates featureType to be modified
    filter - constraints used to limit the modification
    transaction - Transaction this query operates against
    Returns:
    FeatureWriter Allows Sequential Modification of featureType
    Throws:
    java.io.IOException

    getFeatureWriterInternal

    protected FeatureWriter<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> getFeatureWriterInternal(java.lang.String typeName,
                                                                                                                                            org.opengis.filter.Filter filter,
                                                                                                                                            Transaction transaction,
                                                                                                                                            boolean append)
                                                                                                                                     throws java.io.IOException,
                                                                                                                                            DataSourceException
    Returns either a standard feature writer, or a pure append feature writer

    Throws:
    java.io.IOException
    DataSourceException

    getFeatureWriterAppend

    public FeatureWriter<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> getFeatureWriterAppend(java.lang.String typeName,
                                                                                                                                       Transaction transaction)
                                                                                                                                throws java.io.IOException
    Description copied from interface: DataStore
    Aquire a FeatureWriter for adding new content to a FeatureType.

    This FeatureWriter will return false for hasNext(), however next() may be used to aquire new Features that may be writen out to add new content.

    Specified by:
    getFeatureWriterAppend in interface DataStore
    Parameters:
    typeName - Indicates featureType to be modified
    transaction - Transaction to operates against
    Returns:
    FeatureWriter that may only be used to append new content
    Throws:
    java.io.IOException

    getFeatureSource

    public FeatureSource<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> getFeatureSource(java.lang.String typeName)
                                                                                                                          throws java.io.IOException
    Description copied from interface: DataStore
    Access a FeatureSource for typeName providing a high-level API.

    The resulting FeatureSource may implment more functionality:

    
    
     FeatureSource fsource = dataStore.getFeatureSource( "roads" );
     FeatureStore fstore = null;
     if( fsource instanceof FeatureLocking ){
         fstore = (FeatureStore) fs;
     }
     else {
         System.out.println("We do not have write access to roads");
     }
     
     

    Specified by:
    getFeatureSource in interface DataStore
    Returns:
    FeatureSource (or subclass) providing operations for typeName
    Throws:
    java.io.IOException

    getView

    public FeatureSource<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> getView(Query query)
                                                                                                                 throws java.io.IOException,
                                                                                                                        SchemaException
    Description copied from interface: DataStore
    Access a FeatureSource for Query providing a high-level API.

    The provided Query does not need to completely cover the existing schema for Query.getTypeName(). The result will mostly likely only be a FeatureSource and probably wont' allow write access by the FeatureStore method.

    By using Query we allow support for reprojection, in addition to overriding the CoordinateSystem used by the native FeatureType.

    We may wish to limit this method to only support Queries using Filter.EXCLUDE.

    Update - GeoServer has an elegatent implementation of this functionality that we could steal. GeoServerFeatureSource, GeoServerFeatureStore and GeoServerFeatureLocking serve as a working prototype.

    Specified by:
    getView in interface DataStore
    Parameters:
    query - Query.getTypeName() locates FeatureType being viewed
    Returns:
    FeatureSource providing operations for featureType
    Throws:
    java.io.IOException - If FeatureSource is not available
    SchemaException - If fetureType is not covered by existing schema

    isVersioned

    public boolean isVersioned(java.lang.String typeName)
                        throws java.io.IOException
    Returns true if the specified feature type is versioned, false otherwise

    Specified by:
    isVersioned in interface VersioningDataStore
    Parameters:
    typeName -
    Returns:
    Throws:
    java.io.IOException

    setVersioned

    public void setVersioned(java.lang.String typeName,
                             boolean versioned,
                             java.lang.String author,
                             java.lang.String message)
                      throws java.io.IOException
    Alters the versioned state of a feature type

    Specified by:
    setVersioned in interface VersioningDataStore
    Parameters:
    typeName - the type name that must be changed
    versioned - if true, the type gets version enabled, if false versioning is disabled
    t - the transaction used to performe version enabling. It shall contain user and commit message as properties.
    Throws:
    java.io.IOException

    isVersioned

    protected boolean isVersioned(java.lang.String typeName,
                                  Transaction transaction)
                           throws java.io.IOException
    Checks wheter a type name is versioned or not.

    Parameters:
    typeName - the feature type to check
    transaction - a transaction, or null if you don't have one (use null to avoid a new revision being created for this operation)
    Returns:
    true if the type is versioned, false otherwise
    Throws:
    java.io.IOException

    getConnection

    public java.sql.Connection getConnection(Transaction t)
                                      throws java.io.IOException
    Gets a connection for the provided transaction.

    Throws:
    java.io.IOException

    isVersionedFeatureCollection

    public boolean isVersionedFeatureCollection(java.lang.String typeName)
                                         throws java.io.IOException
    Throws:
    java.io.IOException

    setWKBEnabled

    public void setWKBEnabled(boolean enabled)
    Parameters:
    enabled -
    See Also:
    PostgisDataStore.setWKBEnabled(boolean)

    setLooseBbox

    public void setLooseBbox(boolean enabled)
    Parameters:
    enabled -
    See Also:
    PostgisDataStore.setWKBEnabled(boolean)

    getFIDMapper

    public FIDMapper getFIDMapper(java.lang.String tableName)
                           throws java.io.IOException
    Throws:
    java.io.IOException

    getLastRevision

    public long getLastRevision()
                         throws java.io.IOException
    Returns the last revision of the repository

    Returns:
    Throws:
    java.io.IOException

    getModifiedFeatureTypes

    public java.lang.String[] getModifiedFeatureTypes(java.lang.String version1,
                                                      java.lang.String version2)
                                               throws java.io.IOException
    Returns a list of type names modified between version1 and version2, with the first version excluded.

    Parameters:
    version1 - the first version
    version2 - the second version, which may be null, if you need to refer the latest version
    Returns:
    an array or type names, eventually empty, never null
    Throws:
    java.io.IOException

    getModifiedFeatureFIDs

    public ModifiedFeatureIds getModifiedFeatureFIDs(java.lang.String typeName,
                                                     java.lang.String version1,
                                                     java.lang.String version2,
                                                     org.opengis.filter.Filter originalFilter,
                                                     java.lang.String[] users,
                                                     Transaction transaction)
                                              throws java.io.IOException
    Returns a set of feature ids for features that where modified, created or deleted between version1 and version2 and that matched the specified filter at least in one revision between version1 and version2.
    If called on an unversioned feature type, will return empty Sets.

    The semantics is a little complex, so here is a more detailed explaination:

    The result is composed of three sets of feature ids: The following graph illustrates feature matching and set destination. Each line represents a feature lifeline, with different symbols for filter matched states, unmatched states, state creation, expiration, and lack of feature existance.
                             v1                         v2
                             |                          |
                    f1 ======]..........................|........... Not returned
                    f2 ======][-------------------------|----------- Not returned     
                    f3 ======|==].......................|........... Returned (deleted)
                    f4 ======|==][----------------------|---]....... Returned (modified)
                    f5 ......|.[=======]................|........... Returned (created/deleted)
                    f5 ......[=========]................|........... Returned (deleted)
                    f5 ......[-------------------][=====|====]...... Returned (modified)
                    f6 [-----|----][=============][-----|----------- Returned (modified)
     
    Legend:

    Parameters:
    version1 - - the first revision
    version2 - - the second revision, or null if you want the diff between version1 and current
    filter - a filter to limit the features that must be taken into consideration
    users - an eventual list of user ids that can be used to further filter the features, only features touched by any of these users will be
    transaction -
    Throws:
    java.io.IOException
    IllegalAttributeException
    java.util.NoSuchElementException

    checkVersioningDataStructures

    protected void checkVersioningDataStructures()
                                          throws java.io.IOException
    Makes sure the required versioning data structures are available in the database

    Throws:
    java.io.IOException

    getVFCViewName

    public static java.lang.String getVFCViewName(java.lang.String typeName)
    Given a type name returns the name of the versioned feature collection view associated to it

    Parameters:
    typeName -
    Returns:

    getVFCTableName

    public static java.lang.String getVFCTableName(java.lang.String vfcTypeName)
                                            throws java.io.IOException
    Given a versioned feature collection view name returns the base table name

    Parameters:
    vfcTypeName -
    Returns:
    Throws:
    java.io.IOException

    execute

    protected void execute(java.sql.Statement st,
                           java.lang.String sql)
                    throws java.sql.SQLException
    Logs the sql at info level, then executes the command

    Parameters:
    st -
    sql -
    Throws:
    java.sql.SQLException

    executeQuery

    protected java.sql.ResultSet executeQuery(java.sql.Statement st,
                                              java.lang.String sql)
                                       throws java.sql.SQLException
    Logs the sql at info level, then executes the command

    Parameters:
    st -
    sql -
    Throws:
    java.sql.SQLException

    transformFidFilter

    protected org.opengis.filter.Filter transformFidFilter(java.lang.String featureTypeName,
                                                           org.opengis.filter.Filter filter)
                                                    throws java.io.IOException,
                                                           FactoryRegistryException
    Takes a fid filter with external fids and turns it into a set of filters against internal feature type attributes, that is, an equivalent filter that can run against the internal, versioned feature type

    Parameters:
    featureTypeName -
    filter -
    Returns:
    Throws:
    java.io.IOException
    FactoryRegistryException

    dispose

    public void dispose()
    Description copied from interface: DataAccess
    Disposes of this data store and releases any resource that it is using.

    A DataStore cannot be used after dispose has been called, neither can any data access object it helped create, such as FeatureReader, FeatureSource or FeatureCollection.

    This operation can be called more than once without side effects.

    There is no thread safety assurance associated with this method. For example, client code will have to make sure this method is not called while retrieving/saving data from/to the storage, or be prepared for the consequences.

    Specified by:
    dispose in interface DataAccess<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature>

    getFeatureSource

    public FeatureSource<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> getFeatureSource(org.opengis.feature.type.Name typeName)
                                                                                                                          throws java.io.IOException
    Delegates to getFeatureSource(String) with name.getLocalPart()

    Specified by:
    getFeatureSource in interface DataAccess<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature>
    Returns:
    Access to the named resource being made available
    Throws:
    java.io.IOException
    Since:
    2.5
    See Also:
    DataAccess.getFeatureSource(Name)

    getNames

    public java.util.List<org.opengis.feature.type.Name> getNames()
                                                           throws java.io.IOException
    Returns the same list of names than getTypeNames() meaning the returned Names have no namespace set.

    Specified by:
    getNames in interface DataAccess<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature>
    Returns:
    Names of the available contents.
    Throws:
    java.io.IOException
    Since:
    2.5
    See Also:
    DataAccess.getNames()

    getSchema

    public org.opengis.feature.simple.SimpleFeatureType getSchema(org.opengis.feature.type.Name name)
                                                           throws java.io.IOException
    Delegates to getSchema(String) with name.getLocalPart()

    Specified by:
    getSchema in interface DataAccess<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature>
    Parameters:
    name - Type name a the resource from getNames()
    Returns:
    Description of the FeatureType being made avaialble
    Throws:
    java.io.IOException
    Since:
    2.5
    See Also:
    DataAccess.getSchema(Name)

    updateSchema

    public void updateSchema(org.opengis.feature.type.Name typeName,
                             org.opengis.feature.simple.SimpleFeatureType featureType)
                      throws java.io.IOException
    Delegates to updateSchema(String, SimpleFeatureType) with name.getLocalPart()

    Specified by:
    updateSchema in interface DataAccess<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature>
    Throws:
    java.io.IOException - if the operation failed
    Since:
    2.5
    See Also:
    DataAccess.getFeatureSource(Name)


    Copyright © 1996-2010 Geotools. All Rights Reserved.