deegree 2.5 (2011/06/29 09:44 build-8-official)

org.deegree.portal.owswatch.validator
Class AbstractValidator

java.lang.Object
  extended by org.deegree.portal.owswatch.validator.AbstractValidator
All Implemented Interfaces:
Validator
Direct Known Subclasses:
CSWGetCapabilitiesValidator, CSWGetRecordsValidator, SOSDescribeSensorValidator, SOSGetCapabilitiesValidator, WCSGetCapabilitiesValidator, WCSGetCoverageValidator, WFSGetCapabilitiesValidator, WFSGetFeatureValidator, WMSGetCapabilitiesValidator, WMSGetMapValidator

public abstract class AbstractValidator
extends java.lang.Object
implements Validator

Abstract class implementing the method validate.

Version:
$Revision: 20271 $, $Date: 2009-10-21 13:07:15 +0200 (Mi, 21 Okt 2009) $
Author:
Moataz Elmasry, last edited by: $Author: jmays $

Constructor Summary
AbstractValidator()
           
 
Method Summary
protected  boolean closeStream(java.io.InputStream stream)
           
protected  java.io.InputStream copyStream(java.io.InputStream stream)
          Creates a new copy of the given InputStream
protected  javax.xml.parsers.DocumentBuilder instantiateParser()
          Creates a new instance of DocumentBuilder
protected  boolean isValidHttpResponse(int statusCode)
          Makes sure that the HttpResponse is not a critical error
protected  java.lang.String parseStream(java.io.InputStream stream)
          Parses a given InputStream to a String
 ValidatorResponse validateAnswer(org.apache.commons.httpclient.HttpMethodBase method, int statusCode)
          Recieves an instance of HttpMethodBase, extracts the needed data from it and builds a ValidatorResponse instance
protected  ValidatorResponse validateErrorHttpResponse(int statusCode)
           
protected  ValidatorResponse validateXml(org.apache.commons.httpclient.HttpMethodBase method)
          Validates the HttpMethodBase and checks if the execution was successful or not
protected  ValidatorResponse validateXmlServiceException(org.apache.commons.httpclient.HttpMethodBase method)
          This method is called To read the ServiceExceptionReport from the xml file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractValidator

public AbstractValidator()
Method Detail

validateAnswer

public ValidatorResponse validateAnswer(org.apache.commons.httpclient.HttpMethodBase method,
                                        int statusCode)
Description copied from interface: Validator
Recieves an instance of HttpMethodBase, extracts the needed data from it and builds a ValidatorResponse instance

Specified by:
validateAnswer in interface Validator
Returns:
instance of ValidatorResponse extracted from HttpMethodBase

validateXml

protected ValidatorResponse validateXml(org.apache.commons.httpclient.HttpMethodBase method)
Validates the HttpMethodBase and checks if the execution was successful or not

Parameters:
method - the httpmethod after executing it
Returns:
an instance of ValidatorResponse with the necessary information after validation

validateXmlServiceException

protected ValidatorResponse validateXmlServiceException(org.apache.commons.httpclient.HttpMethodBase method)
This method is called To read the ServiceExceptionReport from the xml file

Parameters:
method - the httpmethod after executing it
Returns:
an instance of ValidatorResponse with the necessary information after validation

isValidHttpResponse

protected boolean isValidHttpResponse(int statusCode)
Makes sure that the HttpResponse is not a critical error

Parameters:
statusCode -

validateErrorHttpResponse

protected ValidatorResponse validateErrorHttpResponse(int statusCode)
Parameters:
statusCode -
Returns:
instance of the validatorresponse with the error

parseStream

protected java.lang.String parseStream(java.io.InputStream stream)
                                throws java.io.IOException
Parses a given InputStream to a String

Parameters:
stream -
Returns:
String
Throws:
java.io.IOException

instantiateParser

protected javax.xml.parsers.DocumentBuilder instantiateParser()
                                                       throws java.io.IOException
Creates a new instance of DocumentBuilder

Returns:
DocumentBuilder
Throws:
java.io.IOException

closeStream

protected boolean closeStream(java.io.InputStream stream)

copyStream

protected java.io.InputStream copyStream(java.io.InputStream stream)
                                  throws java.io.IOException
Creates a new copy of the given InputStream

Parameters:
stream -
Returns:
InputStream
Throws:
java.io.IOException

deegree 2.5 (2011/06/29 09:44 build-8-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org