com.novell.nds.dirxml.driver.delimitedtext
Interface InputSorter

All Superinterfaces:
Extension

public interface InputSorter
extends Extension

This interface allows you to implement a class that will receive notification of one or more new input files that the publisher channel has found to process, and allow you to determine the order in which the input files should be processed.

In order for the driver to find the appropriate class that implements this interface, the DirXML administrator (implementor) needs to configure the <publisher-options> section of the driver configuration by adding a line similar to the following:

<input-sorter display-name="InputSorter Class">com.acme.MyInputSorter</input-sorter>

If you also add a line similar to the following, the string it contains will be passed to the init method of the InputSorter:

<input-sorter-params display-name="InputSorter init string">MY CONFIG DATA</input-sorter-params>

If the supplied value actually represents a class that is in a .jar file in the lib directory, that class will be used to determine the processing order of the input files.

See Also:
PreProcessor, PostProcessor, InputSource

Method Summary
 java.io.File[] sortInputFiles(java.io.File[] inputFiles)
          Invoked whenever the pubisher finds new input files to process.
 
Methods inherited from interface com.novell.nds.dirxml.driver.delimitedtext.Extension
init
 

Method Detail

sortInputFiles

public java.io.File[] sortInputFiles(java.io.File[] inputFiles)
                              throws StatusException,
                                     java.lang.Exception
Invoked whenever the pubisher finds new input files to process. This method should sort and return the file names in the order that you want the publisher channel to process the input files.

If you anticipate that during the time it takes the publisher to process the first file, there may be more input files that you want to consider in your sorting, then this method may return an array of size 1, so that whenever the publisher finishes processing a single file then all of the input files are again evaluated.

Parameters:
inputFiles - an array of File objects representing the input files to be processed by the publisher channel.
Returns:
a sorted array of File objects representing the input files to be processed by the publisher channel.
Throws:
StatusException - Throw this if you want to report an error all the way back to the DirXML engine.
java.lang.Exception - If you throw any other exception, it will get reported back to the engine as an error status level and printed in red on the DSTrace utility.