org.gcube.common
Class Harvester

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

public class Harvester
extends Object

Version:
0.1
Author:
David Uvalle, david.uvalle@gmail.com

Constructor Summary
Harvester(String baseUrl)
          Constructs the harvester using a repository URL.
 
Method Summary
 Record getRecord(String identifier, String metadataPrefix)
          Returns a Record object harvested by his identifier using 'oai_dc' as metadataPrefix
 ResumptionToken getResumptionToken()
           
 Identify identify()
          Returns an Identify object containing information about the OAI respository.
 List<Header> listIdentifiers(String metadataPrefix)
          Returns a List of Header type.
 List<Header> listIdentifiers(String from, String until, String set, String metadataPrefix)
          Returns a List of Header type, using selective harvesting.
 List<MetadataFormat> listMetadataFormats()
          Returns a List of MetadataFormats supported by the repository.
 List<MetadataFormat> listMetadataFormats(String identifier)
          Returns a List of MetadataFormats from a given identifier.
 RecordIterator listRecords(String metadataPrefix)
          Harvest all the Records from a repository
 RecordIterator listRecords(String from, String until, String set, String metadataPrefix)
          Selective harvest of Records from a repository
 List<Set> listSets()
          Returns a List of Set type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Harvester

public Harvester(String baseUrl)
          throws Exception
Constructs the harvester using a repository URL.

Parameters:
baseUrl - A repository valid URL.
Throws:
Exception
Method Detail

identify

public Identify identify()
                  throws Exception
Returns an Identify object containing information about the OAI respository.

Returns:
A Identify object.
Throws:
Exception

listIdentifiers

public List<Header> listIdentifiers(String from,
                                    String until,
                                    String set,
                                    String metadataPrefix)
                             throws Exception
Returns a List of Header type, using selective harvesting.

Parameters:
from - A date.
until - A date.
set - A set name supported by the respository.
Returns:
List
Throws:
Exception

listIdentifiers

public List<Header> listIdentifiers(String metadataPrefix)
                             throws Exception
Returns a List of Header type.

Returns:
A List of headers.
Throws:
Exception

listMetadataFormats

public List<MetadataFormat> listMetadataFormats()
                                         throws Exception
Returns a List of MetadataFormats supported by the repository.

Returns:
A List of MetadataFormats.
Throws:
Exception

listMetadataFormats

public List<MetadataFormat> listMetadataFormats(String identifier)
                                         throws Exception
Returns a List of MetadataFormats from a given identifier.

Parameters:
identifier - valid OAI document identifier.
Returns:
List
Throws:
Exception

listSets

public List<Set> listSets()
                   throws Exception
Returns a List of Set type.

Returns:
List
Throws:
Exception

getRecord

public Record getRecord(String identifier,
                        String metadataPrefix)
                 throws Exception
Returns a Record object harvested by his identifier using 'oai_dc' as metadataPrefix

Parameters:
identifier - A OAI document identifier.
Returns:
Record
Throws:
Exception

listRecords

public RecordIterator listRecords(String from,
                                  String until,
                                  String set,
                                  String metadataPrefix)
                           throws Exception
Selective harvest of Records from a repository

Parameters:
from - A date.
until - A date.
set - A set supported by the repository.
Returns:
RecordIterator
Throws:
Exception

listRecords

public RecordIterator listRecords(String metadataPrefix)
                           throws FileNotFoundException,
                                  Exception
Harvest all the Records from a repository

Returns:
RecordIterator
Throws:
FileNotFoundException
Exception

getResumptionToken

public ResumptionToken getResumptionToken()
                                   throws Exception
Throws:
Exception


Copyright © 2013. All Rights Reserved.