001: // $HeadURL: https://svn.wald.intevation.org/svn/deegree/base/trunk/src/org/deegree/ogcwebservices/ExceptionReport.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;
045:
046: import java.util.ArrayList;
047: import java.util.List;
048:
049: /**
050: * <p>
051: * Upon receiving an invalid operation request, each OWS shall respond to the client using an
052: * Exception Report message to describe to the client application and/or its human user the
053: * reason(s) that the request is invalid. Whenever a server detects an exception condition while
054: * responding to a valid operation request, and cannot produce a normal response to that operation,
055: * the server shall also respond to the client using an Exception Report.
056: * </p>
057: * <p>
058: * Each Exception Report shall contain one or more Exception elements, with each such element
059: * signalling detection of an independent error. Each Exception element shall contain the parameters
060: * ExceptionText, exceptionCode and locator.
061: * </p>
062: *
063: * @version $Revision: 9345 $
064: * @author <a href="mailto:poth@lat-lon.de">Andreas Poth</a>
065: * @author last edited by: $Author: apoth $
066: *
067: * @version 1.0. $Revision: 9345 $, $Date: 2007-12-27 08:22:25 -0800 (Thu, 27 Dec 2007) $
068: *
069: * @since 2.0
070: */
071: public class ExceptionReport {
072:
073: private List<OGCWebServiceException> exceptions = new ArrayList<OGCWebServiceException>();
074:
075: private String version = "1.0.0";
076:
077: private String language = "en";
078:
079: /**
080: * @param exceptions
081: */
082: public ExceptionReport(OGCWebServiceException[] exceptions) {
083: setExceptions(exceptions);
084: }
085:
086: /**
087: * @param exceptions
088: * @param version
089: */
090: public ExceptionReport(OGCWebServiceException[] exceptions,
091: String version) {
092: setExceptions(exceptions);
093: setVersion(version);
094: }
095:
096: /**
097: * @param exceptions
098: * @param version
099: * @param language
100: */
101: public ExceptionReport(OGCWebServiceException[] exceptions,
102: String version, String language) {
103: setExceptions(exceptions);
104: setVersion(version);
105: setLanguage(language);
106: }
107:
108: /**
109: * @return Returns the exceptions.
110: *
111: */
112: public OGCWebServiceException[] getExceptions() {
113: OGCWebServiceException[] owse = new OGCWebServiceException[exceptions
114: .size()];
115: return exceptions.toArray(owse);
116: }
117:
118: /**
119: * @param exceptions
120: * The exceptions to set.
121: */
122: public void setExceptions(OGCWebServiceException[] exceptions) {
123: this .exceptions.clear();
124: for (int i = 0; i < exceptions.length; i++) {
125: this .exceptions.add(exceptions[i]);
126: }
127: }
128:
129: /**
130: * @return Returns the language.
131: *
132: */
133: public String getLanguage() {
134: return language;
135: }
136:
137: /**
138: * @param language
139: * The language to set.
140: *
141: */
142: public void setLanguage(String language) {
143: this .language = language;
144: }
145:
146: /**
147: * @return Returns the version.
148: */
149: public String getVersion() {
150: return version;
151: }
152:
153: /**
154: * @param version
155: * The version to set.
156: */
157: public void setVersion(String version) {
158: this.version = version;
159: }
160:
161: }
|