net.sf.xbus.technical.as400
Class AS400FileSender

java.lang.Object
  extended by net.sf.xbus.technical.as400.AS400FileBase
      extended by net.sf.xbus.technical.as400.AS400FileSender
All Implemented Interfaces:
TAResource, Sender, TextSender
Direct Known Subclasses:
AS400ByteArrayListSender

public class AS400FileSender
extends AS400FileBase
implements Sender, TAResource, TextSender

AS400AS400FileSender manages writing a file on the iSeries integrated file System.

Configuration:

Chapter Section Key Content
System Interface Filename Path name that represents an object in the
QSYS library file system on the AS400 machine<
System Interface ConflictResolution Three actions must be possible when a file already exists
apend, overwrite or error
System Interface Encoding Specified character encoding of the interface (Optional)


Field Summary
protected  com.ibm.as400.access.SequentialFile mOriginFile
          Represents an AS/400 physical or logical file.
 
Fields inherited from class net.sf.xbus.technical.as400.AS400FileBase
mConverter
 
Constructor Summary
AS400FileSender(XBUSSystem system)
          Constructs a AS400FileSender object giving all necessary data from the standard configuration, connecting to the iSeries and registering current resource by the TAManager.
 
Method Summary
 void close()
          Is not implemented for iSeries integrated file system
 void commit()
          Performs a commit on the resource.
 java.lang.String execute(java.lang.String function, java.lang.String callData)
          Implemented method execute from TextSender sends the given string callData to the AS400-system.
 java.lang.String getResolution(Configuration config, java.lang.String system)
          Reads conflict resolution (resolved action when the file already exists) for the given system name from the configuration and checks its conformity with the allowed ones: Append Overwrite Error
 java.lang.String getType()
          A Sender can send data either as a String or as an Object to the neighboring system.
 void open()
          Is not implemented for iSeries integrated file system
 com.ibm.as400.access.RecordFormat prepareWriting()
           
 void rollback()
          Performs a rollback on the resource.
 
Methods inherited from class net.sf.xbus.technical.as400.AS400FileBase
callAS400Program, copyFile, deleteFile, deleteMember, getEncoding, getRenamedMember, releaseLock, renameFile, setLock
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mOriginFile

protected com.ibm.as400.access.SequentialFile mOriginFile
Represents an AS/400 physical or logical file. Allows the user to use commitment control when accessing an AS/400 file and access the records in an AS/400 file sequentially or by record number.

Constructor Detail

AS400FileSender

public AS400FileSender(XBUSSystem system)
                throws XException
Constructs a AS400FileSender object giving all necessary data from the standard configuration, connecting to the iSeries and registering current resource by the TAManager.

Throws:
XException - - If any error occurs
See Also:
AS400Connection
Method Detail

execute

public java.lang.String execute(java.lang.String function,
                                java.lang.String callData)
                         throws XException
Implemented method execute from TextSender sends the given string callData to the AS400-system. Three actions must be taking into account when a file already exists:

Append append new data to the existing file
Overwrite overwrite existing file with the new data
Error throw XException

Specified by:
execute in interface TextSender
Parameters:
function - - name of the interface
callData - - String to be written
Returns:
the response of the neighbor system
Throws:
XException - if any error occurs

prepareWriting

public com.ibm.as400.access.RecordFormat prepareWriting()
                                                 throws XException
Throws:
XException

getResolution

public java.lang.String getResolution(Configuration config,
                                      java.lang.String system)
                               throws XException
Reads conflict resolution (resolved action when the file already exists) for the given system name from the configuration and checks its conformity with the allowed ones:
Append
Overwrite
Error

Parameters:
config - Instanze of the configuration
system - Sytem name which resoltion must be read.
Returns:
conflict resolution as String (Append, Overwrite or Error)
Throws:
XException - if resolution is falsh or any errors occurs

commit

public void commit()
Description copied from interface: TAResource
Performs a commit on the resource.

Specified by:
commit in interface TAResource

rollback

public void rollback()
Description copied from interface: TAResource
Performs a rollback on the resource.

Specified by:
rollback in interface TAResource

open

public void open()
Is not implemented for iSeries integrated file system

Specified by:
open in interface TAResource

close

public void close()
Is not implemented for iSeries integrated file system

Specified by:
close in interface TAResource

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: When working with Objects the Sender must also fulfill two preconditions:

Specified by:
getType in interface Sender