001 // $HeadURL: svn+ssh://rbezema@svn.wald.intevation.org/deegree/base/branches/2.2_testing/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 17:22:25 +0100 (Do, 27 Dez 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, String version ) { 091 setExceptions( exceptions ); 092 setVersion( version ); 093 } 094 095 /** 096 * @param exceptions 097 * @param version 098 * @param language 099 */ 100 public ExceptionReport( OGCWebServiceException[] exceptions, String version, String language ) { 101 setExceptions( exceptions ); 102 setVersion( version ); 103 setLanguage( language ); 104 } 105 106 /** 107 * @return Returns the exceptions. 108 * 109 */ 110 public OGCWebServiceException[] getExceptions() { 111 OGCWebServiceException[] owse = new OGCWebServiceException[exceptions.size()]; 112 return exceptions.toArray( owse ); 113 } 114 115 /** 116 * @param exceptions 117 * The exceptions to set. 118 */ 119 public void setExceptions( OGCWebServiceException[] exceptions ) { 120 this.exceptions.clear(); 121 for ( int i = 0; i < exceptions.length; i++ ) { 122 this.exceptions.add( exceptions[i] ); 123 } 124 } 125 126 /** 127 * @return Returns the language. 128 * 129 */ 130 public String getLanguage() { 131 return language; 132 } 133 134 /** 135 * @param language 136 * The language to set. 137 * 138 */ 139 public void setLanguage( String language ) { 140 this.language = language; 141 } 142 143 /** 144 * @return Returns the version. 145 */ 146 public String getVersion() { 147 return version; 148 } 149 150 /** 151 * @param version 152 * The version to set. 153 */ 154 public void setVersion( String version ) { 155 this.version = version; 156 } 157 158 }