net.sf.xbus.technical.file
Class SimpleFileSender
java.lang.Object
net.sf.xbus.technical.file.FileBase
net.sf.xbus.technical.file.SimpleFileSender
- All Implemented Interfaces:
- Sender, TextSender
public class SimpleFileSender
- extends FileBase
- implements Sender, TextSender
Constructor Summary |
SimpleFileSender(XBUSSystem system)
Constructs a FileSender object giving all necessary data from the
standard configuration, checking file permissions and registering current
resource by the TAManager . |
Method Summary |
java.lang.String |
execute(java.lang.String function,
java.lang.String callData)
The given string will be send to the neighbor system. |
java.lang.String |
getType()
A Sender can send data either as a String
or as an Object to the neighboring system. |
protected void |
prepareWriteFile()
|
protected java.io.BufferedWriter |
prepareWriter()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
mConfiguration
protected FileSenderConfiguration mConfiguration
SimpleFileSender
public SimpleFileSender(XBUSSystem system)
throws XException
- Constructs a FileSender object giving all necessary data from the
standard configuration, checking file permissions and registering current
resource by the
TAManager
.
- Throws:
XException
- if any error occurs
execute
public java.lang.String execute(java.lang.String function,
java.lang.String callData)
throws XException
- Description copied from interface:
TextSender
- The given string will be send to the neighbor system. The response of the
neighbor system is the return value of this method.
Optionally a function can be specified. It can be used for calling
different methods of the neighbor-system.
- Specified by:
execute
in interface TextSender
- Parameters:
function
- used by some senderscallData
- the data that shall be send to the neighbor system
- Returns:
- the response of the neighbor system
- Throws:
XException
- if something goes wrong
prepareWriter
protected java.io.BufferedWriter prepareWriter()
throws XException
- Throws:
XException
prepareWriteFile
protected void prepareWriteFile()
throws XException
- Throws:
XException
getType
public java.lang.String getType()
- Description copied from interface:
Sender
- A
Sender
can send data either as a String
or as an Object
to the neighboring system.
When working with Strings
the Sender must fulfill two
preconditions:
getType
returns Constants.TYPE_TEXT
- The class implements the interface
TextSender
When working with Objects
the Sender must also fulfill two
preconditions:
getType
returns Constants.TYPE_OBJECT
- The class implements the interface
ObjectSender
- Specified by:
getType
in interface Sender