Package org.cip4.jdflib.util.hotfolder
Class StorageHotFolder
- java.lang.Object
-
- org.cip4.jdflib.util.hotfolder.StorageHotFolder
-
- Direct Known Subclasses:
PollHotFolder,QueueHotFolder
public class StorageHotFolder extends java.lang.Objecta 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.StorageHotFolderListeneraddListener(HotFolderListener _hfl, java.lang.String ext)add a listener that also storesvoidcopyCompleted(java.io.File storedFile, boolean ok)copy any files to the ok or error files as set by the folder propertiesvoidcopyCompleted(java.io.File storedFile, boolean ok, java.lang.Throwable t)copy any files to the ok or error files as set by the folder propertiesjava.io.FilegetHfDirectory()org.cip4.jdflib.util.hotfolder.StorageHotFolderListenergetListener(int i)intgetMaxConcurrent()protected intgetRetry()intgetStabilizeTime()booleanisProcessAux()booleanisSynchronous()voidrestart()restart this hot folder, creates a new listener thread and stops the old onevoidsetErrorStorage(java.io.File error)set the directory for error donevoidsetMaxAux(int maxStore)Setter for maxStore attribute.voidsetMaxCheck(int maxCheck)voidsetMaxConcurrent(int maxConcurrent)voidsetMaxStore(int maxStore)Setter for maxStore attribute.voidsetOKStorage(java.io.File ok)set the directory for successful donevoidsetProcessAux(boolean processAux)voidsetRetry(int retry)voidsetStabilizeTime(int stabilizeTime)voidsetSynchronous(boolean synchronous)voidstop()stop this hot folderjava.lang.StringtoString()
-
-
-
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 watchstorageDir- the storage directory where hot files are moved toext- the comma separated list of file extensions that are moved - if null no filteringhfListener- 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
-
setMaxConcurrent
public void setMaxConcurrent(int maxConcurrent)
- Parameters:
maxConcurrent-- See Also:
HotFolder.setMaxConcurrent(int)
-
setStabilizeTime
public void setStabilizeTime(int stabilizeTime)
- Parameters:
stabilizeTime-- See Also:
HotFolder.setStabilizeTime(int)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.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
-
getMaxConcurrent
public int getMaxConcurrent()
- Returns:
- See Also:
HotFolder.getMaxConcurrent()
-
getStabilizeTime
public int getStabilizeTime()
- Returns:
- See Also:
HotFolder.getStabilizeTime()
-
isSynchronous
public boolean isSynchronous()
-
setSynchronous
public void setSynchronous(boolean synchronous)
-
setMaxCheck
public void setMaxCheck(int maxCheck)
-
-