Class ProcessingData
java.lang.Object
com.jalios.jcms.fileprocessor.processingmanagement.ProcessingData
Holder class for Files to be processed and some resulting information.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnumeration indicating the source of the file submition. -
Constructor Summary
ConstructorsConstructorDescriptionProcessingData(Repository repository, DirectoryScanner scanner) ProcessingData(Repository repository, File file, FileActionComponent.Operation operation) ProcessingData(Repository repository, Set<File> fileSet, FileActionComponent.Operation operation) -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a file to processvoidaddFileIgnored(File file) Add a file that was ignoredvoidaddFilePostponed(File file) Add a file that was postponedvoidaddFileProcessed(File file) Add a file that was processedRetrieve the Date this ProcessingData was createdRetrieve the current File being processed if any.intRetrieve the number of files to be processed.intRetrieve the number of files that were ignored.Retrieve the Set of files that were ignoredintRetrieve the number of files that were postponed.Retrieve the Set of files that were postponedintRetrieve the number of files that were processed.Retrieve the Set of files that were processedRetrieve the Set of files to be processedRetrieve the kind of Operation for which the file have been detected (create, update, delete, ...Retrieve the date at which the processing of this Data was finished.Retrieve the date at which the processing of this Data was started.Retrieve the repository concerned by this ProcessinggetType()Retrieve the type of processing concerned by this ProcessingbooleanCheck if the processing for this ProcessingData is finished.booleanCheck if the processing for this ProcessingData was interrupted manually.booleanCheck if a new scan of this repository should be invoked after all data of this ProcessingData have been processed.booleanCheck if the processing for this ProcessingData was started.voidsetCurrentFile(File currentFile) voidIndicate that the processing for this ProcessingData is finished.voidsetFinished(Consumer<ProcessingData> function) Indicate that the processing for this ProcessingData is finished.voidIndicate that the processing for this ProcessingData is in progress.voidIndicate that the processing for this ProcessingData was interrupted manually.voidIndicate a new scan of this repository should be invoked after all data of this ProcessingData have been processed.voidIndicate that the processing for this ProcessingData has started.toString()voidWait for processing of this data to be finished.voidWait for processing of this data to be started.
-
Constructor Details
-
ProcessingData
-
ProcessingData
public ProcessingData(Repository repository, Set<File> fileSet, FileActionComponent.Operation operation) -
ProcessingData
-
-
Method Details
-
getRepository
Retrieve the repository concerned by this Processing- Returns:
- a Repository instance, never return null
-
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
Retrieve the Date this ProcessingData was created- Returns:
- the Date this ProcessingData was created, never return null
-
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
Add a file to process- Parameters:
file- any File, must no be null
-
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
Add a file that was processed- Parameters:
file- any File, must no be null
-
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
Add a file that was ignored- Parameters:
file- any File, must no be null
-
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
-
addFilePostponed
Add a file that was postponed- Parameters:
file- any File, must no be null
-
getFilePostponedSet
Retrieve the Set of files that were postponed- Returns:
- a Set of File, return null after the processed is finished, unless the option "keepProcessingDataFileSet" was configured for repository.
-
getFilePostponedCount
public int getFilePostponedCount()Retrieve the number of files that were postponed.- Returns:
- a file count
-
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
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
Retrieve the current File being processed if any.- Returns:
- a File (from the file set) or null if no file is being processed
-
setCurrentFile
-
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:
-
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:
-
setFinished
public void setFinished()Indicate that the processing for this ProcessingData is finished.Also notify all waiters of this object
- See Also:
-
setFinished
Indicate that the processing for this ProcessingData is finished.Also notify all waiters of this object
- Parameters:
function- an optional Function invoked right before all waiters of this object gets notified- Since:
- JCMS-10475
- See Also:
-
waitFinished
Wait for processing of this data to be finished.- Throws:
InterruptedException- See Also:
-
setInProgress
public void setInProgress()Indicate that the processing for this ProcessingData is in progress.Also notify all waiters of this object
- Since:
- JCMS-11615
- See Also:
-
waitInProgress
Wait for processing of this data to be started.- Throws:
InterruptedException- See Also:
-
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
-
toString
-