Java Doc for VersionedPostgisDataStore.java in  » GIS » GeoTools-2.4.1 » org » geotools » data » postgis » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » GIS » GeoTools 2.4.1 » org.geotools.data.postgis 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.geotools.data.postgis.VersionedPostgisDataStore

VersionedPostgisDataStore
public class VersionedPostgisDataStore implements VersioningDataStore(Code)
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:

  • There is a primary key in tables that need to be turned into versioned ones
  • Primary key columns are mapped in the FID mapper.

author:
   aaime
since:
   2.4


Field Summary
final public static  StringAUTHOR
    
final public static  StringDIRTYTYPES
    
final protected static  LoggerLOGGER
     The logger for the postgis module.
final public static  StringMESSAGE
    
final static  StringREVISION
    
final static  Class[]SUPPORTED_FID_MAPPERS
    
final public static  StringTBL_CHANGESETS
    
final public static  StringTBL_TABLESCHANGED
    
final public static  StringTBL_VERSIONEDTABLES
    
final static  StringVERSION
    
protected  FeatureListenerManagerlistenerManager
    
protected  MapversionedMap
    
protected  WrappedPostgisDataStorewrapped
    

Constructor Summary
public  VersionedPostgisDataStore(DataSource dataSource, String schema, String namespace, int optimizeMode)
    
public  VersionedPostgisDataStore(DataSource dataSource, String schema, String namespace)
    
public  VersionedPostgisDataStore(DataSource dataSource, String namespace)
    
public  VersionedPostgisDataStore(DataSource dataSource)
    

Method Summary
 FilterbuildFidFilter(FilterFactory ff, Set ids)
    
 FilterbuildVersionedFilter(String featureTypeName, Filter filter, RevisionInfo ri)
    
 DefaultQuerybuildVersionedQuery(Query query)
    
protected synchronized  voidcheckVersioningDataStructures()
    
public  voidcreateSchema(FeatureType featureType)
    
 voidcreateVersionedFeatureCollectionView(String typeName)
    
public  voiddispose()
    
protected  voidexecute(Statement st, String sql)
    
protected  ResultSetexecuteQuery(Statement st, String sql)
    
protected  JDBCDataStoreConfiggetConfig()
    
public  FIDMappergetFIDMapper(String tableName)
    
public  FeatureReadergetFeatureReader(Query query, Transaction trans)
    
public  FeatureSourcegetFeatureSource(String typeName)
    
public  FeatureWritergetFeatureWriter(String typeName, Transaction transaction)
    
public  FeatureWritergetFeatureWriter(String typeName, Filter filter, Transaction transaction)
    
public  FeatureWritergetFeatureWriterAppend(String typeName, Transaction transaction)
    
protected  FeatureWritergetFeatureWriterInternal(String typeName, Filter filter, Transaction transaction, boolean append)
    
public  longgetLastRevision()
    
public  LockingManagergetLockingManager()
    
public  ModifiedFeatureIdsgetModifiedFeatureFIDs(String typeName, String version1, String version2, Filter filter, 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.
public  String[]getModifiedFeatureTypes(String version1, String version2)
     Returns a list of type names modified between version1 and version2, with the first version excluded.
 SetgetRevisionsCreatedBy(String typeName, RevisionInfo r1, RevisionInfo r2, String[] users, Transaction transaction)
    
public  FeatureTypegetSchema(String typeName)
    
public  String[]getTypeNames()
    
public static  StringgetVFCTableName(String vfcTypeName)
    
public static  StringgetVFCViewName(String typeName)
    
public  FeatureSourcegetView(Query query)
    
public  booleanisVersioned(String typeName)
    
protected  booleanisVersioned(String typeName, Transaction transaction)
     Checks wheter a type name is versioned or not.
public  booleanisVersionedFeatureCollection(String typeName)
    
 voidresetTypeInfo()
    
public  voidsetLooseBbox(boolean enabled)
    
public synchronized  voidsetVersioned(String typeName, boolean versioned, String author, String message)
     Alters the versioned state of a feature type
Parameters:
  typeName - the type name that must be changed
Parameters:
  versioned - if true, the type gets version enabled, if false versioning is disabled
Parameters:
  t - the transaction used to performe version enabling.
public  voidsetWKBEnabled(boolean enabled)
    
protected  FiltertransformFidFilter(String featureTypeName, Filter filter)
    
public  voidupdateSchema(String typeName, FeatureType featureType)
    

Field Detail
AUTHOR
final public static String AUTHOR(Code)
Key used in transaction properties to hold the commit author



DIRTYTYPES
final public static String DIRTYTYPES(Code)
Key used to store the feature types touched by the current transaction



LOGGER
final protected static Logger LOGGER(Code)
The logger for the postgis module.



MESSAGE
final public static String MESSAGE(Code)
Key used in transaction properties to hold the commit message



REVISION
final static String REVISION(Code)



SUPPORTED_FID_MAPPERS
final static Class[] SUPPORTED_FID_MAPPERS(Code)



TBL_CHANGESETS
final public static String TBL_CHANGESETS(Code)



TBL_TABLESCHANGED
final public static String TBL_TABLESCHANGED(Code)



TBL_VERSIONEDTABLES
final public static String TBL_VERSIONEDTABLES(Code)



VERSION
final static String VERSION(Code)



listenerManager
protected FeatureListenerManager listenerManager(Code)
Manages listener lists for FeatureSource implementations



versionedMap
protected Map versionedMap(Code)
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)



