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

public class ProcessingData extends Object
Holder class for Files to be processed and some resulting information.
  • Constructor Details

  • Method Details

    • 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
    • addFilePostponed

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

      public Set<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 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:
    • 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

      public void setFinished(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

      public void waitFinished() throws InterruptedException
      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

      public void waitInProgress() throws InterruptedException
      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

      public String toString()
      Overrides:
      toString in class Object