Class StorageHotFolder

  • Direct Known Subclasses:
    PollHotFolder, QueueHotFolder

    public class StorageHotFolder
    extends java.lang.Object
    a hotfolder that handles storage of "hotfolded" data
    • Constructor Summary

      Constructors 
      Constructor Description
      StorageHotFolder​(java.io.File _hotFolderDir, java.io.File storageDir, java.lang.String ext, HotFolderListener hfListener)
      constructor for a simple queue based hotfolder watcher that is automagically started in its own thread
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.cip4.jdflib.util.hotfolder.StorageHotFolderListener addListener​(HotFolderListener _hfl, java.lang.String ext)
      add a listener that also stores
      void copyCompleted​(java.io.File storedFile, boolean ok)
      copy any files to the ok or error files as set by the folder properties
      void copyCompleted​(java.io.File storedFile, boolean ok, java.lang.Throwable t)
      copy any files to the ok or error files as set by the folder properties
      java.io.File getHfDirectory()  
      org.cip4.jdflib.util.hotfolder.StorageHotFolderListener getListener​(int i)  
      int getMaxConcurrent()  
      protected int getRetry()  
      int getStabilizeTime()  
      boolean isProcessAux()  
      boolean isSynchronous()  
      void restart()
      restart this hot folder, creates a new listener thread and stops the old one
      void setErrorStorage​(java.io.File error)
      set the directory for error done
      void setMaxAux​(int maxStore)
      Setter for maxStore attribute.
      void setMaxCheck​(int maxCheck)  
      void setMaxConcurrent​(int maxConcurrent)  
      void setMaxStore​(int maxStore)
      Setter for maxStore attribute.
      void setOKStorage​(java.io.File ok)
      set the directory for successful done
      void setProcessAux​(boolean processAux)  
      void setRetry​(int retry)  
      void setStabilizeTime​(int stabilizeTime)  
      void setSynchronous​(boolean synchronous)  
      void stop()
      stop this hot folder
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • StorageHotFolder

        public StorageHotFolder​(java.io.File _hotFolderDir,
                                java.io.File storageDir,
                                java.lang.String ext,
                                HotFolderListener hfListener)
        constructor for a simple queue based hotfolder watcher that is automagically started in its own thread
        Parameters:
        _hotFolderDir - the hot folder directory to watch
        storageDir - the storage directory where hot files are moved to
        ext - the comma separated list of file extensions that are moved - if null no filtering
        hfListener - callback that receives the generated JMF - the location of the stored file will be found in the standard command parameters
    • Method Detail

      • isProcessAux

        public boolean isProcessAux()
      • setProcessAux

        public void setProcessAux​(boolean processAux)
      • getHfDirectory

        public java.io.File getHfDirectory()
        Returns:
        the hotfolder directory
      • stop

        public void stop()
        stop this hot folder
      • restart

        public void restart()
        restart this hot folder, creates a new listener thread and stops the old one
      • addListener

        public org.cip4.jdflib.util.hotfolder.StorageHotFolderListener addListener​(HotFolderListener _hfl,
                                                                                   java.lang.String ext)
        add a listener that also stores
        Parameters:
        _hfl -
        ext -
        Returns:
        the newly added listener
      • getListener

        public org.cip4.jdflib.util.hotfolder.StorageHotFolderListener getListener​(int i)
        Parameters:
        i -
        Returns:
      • setOKStorage

        public void setOKStorage​(java.io.File ok)
        set the directory for successful done
        Parameters:
        ok - the local directory for ok files in the input hot folder
      • copyCompleted

        public void copyCompleted​(java.io.File storedFile,
                                  boolean ok)
        copy any files to the ok or error files as set by the folder properties
        Parameters:
        storedFile -
        ok -
      • copyCompleted

        public void copyCompleted​(java.io.File storedFile,
                                  boolean ok,
                                  java.lang.Throwable t)
        copy any files to the ok or error files as set by the folder properties
        Parameters:
        storedFile -
        ok -
      • setErrorStorage

        public void setErrorStorage​(java.io.File error)
        set the directory for error done
        Parameters:
        error - the local directory for error files in the input hot folder
      • setMaxStore

        public void setMaxStore​(int maxStore)
        Setter for maxStore attribute.
        Parameters:
        maxStore - the maxStore to set
      • setMaxAux

        public void setMaxAux​(int maxStore)
        Setter for maxStore attribute.
        Parameters:
        maxStore - the setMaxAux to set
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
        See Also:
        Object.toString()
      • getRetry

        protected int getRetry()
        Returns:
        the retry
      • setRetry

        public void setRetry​(int retry)
        Parameters:
        retry - the retry to set 1= no retry
      • isSynchronous

        public boolean isSynchronous()
      • setSynchronous

        public void setSynchronous​(boolean synchronous)
      • setMaxCheck

        public void setMaxCheck​(int maxCheck)