Source Code Cross Referenced for SearchResults.java in  » GIS » deegree » org » deegree » ogcwebservices » csw » discovery » 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 » deegree » org.deegree.ogcwebservices.csw.discovery 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        //$HeadURL: https://svn.wald.intevation.org/svn/deegree/base/trunk/src/org/deegree/ogcwebservices/csw/discovery/SearchResults.java $
002:        /*----------------    FILE HEADER  ------------------------------------------
003:
004:         This file is part of deegree.
005:         Copyright (C) 2001-2008 by:
006:         EXSE, Department of Geography, University of Bonn
007:         http://www.giub.uni-bonn.de/deegree/
008:         lat/lon GmbH
009:         http://www.lat-lon.de
010:
011:         This library is free software; you can redistribute it and/or
012:         modify it under the terms of the GNU Lesser General Public
013:         License as published by the Free Software Foundation; either
014:         version 2.1 of the License, or (at your option) any later version.
015:
016:         This library is distributed in the hope that it will be useful,
017:         but WITHOUT ANY WARRANTY; without even the implied warranty of
018:         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
019:         Lesser General Public License for more details.
020:
021:         You should have received a copy of the GNU Lesser General Public
022:         License along with this library; if not, write to the Free Software
023:         Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
024:
025:         Contact:
026:
027:         Andreas Poth
028:         lat/lon GmbH
029:         Aennchenstr. 19
030:         53115 Bonn
031:         Germany
032:         E-Mail: poth@lat-lon.de
033:
034:         Prof. Dr. Klaus Greve
035:         Department of Geography
036:         University of Bonn
037:         Meckenheimer Allee 166
038:         53115 Bonn
039:         Germany
040:         E-Mail: greve@giub.uni-bonn.de
041:
042:
043:         ---------------------------------------------------------------------------*/
044:        package org.deegree.ogcwebservices.csw.discovery;
045:
046:        import java.net.URI;
047:        import java.net.URISyntaxException;
048:        import java.util.Date;
049:        import java.util.GregorianCalendar;
050:
051:        import org.deegree.ogcwebservices.InvalidParameterValueException;
052:        import org.w3c.dom.Node;
053:
054:        /**
055:         * Class representation of a <csw:SearchResults>-element.
056:         * 
057:         * The SearchResults is a generic container for the actual response to a
058:         * GetRecords request. The content of the SearchResults is the set of records
059:         * returned by the GetRecords operation. The actual records returned by the
060:         * catalogue should substitute for AbstractRecord.
061:         * 
062:         * @author <a href="mailto:poth@lat-lon.de">Andreas Poth </a>
063:         * @author <a href="mailto:tfr@users.sourceforge.net">Torsten Friebe </a>
064:         * @author <a href="mailto:tfr@users.sourceforge.net">Markus Schneider </a>
065:         * @author last edited by: $Author: apoth $
066:         * 
067:         * @version 2.0, $Revision: 9345 $, $Date: 2007-12-27 08:22:25 -0800 (Thu, 27 Dec 2007) $
068:         */
069:
070:        public class SearchResults {
071:
072:            private static final String[] ELEMENT_SETS = { "brief", "summary",
073:                    "full" };
074:
075:            private URI requestId = null;
076:
077:            private URI resultSetId = null;
078:
079:            private String elementSet = null;
080:
081:            private URI recordSchema = null;
082:
083:            private int numberOfRecordsReturned = 0;
084:
085:            private int numberOfRecordsMatched = 0;
086:
087:            private int nextRecord = 0;
088:
089:            private Date expires = null;
090:
091:            private Node recordsParentNode;
092:
093:            /**
094:             * 
095:             * @param requestId
096:             * @param resultSetId
097:             * @param elementSet
098:             * @param recordSchema
099:             * @param numberOfRecordsReturned
100:             * @param nextRecord
101:             * @param recordsParentNode
102:             * @throws InvalidParameterValueException
103:             */
104:            SearchResults(String requestId, String resultSetId,
105:                    String elementSet, String recordSchema,
106:                    int numberOfRecordsReturned, int numberOfRecordsMatched,
107:                    int nextRecord, Node recordsParentNode, String expires)
108:                    throws InvalidParameterValueException {
109:
110:                if (requestId != null) {
111:                    try {
112:                        this .requestId = new URI(null, requestId, null);
113:                    } catch (URISyntaxException e) {
114:                        throw new InvalidParameterValueException(
115:                                "Value '"
116:                                        + requestId
117:                                        + "' of Parameter 'requestId' does not denote a valid URI.");
118:                    }
119:                }
120:
121:                if (resultSetId != null) {
122:                    try {
123:                        this .resultSetId = new URI(null, resultSetId, null);
124:                    } catch (URISyntaxException e) {
125:                        throw new InvalidParameterValueException(
126:                                "Value '"
127:                                        + resultSetId
128:                                        + "' of Parameter 'resultSetId' does not denote a valid URI.");
129:                    }
130:                }
131:
132:                if (elementSet != null) {
133:                    for (int i = 0; i < ELEMENT_SETS.length; i++) {
134:                        if (ELEMENT_SETS[i].equals(elementSet)) {
135:                            this .elementSet = elementSet;
136:                        }
137:                    }
138:                    if (this .elementSet == null) {
139:                        throw new InvalidParameterValueException(
140:                                "Value '"
141:                                        + elementSet
142:                                        + "' of Parameter 'elementSet' is invalid. Valid parameters"
143:                                        + " are: 'full', 'summary' and 'brief'.");
144:                    }
145:                }
146:
147:                if (recordSchema != null) {
148:                    try {
149:                        this .recordSchema = new URI(null, recordSchema, null);
150:                    } catch (URISyntaxException e) {
151:                        throw new InvalidParameterValueException(
152:                                "Value '"
153:                                        + recordSchema
154:                                        + "' of Parameter 'recordSchema' does not denote a valid URI.");
155:                    }
156:                }
157:
158:                this .numberOfRecordsReturned = numberOfRecordsReturned;
159:                this .numberOfRecordsMatched = numberOfRecordsMatched;
160:                // TODO
161:                this .expires = new GregorianCalendar().getTime();//TimeTools.createCalendar( expires ).getTime();
162:                this .nextRecord = nextRecord;
163:                this .recordsParentNode = recordsParentNode;
164:            }
165:
166:            /**
167:             * 
168:             */
169:            public URI getRequestId() {
170:                return requestId;
171:            }
172:
173:            /**
174:             * A server-generated identifier for the result set. May be used in
175:             * subsequent GetRecords operations to further refine the result set. If the
176:             * server does not implement this capability then the attribute should be
177:             * omitted.
178:             */
179:            public URI getResultSetId() {
180:                return resultSetId;
181:            }
182:
183:            /**
184:             * The element set returned (brief, summary or full). This is null if
185:             * getElementNames of <tt>GetRecord</tt>!= null; Optional
186:             */
187:            public String getElementSet() {
188:                return elementSet;
189:            }
190:
191:            /**
192:             * A reference to the type or schema of the records returned. Optional
193:             */
194:            public URI getRecordSchema() {
195:                return recordSchema;
196:            }
197:
198:            /**
199:             * Number of records found by the GetRecords operation
200:             */
201:            public int getNumberOfRecordsMatched() {
202:                return numberOfRecordsMatched;
203:            }
204:
205:            /**
206:             * Number of records actually returned to client. This may not be the entire
207:             * result set since some servers may limit the number of records returned to
208:             * limit the size of the response package transmitted to the client.
209:             * Subsequent queries may be executed to see more of the result set. The
210:             * nextRecord attribute will indicate to the client where to begin the next
211:             * query
212:             */
213:            public int getNumberOfRecordsReturned() {
214:                return numberOfRecordsReturned;
215:            }
216:
217:            /**
218:             * Start position of next record. A value of 0 means all records have been
219:             * returned.
220:             */
221:            public int getNextRecord() {
222:                return nextRecord;
223:            }
224:
225:            /**
226:             * Returns the contents of the &lt;SearchResults&gt;-element.
227:             */
228:            public Node getRecords() {
229:                return recordsParentNode;
230:            }
231:
232:            /**
233:             * 
234:             */
235:            public Date getExpires() {
236:                return expires;
237:            }
238:
239:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.