de.pangaea.metadataportal.harvester
Class Rebuilder

java.lang.Object
  extended by de.pangaea.metadataportal.harvester.Harvester
      extended by de.pangaea.metadataportal.harvester.Rebuilder

public class Rebuilder
extends Harvester

Index rebuilder implemented as harvester that reads all documents from an index and pushes them back into the index. Only the XML blobs and control fields are read, all other info is rebuild like in the normal harvester. This helps during restructuring the index fields. This can be done without re-harvesting from the original metadata providers. This class is called from command line or using Harvester.runHarvester(de.pangaea.metadataportal.config.Config, java.lang.String) with this class as harvester class parameter.

Author:
Uwe Schindler

Field Summary
 
Fields inherited from class de.pangaea.metadataportal.harvester.Harvester
fromDateReference, harvestCount, harvestMessageStep, iconfig, index, log
 
Constructor Summary
Rebuilder()
           
 
Method Summary
 void close(boolean cleanShutdown)
          Closes harvester.
protected  MetadataDocument createMetadataDocumentInstance()
          Creates an instance of MetadataDocument and initializes it with the index config.
 void harvest()
          This method is called by the harvester after Harvester.open(de.pangaea.metadataportal.config.SingleIndexConfig)'ing it.
static void main(String[] args)
           
 void open(SingleIndexConfig iconfig)
          Opens harvester for harvesting documents into the index described by the given SingleIndexConfig.
 
Methods inherited from class de.pangaea.metadataportal.harvester.Harvester
addDocument, enumerateValidHarvesterPropertyNames, getValidHarvesterPropertyNames, isClosed, isDocumentOutdated, isDocumentOutdated, runHarvester, runHarvester, setHarvestingDateReference
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Rebuilder

public Rebuilder()
Method Detail

main

public static void main(String[] args)

open

public void open(SingleIndexConfig iconfig)
          throws Exception
Description copied from class: Harvester
Opens harvester for harvesting documents into the index described by the given SingleIndexConfig. Opens Harvester.index for usage in Harvester.harvest() method.

Overrides:
open in class Harvester
Throws:
Exception - if an exception occurs during opening (various types of exceptions can be thrown).

close

public void close(boolean cleanShutdown)
           throws Exception
Description copied from class: Harvester
Closes harvester. All ressources are freed and the Harvester.index is closed.

Overrides:
close in class Harvester
Parameters:
cleanShutdown - enables writing of status information to the index for the next harvesting. If an error occured during harvesting this should not be done.
Throws:
Exception - if an exception occurs during closing (various types of exceptions can be thrown). Exceptions can be thrown asynchronous and may not affect the currect document.

createMetadataDocumentInstance

protected MetadataDocument createMetadataDocumentInstance()
Description copied from class: Harvester
Creates an instance of MetadataDocument and initializes it with the index config. This method should be overwritten, if a harvester uses another class.

Overrides:
createMetadataDocumentInstance in class Harvester

harvest

public void harvest()
             throws Exception
Description copied from class: Harvester
This method is called by the harvester after Harvester.open(de.pangaea.metadataportal.config.SingleIndexConfig)'ing it. Overwrite this method in your harvester class. This method should harvest files from somewhere, generate MetadataDocuments and add them with Harvester.addDocument(de.pangaea.metadataportal.harvester.MetadataDocument).

Specified by:
harvest in class Harvester
Throws:
Exception - of any type.


Copyright ©2007-2009 panFMP Developers c/o Uwe Schindler