DLESE Tools
v1.6.0

org.dlese.dpc.dds.ndr
Class NDRIndexer

java.lang.Object
  extended by org.dlese.dpc.dds.ndr.NDRIndexer
All Implemented Interfaces:
EventListener, ItemIndexer

public class NDRIndexer
extends Object
implements ItemIndexer

Indexes and configures collections from the NSDL Data Repository (NDR).

Author:
John Weatherley

Constructor Summary
NDRIndexer()
          Constructor for the NDRIndexer object
 
Method Summary
static String getDateStamp()
          Return a string for the current time and date, sutiable for display in log files and output to standout:
 void indexCollections(String collectionKey)
          Index a collection or all collections.
 void indexingActionRequested(IndexingEvent indexingEvent)
          Perform indexing when requested
 void indexItemRecords(MetadataProviderReader mdp, String collectionKey, String format)
          Gets the itemRecords for a given collection starting from the MetadataProvider.
 void setConfigDirectory(File configDir)
          Sets the configDirectory attribute of the NDRIndexer object
 void setDebug(boolean db)
          Sets the debug attribute of the NDRIndexer object
 void updateCollections()
          Update the collections that are configured in DDS.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NDRIndexer

public NDRIndexer()
Constructor for the NDRIndexer object

Method Detail

setConfigDirectory

public void setConfigDirectory(File configDir)
                        throws Exception
Sets the configDirectory attribute of the NDRIndexer object

Specified by:
setConfigDirectory in interface ItemIndexer
Parameters:
configDir - The new configDirectory value
Throws:
Exception - If error

indexingActionRequested

public void indexingActionRequested(IndexingEvent indexingEvent)
                             throws Exception
Perform indexing when requested

Specified by:
indexingActionRequested in interface ItemIndexer
Parameters:
indexingEvent - The event fired
Throws:
Exception - If error

indexCollections

public void indexCollections(String collectionKey)
                      throws Exception
Index a collection or all collections.

Parameters:
collectionKey - The collection key/id, or null for all
Throws:
Exception - If error

updateCollections

public void updateCollections()
                       throws Exception
Update the collections that are configured in DDS.

Throws:
Exception - If error

indexItemRecords

public void indexItemRecords(MetadataProviderReader mdp,
                             String collectionKey,
                             String format)
Gets the itemRecords for a given collection starting from the MetadataProvider.

Parameters:
mdp - MetadataProviderReader
collectionKey - The collection key
format - The format to index for this collection, "canonical_nsdl_dc" for canonical

getDateStamp

public static String getDateStamp()
Return a string for the current time and date, sutiable for display in log files and output to standout:

Returns:
The dateStamp value

setDebug

public final void setDebug(boolean db)
Sets the debug attribute of the NDRIndexer object

Parameters:
db - The new debug value

DLESE Tools
v1.6.0