com.jalios.jcms.fileprocessor.processingmanagement
Class ProcessingData

java.lang.Object
  extended by com.jalios.jcms.fileprocessor.processingmanagement.ProcessingData

public class ProcessingData
extends Object

Holder class for Files to be processed and some resulting information.


Nested Class Summary
static class ProcessingData.Type
           
 
Field Summary
static String REVISION
           
 
Constructor Summary
ProcessingData(Repository repository, DirectoryScanner scanner)
           
ProcessingData(Repository repository, File file, FileActionComponent.Operation operation)
           
ProcessingData(Repository repository, Set<File> fileSet, FileActionComponent.Operation operation)
           
 
Method Summary
 void addFile(File file)
          Add a file to process
 void addFileIgnored(File file)
          Add a file that was ignored
 void addFileProcessed(File file)
          Add a file that was processed
 Date getCreationDate()
          Retrieve the Date this ProcessingData was created
 File getCurrentFile()
          Retrieve the current File being processed if any.
 int getFileCount()
          Retrieve the number of files to be processed.
 int getFileIgnoredCount()
          Retrieve the number of files that were ignored.
 Set<File> getFileIgnoredSet()
          Retrieve the Set of files that were ignored
 int getFileProcessedCount()
          Retrieve the number of files that were processed.
 Set<File> getFileProcessedSet()
          Retrieve the Set of files that were processed
 Set<File> getFileSet()
          Retrieve the Set of files to be processed
 FileActionComponent.Operation getOperation()
          Retrieve the kind of Operation for which the file have been detected (create, update, delete, ...
 Date getProcessingEndDate()
          Retrieve the date at which the processing of this Data was finished.
 Date getProcessingStartDate()
          Retrieve the date at which the processing of this Data was started.
 Repository getRepository()
          Retrieve the repository concerned by this Processing
 ProcessingData.Type getType()
          Retrieve the type of processing concerned by this Processing
 boolean isFinished()
          Check if the processing for this ProcessingData is finished.
 boolean isInterrupted()
          Check if the processing for this ProcessingData was interrupted manually.
 boolean isPartialScan()
          Check if a new scan of this repository should be invoked after all data of this ProcessingData have been processed.
 boolean isStarted()
          Check if the processing for this ProcessingData was started.
 void setCurrentFile(File currentFile)
           
 void setFinished()
          Indicate that the processing for this ProcessingData is finished.
 void setInterrupted()
          Indicate that the processing for this ProcessingData was interrupted manually.
 void setPartialScan()
          Indicate a new scan of this repository should be invoked after all data of this ProcessingData have been processed.
 void setStarted()
          Indicate that the processing for this ProcessingData has started.
 void waitFinished()
          Wait for processing of this data to be finished.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REVISION

public static final String REVISION
See Also:
Constant Field Values
Constructor Detail

ProcessingData

public ProcessingData(Repository repository,
                      DirectoryScanner scanner)

ProcessingData

public ProcessingData(Repository repository,
                      Set<File> fileSet,
                      FileActionComponent.Operation operation)

ProcessingData

public ProcessingData(Repository repository,
                      File file,
                      FileActionComponent.Operation operation)
Method Detail

getRepository

public Repository getRepository()
Retrieve the repository concerned by this Processing

Returns:
a Repository instance, never return null

getType

public ProcessingData.Type getType()
Retrieve the type of processing concerned by this Processing

Returns:
the type of processing concerned by this Processing, might be null if not proprerly initialized

getCreationDate

public Date getCreationDate()
Retrieve the Date this ProcessingData was created

Returns:
the Date this ProcessingData was created, never return null

getOperation

public FileActionComponent.Operation getOperation()
Retrieve the kind of Operation for which the file have been detected (create, update, delete, ... )

Returns:
the operation for which file are processed, might be null if not proprerly initialized

addFile

public void addFile(File file)
Add a file to process

Parameters:
file - any File, must no be null

getFileSet

public Set<File> getFileSet()
Retrieve the Set of files to be processed

Returns:
a Set of File, return null after the processed is finished, unless the option "keepProcessingDataFileSet" was configured for repository.

getFileCount

public int getFileCount()
Retrieve the number of files to be processed.

Returns:
a file count

addFileProcessed

public void addFileProcessed(File file)
Add a file that was processed

Parameters:
file - any File, must no be null

getFileProcessedSet

public Set<File> getFileProcessedSet()
Retrieve the Set of files that were processed

Returns:
a Set of File, return null after the processed is finished, unless the option "keepProcessingDataFileSet" was configured for repository.

getFileProcessedCount

public int getFileProcessedCount()
Retrieve the number of files that were processed.

Returns:
a file count

addFileIgnored

public void addFileIgnored(File file)
Add a file that was ignored

Parameters:
file - any File, must no be null

getFileIgnoredSet

public Set<File> getFileIgnoredSet()
Retrieve the Set of files that were ignored

Returns:
a Set of File, return null after the processed is finished, unless the option "keepProcessingDataFileSet" was configured for repository.

getFileIgnoredCount

public int getFileIgnoredCount()
Retrieve the number of files that were ignored.

Returns:
a file count

getProcessingStartDate

public Date getProcessingStartDate()
Retrieve the date at which the processing of this Data was started.

Returns:
a Date, or null if the processing hat not yet started

getProcessingEndDate

public Date getProcessingEndDate()
Retrieve the date at which the processing of this Data was finished.

Returns:
a Date, or null if the processing has not yet finished

getCurrentFile

public File getCurrentFile()
Retrieve the current File being processed if any.

Returns:
a File (from the file set) or null if no file is being processed

setCurrentFile

public void setCurrentFile(File currentFile)

isInterrupted

public boolean isInterrupted()
Check if the processing for this ProcessingData was interrupted manually.

Returns:
true if the processing was interrupted manually, false otherwise.

setInterrupted

public void setInterrupted()
Indicate that the processing for this ProcessingData was interrupted manually.

This methods invokes setFinished() to mark this data as finished and notify all waiters.


isStarted

public boolean isStarted()
Check if the processing for this ProcessingData was started.

Returns:
true if the processing was started (running or finished), false if it has not yet started.

setStarted

public void setStarted()
Indicate that the processing for this ProcessingData has started.

Fill the processing start date.

See Also:
getProcessingStartDate()

isFinished

public boolean isFinished()
Check if the processing for this ProcessingData is finished.

Returns:
true if the processing is over, false if it's still running.
See Also:
getProcessingEndDate()

setFinished

public void setFinished()
Indicate that the processing for this ProcessingData is finished.

Also notify all waiters of this object

See Also:
waitFinished()

waitFinished

public void waitFinished()
                  throws InterruptedException
Wait for processing of this data to be finished.

Throws:
InterruptedException
See Also:
Object.wait()

setPartialScan

public void setPartialScan()
Indicate a new scan of this repository should be invoked after all data of this ProcessingData have been processed.

This methods is invoked if the Directory Scanning which created this processing Data was interrupted because the maximum number of files per scan was reached.

Since:
jcms-7.0

isPartialScan

public boolean isPartialScan()
Check if a new scan of this repository should be invoked after all data of this ProcessingData have been processed.

Returns:
true if this ProcessingData is an interrupted scan due to max files reach
Since:
jcms-7.0


Copyright © 2001-2010 Jalios SA. All Rights Reserved.