wrapped
protected WrappedPostgisDataStore wrapped(Code)
The wrapped postgis datastore that we leverage for most operations




Constructor Detail
VersionedPostgisDataStore
public VersionedPostgisDataStore(DataSource dataSource, String schema, String namespace, int optimizeMode) throws IOException(Code)



VersionedPostgisDataStore
public VersionedPostgisDataStore(DataSource dataSource, String schema, String namespace) throws IOException(Code)



VersionedPostgisDataStore
public VersionedPostgisDataStore(DataSource dataSource, String namespace) throws IOException(Code)



VersionedPostgisDataStore
public VersionedPostgisDataStore(DataSource dataSource) throws IOException(Code)




Method Detail
buildFidFilter
Filter buildFidFilter(FilterFactory ff, Set ids)(Code)
Builds a filter from a set of feature ids, since there is no convenient way to build it using the factory
Parameters:
  ff -
Parameters:
  ids -



buildVersionedFilter
Filter buildVersionedFilter(String featureTypeName, Filter filter, RevisionInfo ri) throws IOException(Code)
Takes a filter and merges in the extra conditions needed to extract the specified revision
Parameters:
  filter - The original filter
Parameters:
  ri - The revision information a new filter
throws:
  FactoryConfigurationError -
throws:
  IOException -



buildVersionedQuery
DefaultQuery buildVersionedQuery(Query query) throws IOException(Code)
Given an original query and a revision info, builds an equivalent query that will work against the specified revision
Parameters:
  query -
Parameters:
  ri -
throws:
  FactoryConfigurationError -
throws:
  IOException -



checkVersioningDataStructures
protected synchronized void checkVersioningDataStructures() throws IOException(Code)
Makes sure the required versioning data structures are available in the database
throws:
  IOException -



createSchema
public void createSchema(FeatureType featureType) throws IOException(Code)



createVersionedFeatureCollectionView
void createVersionedFeatureCollectionView(String typeName) throws IOException(Code)



dispose
public void dispose()(Code)



execute
protected void execute(Statement st, String sql) throws SQLException(Code)
Logs the sql at info level, then executes the command
Parameters:
  st -
Parameters:
  sql -
throws:
  SQLException -



executeQuery
protected ResultSet executeQuery(Statement st, String sql) throws SQLException(Code)
Logs the sql at info level, then executes the command
Parameters:
  st -
Parameters:
  sql -
throws:
  SQLException -



getConfig
protected JDBCDataStoreConfig getConfig()(Code)



getFIDMapper
public FIDMapper getFIDMapper(String tableName) throws IOException(Code)



getFeatureReader
public FeatureReader getFeatureReader(Query query, Transaction trans) throws IOException(Code)



getFeatureSource
public FeatureSource getFeatureSource(String typeName) throws IOException(Code)



getFeatureWriter
public FeatureWriter getFeatureWriter(String typeName, Transaction transaction) throws IOException(Code)



getFeatureWriter
public FeatureWriter getFeatureWriter(String typeName, Filter filter, Transaction transaction) throws IOException(Code)



getFeatureWriterAppend
public FeatureWriter getFeatureWriterAppend(String typeName, Transaction transaction) throws IOException(Code)



getFeatureWriterInternal
protected FeatureWriter getFeatureWriterInternal(String typeName, Filter filter, Transaction transaction, boolean append) throws IOException, DataSourceException(Code)
Returns either a standard feature writer, or a pure append feature writer



