de.phleisch.app.itsucks.processing
Interface DataProcessor

All Known Implementing Classes:
AbstractDataParser, AbstractDataProcessor, ContentParser, FilterFileSizeProcessor, HtmlParser, HttpRedirectorProcessor, PersistenceProcessor, SeekDataProcessorWrapper

public interface DataProcessor

A data processor is a single component in a processing chain which processes the data which is lead through.

Author:
olli

Method Summary
 void abort()
          Will be called when the chain is aborted.
 void finish()
          Shutdown the data processor.
 DataProcessorInfo getInfo()
          Returns informations about the processor and its features.
 void init()
          Initializes the data processor.
 DataChunk process(DataChunk pDataChunk)
          Processes the given data chunk.
 void resumeAt(long pByteOffset)
          Resumes the processing at the given position.
 void rollback()
          Will be called when the chain is unexpectly aborted.
 void setProcessorChain(DataProcessorChain pChain)
          Sets the processor chain the processor is a part of.
 boolean supports(Job pJob)
          Returns true if this processor supports the given type of job.
 

Method Detail

supports

boolean supports(Job pJob)
Returns true if this processor supports the given type of job.

Parameters:
pJob -
Returns:

init

void init()
          throws ProcessingException
Initializes the data processor. (Create buffers, open file handles etc.)

Throws:
ProcessingException

finish

void finish()
Shutdown the data processor. (Release buffers, file handles etc.)

Throws:
java.lang.Exception

abort

void abort()
Will be called when the chain is aborted. After calling abort, finish is also called.


rollback

void rollback()
Will be called when the chain is unexpectly aborted. After calling rollback, finish is also called.


resumeAt

void resumeAt(long pByteOffset)
Resumes the processing at the given position.

Parameters:
pByteOffset - The offset position in bytes.

process

DataChunk process(DataChunk pDataChunk)
                  throws ProcessingException
Processes the given data chunk.

Parameters:
pDataChunk -
Returns:
The pDataChunk pointer or a new pointer to changed data.
Throws:
ProcessingException

getInfo

DataProcessorInfo getInfo()
Returns informations about the processor and its features.


setProcessorChain

void setProcessorChain(DataProcessorChain pChain)
Sets the processor chain the processor is a part of.

Parameters:
pChain -


Copyright © 2010. All Rights Reserved.