Source Code Cross Referenced for FeatureLocking.java in  » GIS » GeoTools-2.4.1 » org » geotools » data » 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 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *    GeoTools - OpenSource mapping toolkit
003:         *    http://geotools.org
004:         *    (C) 2002-2006, GeoTools Project Managment Committee (PMC)
005:         *
006:         *    This library is free software; you can redistribute it and/or
007:         *    modify it under the terms of the GNU Lesser General Public
008:         *    License as published by the Free Software Foundation;
009:         *    version 2.1 of the License.
010:         *
011:         *    This library is distributed in the hope that it will be useful,
012:         *    but WITHOUT ANY WARRANTY; without even the implied warranty of
013:         *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
014:         *    Lesser General Public License for more details.
015:         */
016:        package org.geotools.data;
017:
018:        import java.io.IOException;
019:        import java.util.Set;
020:        import org.opengis.filter.Filter;
021:
022:        /**
023:         * Provides Feature based locking.
024:         *
025:         * <p>
026:         * Features from individual shapefiles, database tables, etc. can be protected
027:         * or reserved from modification through this interface.
028:         * </p>
029:         * <p>
030:         * To use please cast your FeatureSource to this interface.
031:         * <pre><code>
032:         * FeatureSource source = dataStore.getFeatureSource("roads");
033:         * if( source instanceof FeatureLocking ) {
034:         *     FeatureLocking locking = (FeatureLocking) source;
035:         *     ...
036:         * }
037:         *
038:         * @author Jody Garnett, Refractions Research, Inc.
039:         * @author Ray Gallagher
040:         * @author Rob Hranac, TOPP
041:         * @author Chris Holmes, TOPP
042:         * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/api/src/main/java/org/geotools/data/FeatureLocking.java $
043:         * @version $Id: FeatureLocking.java 22600 2006-11-04 09:37:58Z jgarnett $
044:         */
045:        public interface FeatureLocking extends FeatureStore {
046:            /**
047:             * All locking operations will operate against the provided
048:             * <code>lock</code>.
049:             *
050:             * <p>
051:             * This in in keeping with the stateful spirit of DataSource in which
052:             * operations are against the "current" transaction. If a FeatureLock is
053:             * not provided lock operations will only be applicable for the current
054:             * transaction (they will expire on the next commit or rollback).
055:             * </p>
056:             *
057:             * <p>
058:             * That is lockFeatures() operations will:
059:             * </p>
060:             *
061:             * <ul>
062:             * <li>
063:             * Be recorded against the provided FeatureLock.
064:             * </li>
065:             * <li>
066:             * Be recorded against the current transaction if no FeatureLock is
067:             * provided.
068:             * </li>
069:             * </ul>
070:             *
071:             * <p>
072:             * Calling this method with <code>setFeatureLock( FeatureLock.TRANSACTION
073:             * )</code> will revert to per transaction operation.
074:             * </p>
075:             *
076:             * <p>
077:             * This design allows for the following:
078:             * </p>
079:             *
080:             * <ul>
081:             * <li>
082:             * cross DataSource FeatureLock usage
083:             * </li>
084:             * <li>
085:             * not having pass in the same FeatureLock object multiple times
086:             * </li>
087:             * </ul>
088:             *
089:             * @param lock DOCUMENT ME!
090:             */
091:            void setFeatureLock(FeatureLock lock);
092:
093:            /**
094:             * FeatureLock features described by Query.
095:             *
096:             * <p>
097:             * To implement WFS parcial Locking retrieve your features with a query
098:             * operation first before trying to lock them individually. If you are not
099:             * into WFS please don't ask what parcial locking is.
100:             * </p>
101:             *
102:             * @param query Query describing the features to lock
103:             *
104:             * @return Number of features locked
105:             *
106:             * @throws IOException Thrown if anything goes wrong
107:             */
108:            int lockFeatures(Query query) throws IOException;
109:
110:            /**
111:             * FeatureLock features described by Filter.
112:             *
113:             * <p>
114:             * To implement WFS parcial Locking retrieve your features with a query
115:             * operation first before trying to lock them individually. If you are not
116:             * into WFS please don't ask what parcial locking is.
117:             * </p>
118:             *
119:             * @param filter Filter describing the features to lock
120:             *
121:             * @return Number of features locked
122:             *
123:             * @throws IOException Thrown if anything goes wrong
124:             */
125:            int lockFeatures(Filter filter) throws IOException;
126:
127:            /**
128:             * FeatureLock all Features.
129:             *
130:             * <p>
131:             * The method does not prevent addFeatures() from being used (we could add
132:             * a lockDataSource() method if this functionality is required.
133:             * </p>
134:             *
135:             * @return Number of Features locked by this opperation
136:             *
137:             * @throws IOException
138:             */
139:            int lockFeatures() throws IOException;
140:
141:            /**
142:             * Unlocks all Features.
143:             *
144:             * <p>
145:             * Authorization must be provided prior before calling this method.
146:             * </p>
147:             * <pre><code>
148:             * <b>void</b> releaseLock( String lockId, LockingDataSource ds ){
149:             *    ds.setAuthorization( "LOCK534" );
150:             *    ds.unLockFeatures();
151:             * }
152:             * </code></pre>
153:             *
154:             * @throws IOException
155:             */
156:            void unLockFeatures() throws IOException;
157:
158:            /**
159:             * Unlock Features denoted by provided filter.
160:             *
161:             * <p>
162:             * Authorization must be provided prior before calling this method.
163:             * </p>
164:             *
165:             * @param filter
166:             *
167:             * @throws IOException
168:             */
169:            void unLockFeatures(Filter filter) throws IOException;
170:
171:            /**
172:             * Unlock Features denoted by provided query.
173:             *
174:             * <p>
175:             * Authorization must be provided prior before calling this method.
176:             * </p>
177:             *
178:             * @param query Specifies fatures to unlock
179:             *
180:             * @throws IOException
181:             */
182:            void unLockFeatures(Query query) throws IOException;
183:
184:            /**
185:             * Idea for a response from a high-level lock( Query ) function.
186:             */
187:            public static class Response {
188:                String authID;
189:                Set locked;
190:                Set notLocked;
191:
192:                public Response(FeatureLock lock, Set lockedFids,
193:                        Set notLockedFids) {
194:                    authID = lock.getAuthorization();
195:                    locked = lockedFids;
196:                    notLocked = notLockedFids;
197:                }
198:
199:                public String getAuthorizationID() {
200:                    return authID;
201:                }
202:
203:                public Set getLockedFids() {
204:                    return locked;
205:                }
206:
207:                public Set getNotLockedFids() {
208:                    return notLocked;
209:                }
210:            }
211:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.