org.enableit.db.darrt
Interface FileProcessor

All Known Implementing Classes:
DarHandler, DataHandler

public interface FileProcessor

Defines a common file handler interface to decouple the file receiver from the application processing.

For example a Struts Action org.enableit.db.darrt.web.UploadAction.class has been written to allow a user to upload files through a web interface. But a variety of possible functionality is required to process the file once received. This interface is implemented by the processor, which the receiver delegates to as appropriate. How the receiver obtains the processor is undefined, though in the example Action it is via a JNDI lookup.

Author:
Tim Stephenson

Method Summary
 void process(java.io.File file, java.lang.String fileType)
          Process the specified file.
 void setProvider(org.enableit.db.beans.Provider provider)
          Specify database connection details.
 

Method Detail

process

public void process(java.io.File file,
                    java.lang.String fileType)
             throws ConfigurationException,
                    DBException,
                    java.rmi.RemoteException
Process the specified file.

Parameters:
file - The file to upload.
fileType - A file type that will be recognised by the implentation. Typically this should refer to the type of the data in the file not the file's format or mime type, which the implementation is expected to detect for itself (for example by file extension or using the Java Activation Framework).
Throws:
ConfigurationException - If the fileType parameter is unrecognised
DBException - If the handling of the file goes wrong in some recoverable way.
java.rmi.RemoteException - If some system exception occurs within an implementing class that is running in a distributed environment (i.e. an EJB)

setProvider

public void setProvider(org.enableit.db.beans.Provider provider)
                 throws ConfigurationException,
                        DBException,
                        java.rmi.RemoteException
Specify database connection details.

Parameters:
provider - Provider to be used by the FileProcessor.
Throws:
ConfigurationException - If this FileProcessor does not expect a provider.
DBException - If the handling of the file goes wrong in some recoverable way.
java.rmi.RemoteException - If some system exception occurs within an implementing class that is running in a distributed environment (i.e. an EJB)


Copyright © 1999-2004 enableIT.org. All Rights Reserved.