ArcGIS Server Geoportal extension
10

com.esri.gpt.control.csw.inbound202
Class DiscoveryHandler

java.lang.Object
  extended by com.esri.gpt.control.csw.inbound202.DiscoveryHandler
Direct Known Subclasses:
DescribeRecordHandler, GetCapabilitiesHandler, GetRecordByIdHandler, GetRecordsHandler

public class DiscoveryHandler
extends Object

Super-class for the handling of an in-bound CSW 2.0.2 discovery request.


Constructor Summary
DiscoveryHandler(RequestContext requestContext)
          Constructs with an associated request context.
 
Method Summary
protected  void executeQuery(DiscoveryQuery query)
          Executes a discovery query.
protected  Discoverable findDiscoverable(String clientName)
          Finds the discoverable associated with a client name.
protected  String getCswResponse()
          Gets the CSW response.
protected  CoreQueryables getQueryables()
          Gets the queryables.
protected  RequestContext getRequestContext()
          Gets the request context
protected  String getRequestParameter(HttpServletRequest request, String parameterKey)
          Gets the HTTP request parameter value associated with a key.
protected  RetrievalOptions getRetrievalOptions()
          Gets the retrieval options associated with a request.
protected  String getService()
          Gets the CSW service.
protected  String getVersion()
          Gets the CSW version.
protected  void parseElementSet(Node parent, XPath xpath, DiscoveryQuery query)
          Parses the returnable element set.
protected  Discoverable parsePropertyName(Node parent, XPath xpath)
          Parses a parent node for an associated property name.
protected  void setCswResponse(String response)
          Sets the CSW response.
protected  void setService(String service)
          Sets the CSW service.
protected  void setVersion(String version)
          Sets the CSW version.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DiscoveryHandler

public DiscoveryHandler(RequestContext requestContext)
Constructs with an associated request context.

Parameters:
requestContext - the request context
Method Detail

getCswResponse

protected String getCswResponse()
Gets the CSW response.

Returns:
the CSW response

setCswResponse

protected void setCswResponse(String response)
Sets the CSW response.

Parameters:
response - the CSW response

getRequestContext

protected RequestContext getRequestContext()
Gets the request context

Returns:
requestContext the requestContext

getQueryables

protected CoreQueryables getQueryables()
Gets the queryables.

Returns:
the queryables

getRequestParameter

protected String getRequestParameter(HttpServletRequest request,
                                     String parameterKey)
Gets the HTTP request parameter value associated with a key.

Parameters:
parameterKey - the parameter key
Returns:
the parameter value (empty string if not found)

getRetrievalOptions

protected RetrievalOptions getRetrievalOptions()
Gets the retrieval options associated with a request.

Returns:
the retrieval options

getService

protected String getService()
Gets the CSW service.

Returns:
the CSW service

setService

protected void setService(String service)
                   throws DiscoveryException
Sets the CSW service.

Parameters:
service - the CSW service
Throws:
DiscoveryException - if the service is not "CSW"

getVersion

protected String getVersion()
Gets the CSW version.

Returns:
the CSW version

setVersion

protected void setVersion(String version)
                   throws DiscoveryException
Sets the CSW version.

Parameters:
version - the CSW version
Throws:
DiscoveryException - if the version is not "2.0.2"

executeQuery

protected void executeQuery(DiscoveryQuery query)
                     throws DiscoveryException
Executes a discovery query.

Parameters:
query - the discovery query to execute
Throws:
DiscoveryException - is an exception occurs during execution

findDiscoverable

protected Discoverable findDiscoverable(String clientName)
Finds the discoverable associated with a client name.

Parameters:
clientName - the client name (or alias)
Returns:
the discoverable (null if none was found);

parseElementSet

protected void parseElementSet(Node parent,
                               XPath xpath,
                               DiscoveryQuery query)
                        throws DiscoveryException,
                               XPathExpressionException
Parses the returnable element set.

Parameters:
parent - the parent node containing the element set
xpath - an XPath to enable queries (properly configured with name spaces)
query - the active discovery query
Throws:
DiscoveryException - if a structural related exception occurs
XPathExpressionException - if an XPath related exception occurs

parsePropertyName

protected Discoverable parsePropertyName(Node parent,
                                         XPath xpath)
                                  throws DiscoveryException,
                                         XPathExpressionException
Parses a parent node for an associated property name.

An exception will be thrown if the property name was invalid.

Parameters:
parent - the parent of the property to locate
xpath - an XPath to enable queries (properly configured with name spaces)
Returns:
a discover-able associated with the property name
Throws:
DiscoveryException - if a structural related exception occurs
XPathExpressionException - if an XPath related exception occurs

ArcGIS Server Geoportal extension
10

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