|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.xbus.technical.as400.AS400FileBase net.sf.xbus.technical.as400.AS400FileReceiver
public class AS400FileReceiver
The AS400FileReceiver
receives a request, reads the files on
the AS400 machines into tstrings and calls the application layer.
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 | FinalResolution | Three actions are possible with the file after processing: preserve, rename or delete |
System | Interface | OnError | Three actions are be possible with the file when an unrecoverable error
has occured: preserve, rename or delete |
System | Interface | Encoding | Specified character encoding of the interface (Optional) |
Base | ReceiverTimeout | Seconds | Global timeout value for AS400FileReceiver. If any error occurs the AS400FileReceiver tries again in this time. |
Base | Retry | Count | How many additional attempts are started after an error occured? |
Field Summary | |
---|---|
protected com.ibm.as400.access.AS400 |
mAS400System
AS400 object that represents the iSeries system that contains the file |
protected java.lang.String |
mEncoding
File encoding |
protected com.ibm.as400.access.SequentialFile |
mOriginFile
Represents an AS/400 physical or logical file. |
protected com.ibm.as400.access.QSYSObjectPathName |
mQSYSObject
QSYSObjectPathName represents an object in the integrated file system |
Fields inherited from class net.sf.xbus.technical.as400.AS400FileBase |
---|
mConverter |
Constructor Summary | |
---|---|
AS400FileReceiver()
|
Method Summary | |
---|---|
void |
close()
Not implemented for the iSeries integrated file system |
void |
commit()
Implemented method commit from the TAResource interface. |
protected boolean |
doReceive(XBUSSystem xbusSystem)
Manages the process of receipt for a specifc XBUSSystem. |
java.lang.String |
getOnError(Configuration config,
java.lang.String system)
Determines the action which should happen in case of an error from the standard configuration and checks its conformity with the allowed ones: Preserve -the source file remains without
modifications
Rename - the source file member is
renamed
Delete or DeleteFile -
the source file is deleted
DeleteMember - the source file
member is deleted
|
protected java.lang.Object |
getRequestContent()
getRequestContent delivers the content of the request. |
java.lang.String |
getResolution(Configuration config,
java.lang.String system)
Determines the final resolution (action after successful file processing) for the given system name from the standard configuration and checks its conformity with the allowed ones: Preserve -the source file remains without
modifications
Rename - the source file member is
renamed
Delete or DeleteFile -
the source file is deleted
DeleteMember - the source file
member is deleted
CallProgram - a parameterless
program is called on the AS400, its path is given in the configuration
|
java.lang.String |
getType()
A Receiver can receive data either as a
String or as an Object from a neighboring
system. |
void |
open()
Not implemented for the iSeries integrated file system |
void |
readConfiguration(java.lang.String system)
Reads standard configuration and stores following data in the class variables. |
void |
receive(java.lang.String systemName)
This method manages the receiving of message for one neighbor system. |
void |
rollback()
Implemented method rollback from TAResource neglects all
changes made so far (file locking). |
void |
setAS400System(com.ibm.as400.access.AS400 aS400System)
Sets the aS400System in AS400FileReceiver object. |
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 |
---|
protected com.ibm.as400.access.AS400 mAS400System
protected com.ibm.as400.access.SequentialFile mOriginFile
protected com.ibm.as400.access.QSYSObjectPathName mQSYSObject
protected java.lang.String mEncoding
Constructor Detail |
---|
public AS400FileReceiver()
Method Detail |
---|
public void receive(java.lang.String systemName)
The system is specified by its name. Due to wildcards in this name it may
really describe serveral interfaces. All these will be processed. Thus,
first the list of XBUSSystem
s for
the given system name is determined by replacing the wildcards.
After that for each XBUSSystem the doReceive(XBUSSystem)
method
is invoked, where requested interface file(s) is (are) read out into a
character string. The XBUSSystem and the string are passed to the
application layer.
Note:
The retry mechanism in this method first attempts processing each
XBUSSystem. Those which cause errors are put into a list and this list is
the base for the next retry.
receive
in interface ReceiverSingleInterface
systemName
- name of the system to receive data from
XException
- if something goes wrongprotected boolean doReceive(XBUSSystem xbusSystem)
xbusSystem
- XBUSSystem object with information of this
neighbor-system to be read
XException
- if any errors is occurs which is not treated in the
application layerprotected java.lang.Object getRequestContent() throws XException
getRequestContent
delivers the content of the request.
Subclasses may define their own request content.
String
but casted to
Object
for compliance reasons
XException
- if file can not be read or any I/O error occurspublic void readConfiguration(java.lang.String system) throws XException
Filename |
path name that represents an object in the QSYS library file system | |
Resolution actions |
actions to be taken in case of successfull transmission, error and empty source file | |
Encoding |
specified character encoding of the interface |
system
- System name to be read
XException
- if the configuartion is not available or a
mandatory key cannot be readgetResolution(Configuration, String)
,
AS400FileBase.getEncoding(AS400, String)
public java.lang.String getResolution(Configuration config, java.lang.String system) throws XException
Preserve
-the source file remains without
modifications
Rename
- the source file member is
renamed
Delete
or DeleteFile
-
the source file is deleted
DeleteMember
- the source file
member is deleted
CallProgram
- a parameterless
program is called on the AS400, its path is given in the configuration
config
- Instance of the
Configuration
system
- Sytem name for which resolution must be read.
XException
- if resolution value is not configured or not knownpublic java.lang.String getOnError(Configuration config, java.lang.String system) throws XException
Preserve
-the source file remains without
modifications
Rename
- the source file member is
renamed
Delete
or DeleteFile
-
the source file is deleted
DeleteMember
- the source file
member is deleted
config
- Instance of the
Configuration
system
- Sytem name which resoltion must be read.
XException
- if the onError key is missing or unknownpublic void setAS400System(com.ibm.as400.access.AS400 aS400System)
aS400System
- The aS400System to setpublic void commit() throws XException
commit
from the TAResource interface.
The purpose of commit actions is to remove any backup information that
had been created during processing (transaction) in the iSeries
integrated file system. Depending on the Resolution, the following
actions are carried out:
Resolution | Action |
---|---|
Preserve | 1. release file lock |
Rename | 1. release file lock 2. rename file |
Delete/DeleteFile | 1. release file lock 2. delete file |
DeleteMember | 1. release file lock 2. delete member |
CallProgram | 1. release file lock 2. call the specified terminator program |
commit
in interface TAResource
XException
- if accessing the interface file or perfoming the
configured action failsTAResource.commit()
public void rollback() throws XException
rollback
from TAResource neglects all
changes made so far (file locking).
rollback
in interface TAResource
XException
- if locks cannot be releasedTAResource.rollback()
public void open()
open
in interface TAResource
TAResource.open()
public void close()
close
in interface TAResource
TAResource.close()
public java.lang.String getType()
Receiver
Receiver
can receive data either as a
String
or as an Object
from a neighboring
system.Strings
, getType
returns Constants.TYPE_TEXT
Objects
, getType
returns Constants.TYPE_OBJECT
getType
in interface Receiver
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |