org.gcube.common
Class OAIRecordList

java.lang.Object
  extended by org.gcube.common.OAIRecordList

public class OAIRecordList
extends Object

This class represents a list of OAI Records, as returned by the ListRecords or ListIdentifiers OAI requests. This class is similar to a read-only, forward-only database cursor. It will automatically handle resumptionTokens and any other flow control used by a repository, such as HTTP redirects or retries. This object is returned either by the OAIRepository.ListIdentifiers or the OAIRepository.ListRecords methods.


Constructor Summary
OAIRecordList()
          Constructs an empty list of OAI records.
 
Method Summary
 void close()
           
protected  void frndSetMetadataPrefix(String meta)
          Purpose: set the metadata prefix used to build this list of records
protected  void frndSetOAIResumptionStream(OAIResumptionStream rs)
          Purpose: set the resumption stream associated with the list
 int getCompleteSize()
          Return the number of records in the complete set (-1 if this number is unknown)
 int getCurrentIndex()
          Return the index of the current item in the list (0 to CompleteListSize-1)
 OAIRecord getCurrentItem()
          Returns and OAIRecord object for the current record in the list.
 OAIRepository getOAIRepository()
          Returns the OAIRepository object from which this list was created.
 boolean isListValid()
          Returns true if the record list appears to be valid (well-formed, and if the Validation if Very Strict also valid according to the XML Schemas); if the Validation is Loose and the record is not well-formed, false is returned.
 boolean moreItems()
          Returns true if there are more records in the record list; else false.
 void moveNext()
          Moves the cursor location to the next record in the list.
 void requery()
          This will reset the entire list to the beginning, redoing the query from scratch.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OAIRecordList

public OAIRecordList()
Constructs an empty list of OAI records.

Method Detail

getCurrentItem

public OAIRecord getCurrentItem()
Returns and OAIRecord object for the current record in the list.


getCurrentIndex

public int getCurrentIndex()
                    throws OAIException
Return the index of the current item in the list (0 to CompleteListSize-1)

Throws:
OAIException

getCompleteSize

public int getCompleteSize()
                    throws OAIException
Return the number of records in the complete set (-1 if this number is unknown)

Throws:
OAIException

isListValid

public boolean isListValid()
Returns true if the record list appears to be valid (well-formed, and if the Validation if Very Strict also valid according to the XML Schemas); if the Validation is Loose and the record is not well-formed, false is returned.


moreItems

public boolean moreItems()
                  throws OAIException
Returns true if there are more records in the record list; else false.

Throws:
OAIException

moveNext

public void moveNext()
              throws OAIException
Moves the cursor location to the next record in the list.

Throws:
OAIException

getOAIRepository

public OAIRepository getOAIRepository()
Returns the OAIRepository object from which this list was created.


requery

public void requery()
             throws OAIException
This will reset the entire list to the beginning, redoing the query from scratch.

Throws:
OAIException

frndSetOAIResumptionStream

protected void frndSetOAIResumptionStream(OAIResumptionStream rs)
                                   throws OAIException
Purpose: set the resumption stream associated with the list

Throws:
OAIException

frndSetMetadataPrefix

protected void frndSetMetadataPrefix(String meta)
Purpose: set the metadata prefix used to build this list of records


close

public void close()


Copyright © 2013. All Rights Reserved.