Class FileSystemSender<F,FS extends IBasicFileSystem<F>>
- java.lang.Object
-
- nl.nn.adapterframework.senders.SenderBase
-
- nl.nn.adapterframework.senders.SenderWithParametersBase
-
- nl.nn.adapterframework.filesystem.FileSystemSender<F,FS>
-
- All Implemented Interfaces:
HasPhysicalDestination
,IConfigurable
,IConfigurationAware
,INamedObject
,IScopeProvider
,ISender
,ISenderWithParameters
,IWithParameters
,org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
- Direct Known Subclasses:
ExchangeFolderSender
,FileSystemSenderWithAttachments
,FtpFileSystemSender
,ImapSender
,LocalFileSystemSender
,Samba1Sender
,Samba2Sender
,SftpFileSystemSender
@ElementType(ENDPOINT) public abstract class FileSystemSender<F,FS extends IBasicFileSystem<F>> extends SenderWithParametersBase implements HasPhysicalDestination
Base class for Senders that use aFileSystem
.- Author:
- Gerrit van Brakel
- See Also:
FileSystemActor
- Specific parameters
- action overrides attribute
action
., filename overrides attributefilename
. If not present, the input message is used., destination destination for actionrename
andmove
. Overrides attributedestination
., contents contents for actionwrite
andappend
., inputFolder folder for actionslist
,mkdir
andrmdir
. This is a sub folder of baseFolder. Overrides attributeinputFolder
. If not present, the input message is used.
-
-
Field Summary
-
Fields inherited from class nl.nn.adapterframework.senders.SenderWithParametersBase
parameterNamesMustBeUnique, paramList
-
Fields inherited from class nl.nn.adapterframework.senders.SenderBase
log
-
-
Constructor Summary
Constructors Constructor Description FileSystemSender()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addActions(List<FileSystemActor.FileSystemAction> specificActions)
void
close()
Stop/close the sender and deallocate resources.void
configure()
configure()
is called once at startup of the framework in the configure method of the owner of this sender.FileSystemActor.FileSystemAction
getAction()
String
getDomain()
FS
getFileSystem()
String
getPhysicalDestinationName()
void
open()
This method will be called to start the sender.SenderResult
sendMessage(Message message, PipeLineSession session)
Send a message to some destination (as configured in the Sender object).void
setAction(FileSystemActor.FileSystemAction action)
void
setCharset(String charset)
void
setCreateFolder(boolean createFolder)
void
setDeleteEmptyFolder(boolean deleteEmptyFolder)
void
setDestination(String destination)
void
setExcludeWildcard(String excludeWildcard)
void
setFilename(String filename)
void
setFileSystem(FS fileSystem)
void
setInputFolder(String inputFolder)
void
setNumberOfBackups(int numberOfBackups)
void
setOutputFormat(DocumentFormat outputFormat)
void
setOverwrite(boolean overwrite)
void
setRemoveNonEmptyFolder(boolean removeNonEmptyFolder)
void
setRotateDays(int rotateDays)
void
setRotateSize(int rotateSize)
void
setWildcard(String wildcard)
void
setWriteLineSeparator(boolean writeLineSeparator)
-
Methods inherited from class nl.nn.adapterframework.senders.SenderWithParametersBase
addParameter, checkStringAttributeOrParameter, consumesSessionVariable, getParameterList, getParameterOverriddenAttributeValue, getParameterOverriddenAttributeValue, getParameterValueList
-
Methods inherited from class nl.nn.adapterframework.senders.SenderBase
createBean, getApplicationContext, getConfigurationClassLoader, getLogPrefix, getName, setApplicationContext, setName
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.springframework.context.ApplicationContextAware
setApplicationContext
-
Methods inherited from interface nl.nn.adapterframework.core.IConfigurationAware
getApplicationContext, getName
-
Methods inherited from interface nl.nn.adapterframework.core.INamedObject
getName, setName
-
Methods inherited from interface nl.nn.adapterframework.core.IScopeProvider
getConfigurationClassLoader
-
Methods inherited from interface nl.nn.adapterframework.core.ISender
isSynchronous, sendMessageOrThrow
-
-
-
-
Method Detail
-
configure
public void configure() throws ConfigurationException
Description copied from interface:ISender
configure()
is called once at startup of the framework in the configure method of the owner of this sender. Purpose of this method is to check whether the static configuration of the sender is correct. As much as possible class-instantiating should take place in theconfigure()
oropen()
method, to improve performance.- Specified by:
configure
in interfaceIConfigurable
- Specified by:
configure
in interfaceISender
- Overrides:
configure
in classSenderWithParametersBase
- Throws:
ConfigurationException
-
open
public void open() throws SenderException
Description copied from interface:ISender
This method will be called to start the sender. After this method is called the sendMessage method may be called. Purpose of this method is to reduce creating connections to databases etc. in thesendMessage()
method.- Specified by:
open
in interfaceISender
- Overrides:
open
in classSenderBase
- Throws:
SenderException
-
close
public void close() throws SenderException
Description copied from interface:ISender
Stop/close the sender and deallocate resources.- Specified by:
close
in interfaceISender
- Overrides:
close
in classSenderBase
- Throws:
SenderException
-
sendMessage
public SenderResult sendMessage(Message message, PipeLineSession session) throws SenderException, TimeoutException
Description copied from interface:ISender
Send a message to some destination (as configured in the Sender object). This method may only be called after theconfigure()
method is called.The following table shows the difference between synchronous and a-synchronous senders:
synchronous a-synchronous ISender.isSynchronous()
returnstrue
false
return value of sendMessage()
isthe reply-message the messageId of the message sent the correlationID specified with sendMessage()
may be ignored is sent with the message a {link TimeOutException} may be thrown if a timeout occurs waiting for a reply should not be expected Multiple objects may try to call this method at the same time, from different threads. Implementations of this method should therefore be thread-safe, or
synchronized
.- Specified by:
sendMessage
in interfaceISender
- Throws:
SenderException
TimeoutException
-
getPhysicalDestinationName
public String getPhysicalDestinationName()
- Specified by:
getPhysicalDestinationName
in interfaceHasPhysicalDestination
-
getDomain
public String getDomain()
- Specified by:
getDomain
in interfaceHasPhysicalDestination
-
setFileSystem
public void setFileSystem(FS fileSystem)
-
getFileSystem
public FS getFileSystem()
-
addActions
protected void addActions(List<FileSystemActor.FileSystemAction> specificActions)
-
setAction
@ReferTo(FileSystemActor.class) public void setAction(FileSystemActor.FileSystemAction action)
-
getAction
public FileSystemActor.FileSystemAction getAction()
-
setFilename
@ReferTo(FileSystemActor.class) public void setFilename(String filename)
-
setDestination
@ReferTo(FileSystemActor.class) public void setDestination(String destination)
-
setInputFolder
@ReferTo(FileSystemActor.class) public void setInputFolder(String inputFolder)
-
setCreateFolder
@ReferTo(FileSystemActor.class) public void setCreateFolder(boolean createFolder)
-
setOverwrite
@ReferTo(FileSystemActor.class) public void setOverwrite(boolean overwrite)
-
setRotateDays
@ReferTo(FileSystemActor.class) public void setRotateDays(int rotateDays)
-
setRotateSize
@ReferTo(FileSystemActor.class) public void setRotateSize(int rotateSize)
-
setNumberOfBackups
@ReferTo(FileSystemActor.class) public void setNumberOfBackups(int numberOfBackups)
-
setWildcard
@ReferTo(FileSystemActor.class) public void setWildcard(String wildcard)
-
setExcludeWildcard
@ReferTo(FileSystemActor.class) public void setExcludeWildcard(String excludeWildcard)
-
setRemoveNonEmptyFolder
@ReferTo(FileSystemActor.class) public void setRemoveNonEmptyFolder(boolean removeNonEmptyFolder)
-
setWriteLineSeparator
@ReferTo(FileSystemActor.class) public void setWriteLineSeparator(boolean writeLineSeparator)
-
setCharset
@ReferTo(FileSystemActor.class) public void setCharset(String charset)
-
setDeleteEmptyFolder
@ReferTo(FileSystemActor.class) public void setDeleteEmptyFolder(boolean deleteEmptyFolder)
-
setOutputFormat
@ReferTo(FileSystemActor.class) public void setOutputFormat(DocumentFormat outputFormat)
-
-