co.uk.hjcs.canyon.provider
Interface CanyonInputProvider

All Known Implementing Classes:
DefaultFileProvider, DirectoryFileProvider, PropertyFileProvider, ResourceFileProvider

public interface CanyonInputProvider

This class represents the way Canyon gets access to data input Out of the box Canyon gives 5 options for input File, Resource (classpath lookup), Property (environment or runtime variable) or Directory (all the files in a particular directory) or Provider (your custom implementation of this class) By creating your own implementation of this class it is possible to create unlimited ways of obtaining input data. In the unlikely event you data is coming from a database, network stream or even a console you can overwrite this class and create the functionality required. To select the correct provider simply use the correct attribute in the input tag of the canyon.cfg.xml file. For file

 <input file="<absolute path to file>"/>
 
For resource
 <input resource="<logical path to resource>"/>
 
For property
 <input property="<property name>"/>
 
The value of the property should be the absolute path to the input file For directory
 <input directory="<absolute path to directory>"/>
 
For custom
 <input provider="<the full class name of your implementation>"/>
 
NB: The custom implementation must be in the class path at execution time

Author:
HJC Solutions Ltd (http://canyon.hjcsolutions.co.uk)

Method Summary
 java.io.InputStream[] getInputStreams(java.util.Properties properties)
          Returns an array of input streams to be consumed as input configuration or data
 void validate(java.util.Properties properties)
          Is called to validate the input streams, so that Canyon can operate on them
 

Method Detail

getInputStreams

java.io.InputStream[] getInputStreams(java.util.Properties properties)
Returns an array of input streams to be consumed as input configuration or data

Parameters:
properties - - the properties defined in the configuration
Returns:
- the input stream to read objects from

validate

void validate(java.util.Properties properties)
              throws CanyonException
Is called to validate the input streams, so that Canyon can operate on them

Parameters:
properties - - the properties defined in the configuration
Throws:
CanyonException