Esri Geoportal Server
1.0

com.esri.gpt.server.csw.provider.components
Class RequestHandler

java.lang.Object
  extended by com.esri.gpt.server.csw.provider.components.RequestHandler

public class RequestHandler
extends Object

Request handler.


Constructor Summary
RequestHandler()
          Default constructor
 
Method Summary
protected  void generateSoapResponse(OperationContext context, String nsSoapUri, String nsSoapPfx, Exception exception)
          Wraps the response within a SOAp envelope.
 OperationContext getOperationContext()
          Gets the operation context.
 boolean getWasSoap()
          Gets the flag indicating a SOAP based request.
 OperationResponse handleGet(HttpServletRequest request)
          Handles a URL based request (HTTP GET).
 OperationResponse handleXML(String xml)
          Handles an XML based request (normally HTTP POST).
protected  Document loadDom(String xml)
          Loads an XML string into an XML Document.
 void parseServiceAndVersion(OperationContext context, HttpServletRequest request)
          Parses the service name and version for a URL based request (HTTP GET).
 void parseServiceAndVersion(OperationContext context, Node root, XPath xpath)
          Parses the service name and version an XML based request (normally HTTP POST).
 void setOperationContext(OperationContext context)
          Sets the operation context.
 void setWasSoap(boolean wasSoap)
          Sets the flag indicating a SOAP based request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RequestHandler

public RequestHandler()
Default constructor

Method Detail

getOperationContext

public OperationContext getOperationContext()
Gets the operation context.

Returns:
the operation context

setOperationContext

public void setOperationContext(OperationContext context)
Sets the operation context.

Parameters:
context - the operation context

getWasSoap

public boolean getWasSoap()
Gets the flag indicating a SOAP based request.

Returns:
true is this was a SOAP based request

setWasSoap

public void setWasSoap(boolean wasSoap)
Sets the flag indicating a SOAP based request.

Parameters:
wasSoap - true is this was a SOAP based request

handleGet

public OperationResponse handleGet(HttpServletRequest request)
                            throws Exception
Handles a URL based request (HTTP GET).

Parameters:
request - the HTTP request
Throws:
Exception - if a processing exception occurs

handleXML

public OperationResponse handleXML(String xml)
                            throws Exception
Handles an XML based request (normally HTTP POST).

Parameters:
xml - the XML
Throws:
Exception - if a processing exception occurs

generateSoapResponse

protected void generateSoapResponse(OperationContext context,
                                    String nsSoapUri,
                                    String nsSoapPfx,
                                    Exception exception)
                             throws Exception
Wraps the response within a SOAp envelope.
If the exception argument is null, the operation response is wrapped.
If the exception argument is not null, an OWS exception report is wrapped.
The OperationResponse.responseXml is reset to the SOAP response string.

Parameters:
context - the operation context
nsSoapUri - the SOAP namespace URI
nsSoapPfx - the SOAP namespace prefix
exception - an exception condition that should be wrapped as an OWS exception report
Throws:
Exception - Exception if a processing exception occurs

loadDom

protected Document loadDom(String xml)
                    throws OwsException
Loads an XML string into an XML Document.

Parameters:
xml - the document XML string
Returns:
the document
Throws:
OwsException - if the document fails to load

parseServiceAndVersion

public void parseServiceAndVersion(OperationContext context,
                                   HttpServletRequest request)
                            throws OwsException
Parses the service name and version for a URL based request (HTTP GET).

Parameters:
context - the operation context
request - the HTTP request
Throws:
OwsException - if validation fails
XPathExpressionException - if an XPath related exception occurs

parseServiceAndVersion

public void parseServiceAndVersion(OperationContext context,
                                   Node root,
                                   XPath xpath)
                            throws OwsException,
                                   XPathExpressionException
Parses the service name and version an XML based request (normally HTTP POST).

Parameters:
context - the operation context
root - the root node
xpath - an XPath to enable queries (properly configured with name spaces)
Throws:
OwsException - if validation fails
XPathExpressionException - if an XPath related exception occurs

Esri Geoportal Server
1.0

Copyright 2011 Environmental Systems Research Institute. All rights reserved. Use is subject to license terms.