Class XfbSender
java.lang.Object
org.frankframework.senders.AbstractSender
org.frankframework.senders.AbstractSenderWithParameters
org.frankframework.extensions.xfb.XfbSender
- All Implemented Interfaces:
FrankElement
,HasApplicationContext
,HasName
,IConfigurable
,IScopeProvider
,ISender
,ISenderWithParameters
,IWithParameters
,NameAware
,org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
,org.springframework.context.Lifecycle
Sender for transferring files using the XFB protocol. Assumes sender input is local filename.
Some comments from Richard Maddox (FTO) about UNIX File permissions:
In case of AIX or SUN systems we advise the following user and directory permissions:
SENDING CFT:
- App_user must have secondary group: xfbgw
- Folder should have ownership: app_user:xfbgw (owner:group)
- Folder should have access rights: 770 (rwx.rwx.---) so nobody other then app_user and group xfbgw can do something in this folder
- Folder should have SGID bit set so that all files what is copied to this folder get group ownership xfbgw
- send file must have rights 660 after putting the file in the send directory.
RECEIVING CFT:
- App_user (the application user of customer) should have secondary group: xfbgw
- Folder should have ownership: app_user:xfbgw (owner:group)
- Folder should have access rights: 770 (rwx.rwx.---) so nobody other then app_user and group xfbgw can do something in this folder
- Folder should have SGID bit set, so that all files what is copied to this folder get group ownership xfbgw
There are of course more solutions to get the job done, but this is the solution we can guarantee.
Some comments from Richard Maddox (FTO) about UNIX File permissions:
In case of AIX or SUN systems we advise the following user and directory permissions:
SENDING CFT:
- App_user must have secondary group: xfbgw
- Folder should have ownership: app_user:xfbgw (owner:group)
- Folder should have access rights: 770 (rwx.rwx.---) so nobody other then app_user and group xfbgw can do something in this folder
- Folder should have SGID bit set so that all files what is copied to this folder get group ownership xfbgw
- send file must have rights 660 after putting the file in the send directory.
RECEIVING CFT:
- App_user (the application user of customer) should have secondary group: xfbgw
- Folder should have ownership: app_user:xfbgw (owner:group)
- Folder should have access rights: 770 (rwx.rwx.---) so nobody other then app_user and group xfbgw can do something in this folder
- Folder should have SGID bit set, so that all files what is copied to this folder get group ownership xfbgw
There are of course more solutions to get the job done, but this is the solution we can guarantee.
- Since:
- 4.11
- Author:
- Jaco de Groot
-
Field Summary
Fields inherited from class org.frankframework.senders.AbstractSenderWithParameters
parameterNamesMustBeUnique, paramList
Fields inherited from class org.frankframework.senders.AbstractSender
log
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Configure this component.getAppli()
boolean
getCopy()
getFlow()
getFt()
sendMessage
(Message message, PipeLineSession session) Send a message to some destination (as configured in the Sender object).void
void
setCopy
(boolean copy) When set totrue
, the file is copied before calling the XFB script.void
setCopyPrefix
(String copyPrefix) Prefix for the name of the copied or original filename.void
void
void
void
Full pathname to the XFB script to be executed to transfer the fileMethods inherited from class org.frankframework.senders.AbstractSenderWithParameters
addParameter, checkStringAttributeOrParameter, consumesSessionVariable, getParameterList, getParameterOverriddenAttributeValue, getParameterOverriddenAttributeValue, getParameterValueList
Methods inherited from class org.frankframework.senders.AbstractSender
createBean, getLogPrefix, getName, isRunning, setApplicationContext, setName, start, stop
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 org.frankframework.core.HasApplicationContext
getApplicationContext, getConfigurationClassLoader
Methods inherited from interface org.frankframework.core.ISender
isSynchronous, sendMessageOrThrow, start, stop
-
Constructor Details
-
XfbSender
public XfbSender()
-
-
Method Details
-
configure
Description copied from interface:IConfigurable
Configure this component.configure()
is called once at startup of the framework in the configure method of the owner of thisIConfigurable
. Purpose of this method is to check whether the static configuration of the object is correct. As much as possible class-instantiating should take place in theconfigure()
, to improve performance.In the case of a container, this will propagate the configure signal to all components that apply.
- Specified by:
configure
in interfaceIConfigurable
- Overrides:
configure
in classAbstractSenderWithParameters
- Throws:
ConfigurationException
- in case it was not able to configure the component.
-
sendMessage
@Nonnull public SenderResult sendMessage(@Nonnull Message message, @Nonnull 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
.- Throws:
SenderException
TimeoutException
-
setScript
Full pathname to the XFB script to be executed to transfer the file -
getScript
-
setFt
-
getFt
-
setFlow
-
getFlow
-
setAppli
-
getAppli
-
setNoname
-
getNoname
-
setCopy
public void setCopy(boolean copy) When set totrue
, the file is copied before calling the XFB script. Reasons to copy the file: - XFB will rename the file (prefix it with FXB_) and delete it. - On Linux the sticky bit (drwxrws--- wasadmin xfbgw) isn't honoured with a move (only with a copy) (on AIX the sticky bit works for both move and copy). -
getCopy
public boolean getCopy() -
setCopyPrefix
Prefix for the name of the copied or original filename. When the name of the original file starts with this prefix, it is removed. Otherwise this prefix is added to the filename of the copied file. -
getCopyPrefix
-