Class HarvesterVerb
java.lang.Object
edu.ucsb.nceas.metacat.oaipmh.harvester.HarvesterVerb
- Direct Known Subclasses:
GetRecord
,Identify
,ListIdentifiers
,ListMetadataFormats
,ListRecords
,ListSets
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
-
Constructor Summary
ConstructorDescriptionMock object creator (for unit testing purposes)HarvesterVerb
(String requestURL) Performs the OAI request -
Method Summary
Modifier and TypeMethodDescriptionGet the OAI response as a DOM objectGet the OAI errorsgetNodeList
(String xpath) Get a NodeList containing the nodes in the response DOM for the specified xpathGet the OAI request URL for this responseGet the xsi:schemaLocation for the OAI responsegetSingleString
(String xpath) Get the String value for the given XPath location in the response DOMvoid
runVerb()
Preforms the OAI request for this OAI-PMH verbtoString()
Transform the document content to a string and return it.
-
Field Details
-
SCHEMA_LOCATION_V2_0
- See Also:
-
-
Constructor Details
-
HarvesterVerb
public HarvesterVerb()Mock object creator (for unit testing purposes) -
HarvesterVerb
public HarvesterVerb(String requestURL) throws IOException, ParserConfigurationException, SAXException, TransformerException Performs the OAI request- Parameters:
requestURL
-- Throws:
IOException
ParserConfigurationException
SAXException
TransformerException
-
-
Method Details
-
getDocument
Get the OAI response as a DOM object- Returns:
- the DOM for the OAI response
-
getErrors
Get the OAI errors- Returns:
- a NodeList of /oai:OAI-PMH/oai:error elements
- Throws:
TransformerException
-
getNodeList
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:
TransformerException
-
getRequestURL
Get the OAI request URL for this response- Returns:
- the OAI request URL as a String
-
getSchemaLocation
Get the xsi:schemaLocation for the OAI response- Returns:
- the xsi:schemaLocation value
-
getSingleString
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:
TransformerException
-
runVerb
public void runVerb() throws IOException, ParserConfigurationException, SAXException, TransformerExceptionPreforms the OAI request for this OAI-PMH verb -
toString
Transform the document content to a string and return it.
-