Class ProcessingData


  • public class ProcessingData
    extends java.lang.Object
    Holder class for Files to be processed and some resulting information.
    • 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 java.util.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​(java.io.File file)
        Add a file to process
        Parameters:
        file - any File, must no be null
      • getFileSet

        public java.util.Set<java.io.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​(java.io.File file)
        Add a file that was processed
        Parameters:
        file - any File, must no be null
      • getFileProcessedSet

        public java.util.Set<java.io.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​(java.io.File file)
        Add a file that was ignored
        Parameters:
        file - any File, must no be null
      • getFileIgnoredSet

        public java.util.Set<java.io.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
      • addFilePostponed

        public void addFilePostponed​(java.io.File file)
        Add a file that was postponed
        Parameters:
        file - any File, must no be null
      • getFilePostponedSet

        public java.util.Set<java.io.File> 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

        public java.util.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 java.util.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 java.io.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​(java.io.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()
      • setFinished

        public void setFinished​(java.util.function.Consumer<ProcessingData> function)
        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()
      • waitFinished

        public void waitFinished()
                          throws java.lang.InterruptedException
        Wait for processing of this data to be finished.
        Throws:
        java.lang.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
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object