Source Code Cross Referenced for WFSDTO.java in  » GIS » GeoServer » org » vfny » geoserver » global » dto » 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.dto 
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.dto;
006:
007:        /**
008:         * Data Transfer Object for communication with GeoServer's Web Feature Service.
009:         *
010:         * <p>
011:         * Data Transfer object are used to communicate between the GeoServer
012:         * application and its configuration and persistent layers. As such the class
013:         * is final - to allow for its future use as an on-the-wire message.
014:         * </p>
015:         *
016:         * @author dzwiers, Refractions Research, Inc.
017:         * @version $Id: WFSDTO.java 6326 2007-03-15 18:36:40Z jdeolive $
018:         */
019:        public final class WFSDTO implements  DataTransferObject {
020:            /** ServiceLevel bit used to indicate Basic support */
021:            public static final int SERVICE_BASIC = 1;
022:
023:            /** ServiceLevel bit used to indicate Transaction Insert support */
024:            public static final int SERVICE_INSERT = 2;
025:
026:            /** ServiceLevel bit used to indicate Transaction Update support */
027:            public static final int SERVICE_UPDATE = 4;
028:
029:            /** ServiceLevel bit used to indicate Transaction Delete support */
030:            public static final int SERVICE_DELETE = 8;
031:
032:            /** ServiceLevel bit used to indicate Locking support */
033:            public static final int SERVICE_LOCKING = 16;
034:
035:            /** ServiceLevel mask equivilent to basic WFS conformance */
036:            public static final int BASIC = 1;
037:
038:            /** ServiceLevel mask for transactional WFS conformance. */
039:            public static final int TRANSACTIONAL = SERVICE_BASIC
040:                    | SERVICE_INSERT | SERVICE_UPDATE | SERVICE_DELETE;
041:
042:            /** ServiceLevel mask equivilent to complete WFS conformance */
043:            public static final int COMPLETE = TRANSACTIONAL | SERVICE_LOCKING;
044:
045:            /** The service parameters for this instance. */
046:            private ServiceDTO service;
047:            private boolean srsXmlStyle = true;
048:            private int serviceLevel = COMPLETE; //if not set then it should be complete
049:            private boolean featureBounding = true;
050:
051:            /**
052:             * ie. citeConformanceHacks value equals true
053:             *
054:             * <p>
055:             * Currently there are certain legal things in the Geoserver WFS
056:             * GetCapabilities response that the CITE tests throw error if it finds.
057:             * An example of this is the supported GetFeature output formats.  CITE
058:             * only allows GML2, GML2-ZIP, and SHAPE-ZIP. We support GML2, GML2-GZIP,
059:             * GML2-ZIP, and SHAPE-ZIP, so CITE tests will complain that we're not
060:             * allowed to support GML2-GZIP! By setting this option to "true" the
061:             * GetCapabilities response will NOT show we support those extra
062:             * dataformats. In the future we may find other "silly" things.
063:             * </p>
064:             */
065:            private boolean citeConformanceHacks = false; //default to normal operations
066:
067:            /**
068:             * WFS Data Transfer Object constructor.  does nothing
069:             */
070:            public WFSDTO() {
071:            }
072:
073:            /**
074:             * WFS constructor.
075:             *
076:             * <p>
077:             * Creates a copy of the WFS provided. If the WFS provided  is null then
078:             * default values are used. All the data structures are cloned.
079:             * </p>
080:             *
081:             * @param other The WFS to copy.
082:             *
083:             * @throws NullPointerException DOCUMENT ME!
084:             */
085:            public WFSDTO(WFSDTO other) {
086:                if (other == null) {
087:                    throw new NullPointerException(
088:                            "Data Transfer Object required");
089:                }
090:
091:                service = (ServiceDTO) new ServiceDTO(other.getService());
092:                featureBounding = other.isFeatureBounding();
093:                serviceLevel = other.getServiceLevel();
094:                citeConformanceHacks = other.getCiteConformanceHacks();
095:            }
096:
097:            /**
098:             * Implement clone as a DeepCopy.
099:             *
100:             * @return A Deep Copy of this WFSDTO
101:             *
102:             * @see java.lang.Object#clone()
103:             */
104:            public Object clone() {
105:                return new WFSDTO(this );
106:            }
107:
108:            /**
109:             * Implement equals.
110:             *
111:             * @param other Other object to test for equality
112:             *
113:             * @return true when the object passed is equal to this object.
114:             *
115:             * @see java.lang.Object#equals(java.lang.Object)
116:             */
117:            public boolean equals(Object other) {
118:                if ((other == null) || !(other instanceof  WFSDTO)) {
119:                    return false;
120:                }
121:
122:                WFSDTO dto = (WFSDTO) other;
123:
124:                if (citeConformanceHacks != dto.getCiteConformanceHacks()) {
125:                    return false;
126:                }
127:
128:                if (featureBounding != dto.isFeatureBounding()) {
129:                    return false;
130:                }
131:
132:                return (((serviceLevel == dto.getServiceLevel()) && (service == null)) ? (dto
133:                        .getService() == null)
134:                        : service.equals(dto.getService()));
135:            }
136:
137:            /**
138:             * Implement hashCode.
139:             *
140:             * @return Service hashcode or 0
141:             *
142:             * @see java.lang.Object#hashCode()
143:             */
144:            public int hashCode() {
145:                return (service == null) ? 0 : service.hashCode();
146:            }
147:
148:            /**
149:             * Provides access to the Service DTO object.
150:             *
151:             * <p>
152:             * Note well that this is the internal ServiceDTO object used by the WFSDTO
153:             * - any changes made to the result of this method will change the state
154:             * of this WFSDTO object.
155:             * </p>
156:             *
157:             * @return ServericeDTO used by this WFSDTO
158:             */
159:            public ServiceDTO getService() {
160:                return service;
161:            }
162:
163:            /**
164:             * Set this WFS Data Tranfer Object to use the provided Service DTO.
165:             *
166:             * <p>
167:             * A copy of the provided dto is made.
168:             * </p>
169:             *
170:             * @param dto ServiceDTO used to configure this WFSDTO
171:             *
172:             * @throws NullPointerException DOCUMENT ME!
173:             */
174:            public void setService(ServiceDTO dto) {
175:                if (dto == null) {
176:                    throw new NullPointerException("ServiceDTO requrired");
177:                }
178:
179:                service = dto;
180:            }
181:
182:            /**
183:             * Whether the srs xml attribute should be in the EPSG:4326 (non-xml)
184:             * style, or in the http://www.opengis.net/gml/srs/epsg.xml#4326 style.
185:             *
186:             * @return <tt>true</tt> if the srs is reported with the xml style
187:             */
188:            public boolean isSrsXmlStyle() {
189:                return srsXmlStyle;
190:            }
191:
192:            /**
193:             * Sets whether the srs xml attribute should be in the EPSG:4326 (non-xml)
194:             * style, or in the http://www.opengis.net/gml/srs/epsg.xml#4326 style.
195:             *
196:             * @param doXmlStyle whether the srs style should be xml or not.
197:             */
198:            public void setSrsXmlStyle(boolean doXmlStyle) {
199:                this .srsXmlStyle = doXmlStyle;
200:            }
201:
202:            /**
203:             * Access serviceLevel property.
204:             *
205:             * @return Returns the serviceLevel.
206:             */
207:            public int getServiceLevel() {
208:                return serviceLevel;
209:            }
210:
211:            /**
212:             * Set serviceLevel to serviceLevel.
213:             *
214:             * @param serviceLevel The serviceLevel to set.
215:             */
216:            public void setServiceLevel(int serviceLevel) {
217:                this .serviceLevel = serviceLevel;
218:            }
219:
220:            /**
221:             * turn on/off the citeConformanceHacks option.
222:             *
223:             * @param on
224:             */
225:            public void setCiteConformanceHacks(boolean on) {
226:                citeConformanceHacks = on;
227:            }
228:
229:            /**
230:             * get the current value of the citeConformanceHacks
231:             *
232:             * @return
233:             */
234:            public boolean getCiteConformanceHacks() {
235:                return (citeConformanceHacks);
236:            }
237:
238:            /**
239:             * Returns whether the gml returned by getFeature includes an
240:             * auto-calculated bounds element on each feature or not.
241:             *
242:             * @return <tt>true</tt> if the gml features will have boundedBy
243:             *         automatically generated.
244:             */
245:            public boolean isFeatureBounding() {
246:                return featureBounding;
247:            }
248:
249:            /**
250:             * Sets whether the gml returned by getFeature includes an auto-calculated
251:             * bounds element on each feature or not.
252:             *
253:             * @param featureBounding <tt>true</tt> if gml features should have
254:             *        boundedBy automatically generated.
255:             */
256:            public void setFeatureBounding(boolean featureBounding) {
257:                this.featureBounding = featureBounding;
258:            }
259:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.