de.phleisch.app.itsucks.processing.download.impl
Class PersistenceProcessor

java.lang.Object
  extended by de.phleisch.app.itsucks.processing.impl.AbstractDataProcessor
      extended by de.phleisch.app.itsucks.processing.download.impl.PersistenceProcessor
All Implemented Interfaces:
DataProcessor

public class PersistenceProcessor
extends AbstractDataProcessor
implements DataProcessor

An data processor which saves the data in an file on the disk.

Author:
olli

Field Summary
 
Fields inherited from class de.phleisch.app.itsucks.processing.impl.AbstractDataProcessor
mChain
 
Constructor Summary
PersistenceProcessor()
           
 
Method Summary
 void abort()
          Will be called when the chain is aborted.
protected  void closeFile(boolean pDeleteFile)
           
 void finish()
          Shutdown the data processor.
 DataProcessorInfo getInfo()
          Returns informations about the processor and its features.
 void init()
          Initializes the data processor.
 boolean isPreserveDataOnRollback()
          Gets if the persistence processor should preserve the file in case of an chain error.
 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 setPreserveDataOnRollback(boolean pPreserveDataOnRollback)
          Sets if the persistence processor should preserve the file in case of an chain error.
 boolean supports(Job pJob)
          Returns true if this processor supports the given type of job.
 
Methods inherited from class de.phleisch.app.itsucks.processing.impl.AbstractDataProcessor
getProcessorChain, setProcessorChain
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.phleisch.app.itsucks.processing.DataProcessor
setProcessorChain
 

Constructor Detail

PersistenceProcessor

public PersistenceProcessor()
Method Detail

supports

public boolean supports(Job pJob)
Description copied from interface: DataProcessor
Returns true if this processor supports the given type of job.

Specified by:
supports in interface DataProcessor
Specified by:
supports in class AbstractDataProcessor
Returns:

init

public void init()
          throws ProcessingException
Description copied from interface: DataProcessor
Initializes the data processor. (Create buffers, open file handles etc.)

Specified by:
init in interface DataProcessor
Overrides:
init in class AbstractDataProcessor
Throws:
ProcessingException

resumeAt

public void resumeAt(long pByteOffset)
Description copied from interface: DataProcessor
Resumes the processing at the given position.

Specified by:
resumeAt in interface DataProcessor
Parameters:
pByteOffset - The offset position in bytes.

process

public DataChunk process(DataChunk pDataChunk)
                  throws ProcessingException
Description copied from interface: DataProcessor
Processes the given data chunk.

Specified by:
process in interface DataProcessor
Returns:
The pDataChunk pointer or a new pointer to changed data.
Throws:
ProcessingException

finish

public void finish()
Description copied from interface: DataProcessor
Shutdown the data processor. (Release buffers, file handles etc.)

Specified by:
finish in interface DataProcessor
Overrides:
finish in class AbstractDataProcessor

abort

public void abort()
Description copied from interface: DataProcessor
Will be called when the chain is aborted. After calling abort, finish is also called.

Specified by:
abort in interface DataProcessor
Overrides:
abort in class AbstractDataProcessor

rollback

public void rollback()
Description copied from interface: DataProcessor
Will be called when the chain is unexpectly aborted. After calling rollback, finish is also called.

Specified by:
rollback in interface DataProcessor
Overrides:
rollback in class AbstractDataProcessor

closeFile

protected void closeFile(boolean pDeleteFile)

isPreserveDataOnRollback

public boolean isPreserveDataOnRollback()
Gets if the persistence processor should preserve the file in case of an chain error.


setPreserveDataOnRollback

public void setPreserveDataOnRollback(boolean pPreserveDataOnRollback)
Sets if the persistence processor should preserve the file in case of an chain error.

Parameters:
pPreserveDataWhenRollback -

getInfo

public DataProcessorInfo getInfo()
Description copied from interface: DataProcessor
Returns informations about the processor and its features.

Specified by:
getInfo in interface DataProcessor


Copyright © 2010. All Rights Reserved.