org.deegree.protocol.ows.client
Class AbstractOWSClient<T extends OWSCapabilitiesAdapter>

java.lang.Object
  extended by org.deegree.protocol.ows.client.AbstractOWSClient<T>
Direct Known Subclasses:
WFSClient

public abstract class AbstractOWSClient<T extends OWSCapabilitiesAdapter>
extends Object

Provides common base functionality for API-level client implementations that access OGC web services.

Version:
$Revision: 32145 $, $Date: 2011-10-14 19:13:51 +0200 (Fri, 14 Oct 2011) $
Author:
Markus Schneider, last edited by: $Author: mschneider $

Field Summary
protected  T capaDoc
           
 
Constructor Summary
protected AbstractOWSClient(URL capaUrl)
          Creates a new AbstractOWSClient instance.
 
Method Summary
protected  OWSResponse doGet(URL endPoint, Map<String,String> params, Map<String,String> headers)
          Performs an HTTP-GET request to the service.
protected  OWSResponse doPost(URL endPoint, String contentType, StreamBufferStore body, Map<String,String> headers)
          Performs an HTTP-POST request to the service.
protected abstract  T getCapabilitiesAdapter(org.apache.axiom.om.OMElement rootEl, String version)
          Returns an OWSCapabilitiesAdapter instance suitable for the specific service and version.
protected  URL getGetUrl(String operationName)
           
protected  List<URL> getGetUrls(String operationName)
           
 ServiceIdentification getIdentification()
          Returns the ServiceIdentification metadata provided by the server.
 OperationsMetadata getOperations()
          Returns the OperationsMetadata provided by the server.
protected  URL getPostUrl(String operationName)
           
protected  List<URL> getPostUrls(String operationName)
           
 ServiceProvider getProvider()
          Returns the ServiceProvider metadata provided by the server.
protected  boolean isOperationSupported(String operationName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

capaDoc

protected final T extends OWSCapabilitiesAdapter capaDoc
Constructor Detail

AbstractOWSClient

protected AbstractOWSClient(URL capaUrl)
                     throws OWSExceptionReport,
                            XMLStreamException,
                            IOException
Creates a new AbstractOWSClient instance.

Parameters:
capaUrl - url of a WFS capabilities document, usually this is a GetCapabilities request to the service, must not be null
Throws:
OWSExceptionReport - if the server replied with a service exception report
XMLStreamException
IOException - if a communication/network problem occured
Method Detail

getCapabilitiesAdapter

protected abstract T getCapabilitiesAdapter(org.apache.axiom.om.OMElement rootEl,
                                            String version)
                                                                    throws IOException
Returns an OWSCapabilitiesAdapter instance suitable for the specific service and version.

Parameters:
rootEl - root element of the service capabilities, never null
version - capabilities version, may be null (for broken capabilities responses)
Returns:
capabilities adapter, must not be null
Throws:
IOException

getIdentification

public final ServiceIdentification getIdentification()
Returns the ServiceIdentification metadata provided by the server.

Returns:
identification metadata, can be null

getProvider

public final ServiceProvider getProvider()
Returns the ServiceProvider metadata provided by the server.

Returns:
provider metadata, can be null

getOperations

public final OperationsMetadata getOperations()
Returns the OperationsMetadata provided by the server.

Returns:
operations metadata, can be null

isOperationSupported

protected boolean isOperationSupported(String operationName)

getGetUrl

protected URL getGetUrl(String operationName)

getPostUrl

protected URL getPostUrl(String operationName)

getGetUrls

protected List<URL> getGetUrls(String operationName)

getPostUrls

protected List<URL> getPostUrls(String operationName)

doGet

protected OWSResponse doGet(URL endPoint,
                            Map<String,String> params,
                            Map<String,String> headers)
                     throws IOException
Performs an HTTP-GET request to the service.

NOTE: The caller must call OWSResponse.close() on the returned object eventually, otherwise underlying resources (connections) may not be freed.

Parameters:
endPoint -
params -
headers -
Returns:
Throws:
IOException

doPost

protected OWSResponse doPost(URL endPoint,
                             String contentType,
                             StreamBufferStore body,
                             Map<String,String> headers)
                      throws IOException
Performs an HTTP-POST request to the service.

NOTE: The caller must call OWSResponse.close() on the returned object eventually, otherwise underlying resources (connections) may not be freed.

Parameters:
endPoint -
contentType -
body -
headers -
Returns:
Throws:
IOException


Copyright © 2011. All Rights Reserved.