Esri Geoportal Server
1.0

com.esri.gpt.migration.to1
Class RemoteGetDocumentRequest

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by com.esri.gpt.migration.to1.RemoteGetDocumentRequest
All Implemented Interfaces:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler

public class RemoteGetDocumentRequest
extends DefaultHandler

Retrieves a document executing a request against an ArcIMS metadata publish service.


Constructor Summary
RemoteGetDocumentRequest(String serviceUrl, String userName, String password)
          Constructor
 
Method Summary
 void characters(char[] ch, int start, int length)
          Sets text node characters for a SAX element.
 void endElement(String uri, String localName, String qName)
          Ends a SAX element.
 void executeGet(String docUuid)
          Executes a GET_METADATA_DOCUMENT request against an ArcIMS metadata publish service.
protected  void executeRequest(CredentialProvider provider, String serviceUrl, String requestBody)
          Executes an ArcIMS service request and parses the response.
 Timestamp getUpdateDate()
          Gets the update date.
 String getUuid()
          Gets the document uuid.
 String getXml()
          Gets the document xml.
protected  void onEndSaxElement(String lowerCaseTagName, String characters)
          Triggered when a SAX element is ended during the parsing of an axl response.
protected  void onStartSaxElement(String lowerCaseTagName, Attributes attributes)
          Triggered when a SAX element is started during the parsing of an axl response.
protected  void parseAxlResponse(String axlResponse)
          Starts a SAX parser on an ArcIMS axl response.
 void reset()
          Resets the request.
protected  void setUpdateTimestamp(Timestamp updateDate)
          Sets the update date.
protected  void setXml(String xml)
          Sets the document xml.
 void startElement(String uri, String localName, String qName, Attributes attributes)
          Starts a SAX element.
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoteGetDocumentRequest

public RemoteGetDocumentRequest(String serviceUrl,
                                String userName,
                                String password)
Constructor

Parameters:
serviceUrl - the arcims metadata service http endpoint
userName - the arcims metadata service username
password - the arcims metadata service password
Method Detail

getUpdateDate

public Timestamp getUpdateDate()
Gets the update date.

Returns:
the update date

setUpdateTimestamp

protected void setUpdateTimestamp(Timestamp updateDate)
Sets the update date.

Parameters:
updateDate - the update date

getUuid

public String getUuid()
Gets the document uuid.

Returns:
the document uuid

getXml

public String getXml()
Gets the document xml.

Returns:
the document xml

setXml

protected void setXml(String xml)
Sets the document xml.

Parameters:
xml - the document xml

executeGet

public void executeGet(String docUuid)
                throws Exception
Executes a GET_METADATA_DOCUMENT request against an ArcIMS metadata publish service.

Parameters:
docUuid - the metatata document uuid of the record to load
Throws:
Exception
PublishServiceException - if an exception occurs

executeRequest

protected void executeRequest(CredentialProvider provider,
                              String serviceUrl,
                              String requestBody)
                       throws Exception
Executes an ArcIMS service request and parses the response.

Throws:
Exception

parseAxlResponse

protected void parseAxlResponse(String axlResponse)
                         throws ParserConfigurationException,
                                SAXException,
                                IOException
Starts a SAX parser on an ArcIMS axl response.

Parameters:
axlResponse - the ArcIMS axl response
Throws:
ParserConfigurationException - if the exception occurs
SAXException - if the exception occurs
IOException - if the exception occurs

onStartSaxElement

protected void onStartSaxElement(String lowerCaseTagName,
                                 Attributes attributes)
Triggered when a SAX element is started during the parsing of an axl response.

Parameters:
lowerCaseTagName - the lower-case tag name of the element
attributes - the element attributes

reset

public void reset()
Resets the request.


characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws SAXException
Sets text node characters for a SAX element.

Specified by:
characters in interface ContentHandler
Overrides:
characters in class DefaultHandler
Parameters:
ch - the array of characters
start - the starting position within the array
length - the number of characters to read from the array
Throws:
SAXException - if the exception occurs

endElement

public void endElement(String uri,
                       String localName,
                       String qName)
                throws SAXException
Ends a SAX element.
The parser is not namespace aware.

Specified by:
endElement in interface ContentHandler
Overrides:
endElement in class DefaultHandler
Parameters:
uri - the uri namespace for the element
localName - the local name for the element
qName - the qualified name for the element
Throws:
SAXException - if a SAXException occurs

onEndSaxElement

protected void onEndSaxElement(String lowerCaseTagName,
                               String characters)
Triggered when a SAX element is ended during the parsing of an axl response.

Parameters:
lowerCaseTagName - the lower-case tag name of the element
characters - the text node value of the element

startElement

public void startElement(String uri,
                         String localName,
                         String qName,
                         Attributes attributes)
                  throws SAXException
Starts a SAX element.
The parser is not namespace aware.

Specified by:
startElement in interface ContentHandler
Overrides:
startElement in class DefaultHandler
Parameters:
uri - the uri namespace for the element
localName - the local name for the element
qName - the qualified name for the element
attributes - the attributes for the element
Throws:
SAXException - if a SAXException occurs

Esri Geoportal Server
1.0

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