Source Code Cross Referenced for GeoServerFeatureStore.java in  » GIS » GeoServer » org » vfny » geoserver » global » 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 » GeoServer » org.vfny.geoserver.global 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* Copyright (c) 2001 - 2007 TOPP - www.openplans.org.  All rights reserved.
002:         * This code is licensed under the GPL 2.0 license, availible at the root
003:         * application directory.
004:         */
005:        package org.vfny.geoserver.global;
006:
007:        import org.geoserver.feature.RetypingFeatureCollection;
008:        import org.geotools.data.FeatureReader;
009:        import org.geotools.data.FeatureStore;
010:        import org.geotools.data.Transaction;
011:        import org.geotools.feature.AttributeType;
012:        import org.geotools.feature.FeatureCollection;
013:        import org.geotools.feature.FeatureType;
014:        import org.opengis.filter.Filter;
015:        import org.opengis.referencing.crs.CoordinateReferenceSystem;
016:        import java.io.IOException;
017:        import java.util.Set;
018:
019:        /**
020:         * GeoServer wrapper for backend Geotools2 DataStore.
021:         *
022:         * <p>
023:         * Support FeatureSource decorator for FeatureTypeInfo that takes care of
024:         * mapping the FeatureTypeInfo's FeatureSource with the schema and definition
025:         * query configured for it.
026:         * </p>
027:         *
028:         * <p>
029:         * Because GeoServer requires that attributes always be returned in the same
030:         * order we need a way to smoothly inforce this. Could we use this class to do
031:         * so? It would need to support writing and locking though.
032:         * </p>
033:         *
034:         * @author Gabriel Rold?n
035:         * @version $Id: GeoServerFeatureStore.java 7265 2007-07-18 12:51:13Z aaime $
036:         */
037:        public class GeoServerFeatureStore extends GeoServerFeatureSource
038:                implements  FeatureStore {
039:            /**
040:             * Creates a new DEFQueryFeatureLocking object.
041:             *
042:             * @param store GeoTools2 FeatureSource
043:             * @param schema FeatureType served by source
044:             * @param definitionQuery Filter that constrains source
045:             * @param declaredCRS Geometries will be forced to this CRS (or null, if no forcing is needed)
046:             * @param srsHandling
047:             */
048:            GeoServerFeatureStore(FeatureStore store, FeatureType schema,
049:                    Filter definitionQuery,
050:                    CoordinateReferenceSystem declaredCRS, int srsHandling) {
051:                super (store, schema, definitionQuery, declaredCRS, srsHandling);
052:            }
053:
054:            /**
055:             * FeatureStore access (to save casting)
056:             *
057:             * @return DOCUMENT ME!
058:             */
059:            FeatureStore store() {
060:                return (FeatureStore) source;
061:            }
062:
063:            /**
064:             * see interface for details.
065:             * @param fc
066:             * @return
067:             * @throws IOException
068:             */
069:            public Set addFeatures(FeatureCollection fc) throws IOException {
070:                FeatureStore store = store();
071:
072:                //check if the feature collection needs to be retyped
073:                if (!store.getSchema().equals(fc.getSchema())) {
074:                    fc = new RetypingFeatureCollection(fc, store.getSchema());
075:                }
076:
077:                return store().addFeatures(fc);
078:            }
079:
080:            /**
081:             * DOCUMENT ME!
082:             *
083:             * @param filter DOCUMENT ME!
084:             *
085:             * @throws IOException DOCUMENT ME!
086:             */
087:            public void removeFeatures(Filter filter) throws IOException {
088:                filter = makeDefinitionFilter(filter);
089:
090:                store().removeFeatures(filter);
091:            }
092:
093:            /**
094:             * DOCUMENT ME!
095:             *
096:             * @param type DOCUMENT ME!
097:             * @param value DOCUMENT ME!
098:             * @param filter DOCUMENT ME!
099:             *
100:             * @throws IOException DOCUMENT ME!
101:             *
102:             * @task REVISIT: should we check that non exposed attributes are requiered
103:             *       in <code>type</code>?
104:             */
105:            public void modifyFeatures(AttributeType[] type, Object[] value,
106:                    Filter filter) throws IOException {
107:                filter = makeDefinitionFilter(filter);
108:
109:                store().modifyFeatures(type, value, filter);
110:            }
111:
112:            /**
113:             * DOCUMENT ME!
114:             *
115:             * @param type DOCUMENT ME!
116:             * @param value DOCUMENT ME!
117:             * @param filter DOCUMENT ME!
118:             *
119:             * @throws IOException DOCUMENT ME!
120:             */
121:            public void modifyFeatures(AttributeType type, Object value,
122:                    Filter filter) throws IOException {
123:                filter = makeDefinitionFilter(filter);
124:
125:                store().modifyFeatures(type, value, filter);
126:            }
127:
128:            /**
129:             * DOCUMENT ME!
130:             *
131:             * @param reader DOCUMENT ME!
132:             *
133:             * @throws IOException DOCUMENT ME!
134:             */
135:            public void setFeatures(FeatureReader reader) throws IOException {
136:                FeatureStore store = store();
137:
138:                //check if the feature reader needs to be retyped
139:                if (!store.getSchema().equals(reader.getFeatureType())) {
140:                    reader = new RetypingFeatureCollection.RetypingFeatureReader(
141:                            reader, store.getSchema());
142:                }
143:
144:                store().setFeatures(reader);
145:            }
146:
147:            /**
148:             * DOCUMENT ME!
149:             *
150:             * @param transaction DOCUMENT ME!
151:             */
152:            public void setTransaction(Transaction transaction) {
153:                store().setTransaction(transaction);
154:            }
155:
156:            /**
157:             * DOCUMENT ME!
158:             *
159:             * @return DOCUMENT ME!
160:             */
161:            public Transaction getTransaction() {
162:                return store().getTransaction();
163:            }
164:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.