getLastRevision
public long getLastRevision() throws IOException(Code)
Returns the last revision of the repository



getLockingManager
public LockingManager getLockingManager()(Code)



getModifiedFeatureFIDs
public ModifiedFeatureIds getModifiedFeatureFIDs(String typeName, String version1, String version2, Filter filter, String[] users, Transaction transaction) throws IOException(Code)
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:

  • A feature is said to have been modified between version1 and version2 if a new state of it has been created after version1 and before or at version2 (included), or if it has been deleted between version1 and version2 (included).
  • Filter is used to match every state between version1 and version2, so all new states after version1, but also the states existent at version1 provided they existed also at version1 + 1.
  • If at least one state matches the filter, the feature id is returned.
The result is composed of three sets of feature ids:
  • A matched feature created after version1 is included in the created set
  • A matched feature deleted before or at version2 is included in the deleted set
  • A matched feature not included in the created/deleted sets is included in the modified set
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:
  • -: unmatched state
  • =: matched state
  • .: no state (feature has ben deleted)
  • [: creation of a state
  • ]: expiration of a state

Parameters:
  version1 - -the first revision
Parameters:
  version2 - -the second revision, or null if you want the diff between version1 and current
Parameters:
  filter - a filter to limit the features that must be taken into consideration
Parameters:
  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
Parameters:
  transaction -
throws:
  IOException -
throws:
  IllegalAttributeException -
throws:
  NoSuchElementException -



getModifiedFeatureTypes
public String[] getModifiedFeatureTypes(String version1, String version2) throws IOException(Code)
Returns a list of type names modified between version1 and version2, with the first version excluded.
Parameters:
  version1 - the first version
Parameters:
  version2 - the second version, which may be null, if you need to refer the latest version an array or type names, eventually empty, never null



getRevisionsCreatedBy
Set getRevisionsCreatedBy(String typeName, RevisionInfo r1, RevisionInfo r2, String[] users, Transaction transaction) throws IOException(Code)
Gathers the revisions created by a certain group of users between two specified revisions
Parameters:
  r1 - the first revision
Parameters:
  r2 - the second revision
Parameters:
  users - an array of user



getSchema
public FeatureType getSchema(String typeName) throws IOException(Code)



getTypeNames
public String[] getTypeNames() throws IOException(Code)



getVFCTableName
public static String getVFCTableName(String vfcTypeName) throws IOException(Code)
Given a versioned feature collection view name returns the base table name
Parameters:
  vfcTypeName -
throws:
  IOException -



getVFCViewName
public static String getVFCViewName(String typeName)(Code)
Given a type name returns the name of the versioned feature collection view associated to it
Parameters:
  typeName -



getView
public FeatureSource getView(Query query) throws IOException, SchemaException(Code)



isVersioned
public boolean isVersioned(String typeName) throws IOException(Code)
Returns true if the specified feature type is versioned, false otherwise
Parameters:
  typeName -



isVersioned
protected boolean isVersioned(String typeName, Transaction transaction) throws IOException(Code)
Checks wheter a type name is versioned or not.
Parameters:
  typeName - the feature type to check
Parameters:
  transaction - a transaction, or null if you don't have one (use null to avoid a new revisionbeing created for this operation) true if the type is versioned, false otherwise
throws:
  IOException -



isVersionedFeatureCollection
public boolean isVersionedFeatureCollection(String typeName) throws IOException(Code)



resetTypeInfo
void resetTypeInfo() throws IOException(Code)
Makes sure type infos and fid mappers are recomputed when table structures do change
throws:
  IOException -



setLooseBbox
public void setLooseBbox(boolean enabled)(Code)

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



setVersioned
public synchronized void setVersioned(String typeName, boolean versioned, String author, String message) throws IOException(Code)
Alters the versioned state of a feature type
Parameters:
  typeName - the type name that must be changed
Parameters:
  versioned - if true, the type gets version enabled, if false versioning is disabled
Parameters:
  t - the transaction used to performe version enabling. It shall contain user andcommit message as properties.
throws:
  IOException -



setWKBEnabled
public void setWKBEnabled(boolean enabled)(Code)

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



transformFidFilter
protected Filter transformFidFilter(String featureTypeName, Filter filter) throws IOException, FactoryConfigurationError(Code)
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 -
Parameters:
  filter -
throws:
  IOException -
throws:
  FactoryConfigurationError -



updateSchema
public void updateSchema(String typeName, FeatureType featureType) throws IOException(Code)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.