edu.ucsb.nceas.metacat.oaipmh.harvester

## Class HarvesterVerb

- java.lang.Object
- - edu.ucsb.nceas.metacat.oaipmh.harvester.HarvesterVerb

- Direct Known Subclasses:
    GetRecord, Identify, ListIdentifiers, ListMetadataFormats, ListRecords, ListSets

      public abstract class HarvesterVerb
      extends java.lang.Object

  HarvesterVerb is the parent class for each of the OAI verbs.
  Author:
    Duane Costa, University of New Mexico, LTER Network Office, Jeffrey A. Young, OCLC Online Computer Library Center

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `SCHEMA_LOCATION_V2_0`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `HarvesterVerb()` Mock object creator (for unit testing purposes)
    `HarvesterVerb(java.lang.String requestURL)` Performs the OAI request

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `org.w3c.dom.Document` | `getDocument()` Get the OAI response as a DOM object
    `org.w3c.dom.NodeList` | `getErrors()` Get the OAI errors
    `org.w3c.dom.NodeList` | `getNodeList(java.lang.String xpath)` Get a NodeList containing the nodes in the response DOM for the specified xpath
    `java.lang.String` | `getRequestURL()` Get the OAI request URL for this response
    `java.lang.String` | `getSchemaLocation()` Get the xsi:schemaLocation for the OAI response
    `java.lang.String` | `getSingleString(java.lang.String xpath)` Get the String value for the given XPath location in the response DOM
    `void` | `runVerb()` Preforms the OAI request for this OAI-PMH verb
    `java.lang.String` | `toString()` Transform the document content to a string and return it.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### SCHEMA_LOCATION_V2_0

          public static final java.lang.String SCHEMA_LOCATION_V2_0

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### HarvesterVerb

          public HarvesterVerb()

      Mock object creator (for unit testing purposes)

    - #### HarvesterVerb

          public HarvesterVerb(java.lang.String requestURL)
                        throws java.io.IOException,
                               javax.xml.parsers.ParserConfigurationException,
                               org.xml.sax.SAXException,
                               javax.xml.transform.TransformerException

      Performs the OAI request
      Parameters:
        `requestURL` -
      Throws:
        `java.io.IOException`
        `javax.xml.parsers.ParserConfigurationException`
        `org.xml.sax.SAXException`
        `javax.xml.transform.TransformerException`

  - ### Method Detail

    - #### getDocument

          public org.w3c.dom.Document getDocument()

      Get the OAI response as a DOM object
      Returns:
        the DOM for the OAI response

    - #### getErrors

          public org.w3c.dom.NodeList getErrors()
                                         throws javax.xml.transform.TransformerException

      Get the OAI errors
      Returns:
        a NodeList of /oai:OAI-PMH/oai:error elements
      Throws:
        `javax.xml.transform.TransformerException`

    - #### getNodeList

          public org.w3c.dom.NodeList getNodeList(java.lang.String xpath)
                                           throws javax.xml.transform.TransformerException

      Get a NodeList containing the nodes in the response DOM for the specified xpath
      Parameters:
        `xpath` -
      Returns:
        the NodeList for the xpath into the response DOM
      Throws:
        `javax.xml.transform.TransformerException`

    - #### getRequestURL

          public java.lang.String getRequestURL()

      Get the OAI request URL for this response
      Returns:
        the OAI request URL as a String

    - #### getSchemaLocation

          public java.lang.String getSchemaLocation()

      Get the xsi:schemaLocation for the OAI response
      Returns:
        the xsi:schemaLocation value

    - #### getSingleString

          public java.lang.String getSingleString(java.lang.String xpath)
                                           throws javax.xml.transform.TransformerException

      Get the String value for the given XPath location in the response DOM
      Parameters:
        `xpath` -
      Returns:
        a String containing the value of the XPath location.
      Throws:
        `javax.xml.transform.TransformerException`

    - #### runVerb

          public void runVerb()
                       throws java.io.IOException,
                              javax.xml.parsers.ParserConfigurationException,
                              org.xml.sax.SAXException,
                              javax.xml.transform.TransformerException

      Preforms the OAI request for this OAI-PMH verb
      Throws:
        `java.io.IOException`
        `javax.xml.parsers.ParserConfigurationException`
        `org.xml.sax.SAXException`
        `javax.xml.transform.TransformerException`

    - #### toString

          public java.lang.String toString()

      Transform the document content to a string and return it.
      Overrides:
        `toString` in class `java.lang.Object`
      Returns:
        returnString - the string that results from transforming the document

Copyright © 2020 Regents of the University of California. All Rights Reserved.