org.deegree.protocol.ows.exception
Class OWSExceptionReader

java.lang.Object
  extended by org.deegree.protocol.ows.exception.OWSExceptionReader

public class OWSExceptionReader
extends Object

Reads exception report documents provided by OGC web services.

This parser is designed to be as relaxed as possible about the format of the input (in order to be able to cope with broken/invalid responses as well). Respected/tested exception report formats:

Version:
$Revision: 31710 $, $Date: 2011-08-31 18:18:15 +0200 (Wed, 31 Aug 2011) $
Author:
Andrei Ionita, Markus Schneider, last edited by: $Author: mschneider $

Constructor Summary
OWSExceptionReader()
           
 
Method Summary
static void assertNoExceptionReport(org.apache.axiom.om.OMElement element)
          Checks whether the given OMElement is an exception report element and causes an OWSExceptionReport exception (with the content of the element) if this is the case.
static void assertNoExceptionReport(XMLStreamReader xmlStream)
          Checks whether the given XMLStreamReader points to an exception report and causes an exception (with the content of the element) if this is the case.
static boolean isExceptionReport(QName elName)
          Returns whether the given element name denotes an exception report.
static OWSExceptionReport parseExceptionReport(XMLStreamReader reader)
          Parses the service exception report element that the given XMLStreamReader points at.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OWSExceptionReader

public OWSExceptionReader()
Method Detail

assertNoExceptionReport

public static void assertNoExceptionReport(XMLStreamReader xmlStream)
                                    throws OWSExceptionReport,
                                           XMLStreamException
Checks whether the given XMLStreamReader points to an exception report and causes an exception (with the content of the element) if this is the case.

Parameters:
xml - XML stream reader, must not be null and point at a START_DOCUMENT or START_ELEMENT event, if the element is an exception report, it points at the corresponding END_ELEMENT event afterwards
Throws:
OWSExceptionReport - if the reader points at an exception report
XMLStreamException

assertNoExceptionReport

public static void assertNoExceptionReport(org.apache.axiom.om.OMElement element)
                                    throws OWSExceptionReport,
                                           XMLStreamException
Checks whether the given OMElement is an exception report element and causes an OWSExceptionReport exception (with the content of the element) if this is the case.

Parameters:
xml - XML stream reader, must not be null and point at a START_DOCUMENT or START_ELEMENT event, if the element is an exception report, it points at the corresponding END_ELEMENT event afterwards
Throws:
OWSExceptionReport - if the reader points at an exception report
XMLStreamException

isExceptionReport

public static boolean isExceptionReport(QName elName)
Returns whether the given element name denotes an exception report.

Parameters:
elName - qualified name of the potential exception report element, must not be null
Returns:
true if the current element in the reader (seems to) denote an exception report, false otherwise

parseExceptionReport

public static OWSExceptionReport parseExceptionReport(XMLStreamReader reader)
                                               throws NoSuchElementException,
                                                      XMLStreamException
Parses the service exception report element that the given XMLStreamReader points at.

Parameters:
reader - XML stream reader, must not be null and point at a START_ELEMENT event, points at the corresponding END_ELEMENT event afterwards
Returns:
the parsed OWSException, never null
Throws:
XMLStreamException
NoSuchElementException


Copyright © 2011. All Rights Reserved.