maito.datacollecting.oaipmh
Class ListRecords

java.lang.Object
  extended by maito.datacollecting.oaipmh.ListRecords

public class ListRecords
extends java.lang.Object

A class that represents an OAI-PMH response with the verb ListRecords. The original raw response from the server can be retrieved through an instance of this this class. The response contains only the record tags.

Author:
Antti Laitinen

Constructor Summary
protected ListRecords(java.lang.String baseURL, java.lang.String metadataPrefix, java.lang.String dateFrom)
          Creates a new ListRecords object.
 
Method Summary
protected  java.lang.String nextPart(int chars)
          Returns a requested amount of characters from the OAI-PMH response.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListRecords

protected ListRecords(java.lang.String baseURL,
                      java.lang.String metadataPrefix,
                      java.lang.String dateFrom)
               throws OAIPMHException
Creates a new ListRecords object. The remote OAI-PMH repository is queried with the given parameters.

Parameters:
baseURL - The base URL for the repository that is to be read without any parameters. Must not be null.
metadataPrefix - metadataPrefix in the OAI-PMH request. Must not be null.
dateFrom - from in the OAI-PMH request. If this is null then no from is included in the OAI-PMH request. This parameter is passed to the request as it is.
Throws:
OAIPMHException - Thrown if anything fails while reading data from the repository.
Method Detail

nextPart

protected java.lang.String nextPart(int chars)
                             throws OAIPMHException
Returns a requested amount of characters from the OAI-PMH response. The characters are returned as a String and extracted from this object's internal buffer so they will no longer be available. The response contains only the record tags from the original response.

Parameters:
chars - The amount of characters that is to be extracted from the response. If the amount of available characters is less than the requested amount then all available characters are returned.
Returns:
Returns the requested amount of characters from the response. If no characters are available or the parameter chars has a negative value, returns null.
Throws:
OAIPMHException