ArcGIS Server Geoportal extension
10

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

java.lang.Object
  extended by com.esri.gpt.control.csw.inbound202.DiscoveryResponse

public class DiscoveryResponse
extends Object

Provides functionality for constructing the response to a CSW request.


Constructor Summary
protected DiscoveryResponse(RetrievalOptions retrievalOptions)
          Default constructor.
protected DiscoveryResponse(String cswResponse)
          Overloaded constructor.
 
Method Summary
protected  void appendDiscoveredRecords(Element parent, DiscoveryQuery query)
          Creates and appends the discovered record elements to the XML document.
protected  void appendSearchResultsElement(Element parent, DiscoveryQuery query)
          Creates and appends the SearchResults element to the XML document.
 String getCswResponse()
          Gets the CSW response.
 String getOutputFormat()
          Gets the media type of the response message.
protected  Document getResponseDom()
          Gets the XML response document under construction.
protected  Element newResponseDom(String rootName)
          Creates a new XML document for response construction.
protected  void onComplete()
          Serializes the XML response document to a string when construction is complete.
protected  void setCswResponse(String response)
          Sets the CSW response.
protected  String toIso8601(Timestamp timestamp)
          Converts a Timestamp to ISO-8601 format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DiscoveryResponse

protected DiscoveryResponse(RetrievalOptions retrievalOptions)
Default constructor.


DiscoveryResponse

protected DiscoveryResponse(String cswResponse)
Overloaded constructor.

Method Detail

getCswResponse

public 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

getOutputFormat

public String getOutputFormat()
Gets the media type of the response message.

Returns:
the media type of the response

getResponseDom

protected Document getResponseDom()
Gets the XML response document under construction.

Returns:
the XML response document

appendDiscoveredRecords

protected void appendDiscoveredRecords(Element parent,
                                       DiscoveryQuery query)
Creates and appends the discovered record elements to the XML document.

Parameters:
parent - the parent element that will hold the records
query - the discovery query

appendSearchResultsElement

protected void appendSearchResultsElement(Element parent,
                                          DiscoveryQuery query)
Creates and appends the SearchResults element to the XML document.
Discovered records are also created and appended.

Parameters:
parent - the parent element that will hold the results (typically the root)
query - the discovery query

newResponseDom

protected Element newResponseDom(String rootName)
                          throws DiscoveryException
Creates a new XML document for response construction.

Parameters:
rootName - the name of the root element
Returns:
the root element
Throws:
DiscoveryException - if the document fails to create

onComplete

protected void onComplete()
                   throws DiscoveryException
Serializes the XML response document to a string when construction is complete.

Throws:
DiscoveryException - if the document fails to serialize

toIso8601

protected String toIso8601(Timestamp timestamp)
Converts a Timestamp to ISO-8601 format.

Parameters:
timestamp - the timestamp
Returns:
the formatted restlt

ArcGIS Server Geoportal extension
10

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