de.phleisch.app.itsucks.processing
Interface DataProcessorChain

All Known Implementing Classes:
DataProcessorChainImpl

public interface DataProcessorChain

This class holds an chain of data processors and tunnels the data through all registered processors in the given order.

Author:
olli

Method Summary
 void addDataProcessor(DataProcessor pDataProcessor)
          Adds an data processor at the end of the chain.
 void addDataProcessor(java.util.List<DataProcessor> pProcessorsForJob)
          Adds an list of data processors at the end of the chain.
 boolean canResume()
          Checks if all processors in the chain are supporting resuming.
 boolean containsConsumer()
          Returns if the chain contains at least one consumer.
 void finish()
          Finalizes the chain and all processors in it.
 java.util.List<DataProcessor> getDataProcessors()
          Returns a list with all data processors in the chain.
 java.io.InputStream getInputStream()
           
 Job getJob()
          Gets the job which the chain is assigned to.
 JobManager getJobManager()
          Gets the job manager.
 long getProcessedBytes()
          Gets the already processed bytes in the chain.
 void init()
          Initializes all the chain and all processors in it.
 void replaceDataProcessor(DataProcessor pOldDataProcessor, DataProcessor pNewDataProcessor)
          Replaces an data processor in the chain.
 void resumeAt(long pResumeOffset)
          Advises all processors to resume at the given position.
 void run()
          Starts the data retriever and processes the data in the processor chain.
 void setInputStream(java.io.InputStream pInputStream)
           
 void setJob(Job pJob)
          Sets the job which the chain is assigned to.
 void setJobManager(JobManager pJobManager)
          Sets the job manager.
 int size()
          Returns the count of registerd processors.
 

Method Detail

addDataProcessor

void addDataProcessor(java.util.List<DataProcessor> pProcessorsForJob)
Adds an list of data processors at the end of the chain.

Parameters:
pProcessorsForJob -

addDataProcessor

void addDataProcessor(DataProcessor pDataProcessor)
Adds an data processor at the end of the chain.

Parameters:
pDataProcessor -

replaceDataProcessor

void replaceDataProcessor(DataProcessor pOldDataProcessor,
                          DataProcessor pNewDataProcessor)
Replaces an data processor in the chain.

Parameters:
pOldDataProcessor -
pNewDataProcessor -

getDataProcessors

java.util.List<DataProcessor> getDataProcessors()
Returns a list with all data processors in the chain.

Returns:

init

void init()
          throws ProcessingException
Initializes all the chain and all processors in it.

Throws:
ProcessingException

run

void run()
         throws java.io.IOException,
                ProcessingException
Starts the data retriever and processes the data in the processor chain.

Throws:
java.io.IOException
ProcessingException

finish

void finish()
Finalizes the chain and all processors in it.


canResume

boolean canResume()
Checks if all processors in the chain are supporting resuming.

Returns:

resumeAt

void resumeAt(long pResumeOffset)
Advises all processors to resume at the given position.

Parameters:
pResumeOffset -

setInputStream

void setInputStream(java.io.InputStream pInputStream)

getInputStream

java.io.InputStream getInputStream()

setJobManager

void setJobManager(JobManager pJobManager)
Sets the job manager.

Parameters:
pJobManager -

getJobManager

JobManager getJobManager()
Gets the job manager.

Returns:

setJob

void setJob(Job pJob)
Sets the job which the chain is assigned to.

Parameters:
pJob -

getJob

Job getJob()
Gets the job which the chain is assigned to.

Returns:

size

int size()
Returns the count of registerd processors.

Returns:

getProcessedBytes

long getProcessedBytes()
Gets the already processed bytes in the chain.

Returns:

containsConsumer

boolean containsConsumer()
Returns if the chain contains at least one consumer.

Returns:


Copyright © 2010. All Rights Reserved.