|
Sun Adapter for Batch/FTP | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.stc.eways.batchext.FtpFileClientImpl
public class FtpFileClientImpl
This class is the standard implementation of the interface FtpFileClient. It is a core part of Batch e*Way FTP ETD and is used for ETD implementation and e*Way Connection delegation. You can extend this class to provide your own implementation, if desired.
| Field Summary | |
|---|---|
protected com.stc.connector.logging.Logger |
mLogger
|
protected boolean |
transferAllowed
|
| Fields inherited from interface com.stc.eways.batchext.FtpFileClient |
|---|
ENCODING_BIG5, ENCODING_DEFAULT, ENCODING_EUC_JP, ENCODING_GBK, ENCODING_JIS, ENCODING_SJIS, TC_GET, TC_PUT |
| Constructor Summary | |
|---|---|
FtpFileClientImpl()
Constructor. |
|
FtpFileClientImpl(FtpETD etd)
Constructor. |
|
| Method Summary | |
|---|---|
void |
allowTransfer()
Allow transfers in XA mode. |
void |
cleanupPostTransferGet(TransferNamesAndCommands tncg)
Cleans up any failures during Post Transfer Command for "get". |
void |
cleanupPostTransferPut(TransferNamesAndCommands tncp)
Cleans up any failures during Post Transfer Command for "put". |
void |
cleanupPreTransferGet(TransferNamesAndCommands tncg)
Cleans up any failures during Pre Transfer Command for "get". |
void |
cleanupPreTransferPut(TransferNamesAndCommands tncp)
Cleans up any failures during Pre Transfer Command for "put". |
void |
cleanupRawCommands(TransferNamesAndCommands tncr)
Cleans up any failures during pre/post ftp raw commands. |
void |
cleanupTransferGet(TransferNamesAndCommands tncg)
Cleans up any failures during ftp Transfer "get". |
void |
cleanupTransferPut(TransferNamesAndCommands tncp)
Cleans up any failures during ftp Transfer "put". |
void |
close()
Does an FTP log-out and disconnects. |
void |
connect()
Performs the FTP connection, log-in and switch modes, and so on. |
void |
connect(java.lang.String encoding)
Performs the FTP connection, log-in and switch modes, and so on. |
void |
disconnect()
Does FTP log-out and disconnects. |
void |
doPostTransferGet(TransferNamesAndCommands tncg)
Performs Post Transfer Command for FTP get operation. |
void |
doPostTransferPut(TransferNamesAndCommands tncp)
Performs Post Transfer Command for FTP put operation. |
void |
doPreTransferGet(TransferNamesAndCommands tncg)
Performs Pre Transfer Command for FTP get operation. |
void |
doPreTransferPut(TransferNamesAndCommands tncp)
Performs Pre Transfer Command for FTP put operation. |
void |
doRawCommands(java.lang.String commands)
Performs FTP pre and post transfer raw commands, for example: SITE RECFM=FB;SITE LRECL=50;SITE BLOCKSIZE=32750;SITE TRACKS;SITE PRI=5;SITE SEC=5 NOTE: The commands are separated by a semicolon (;), and only FTP raw commands are expected. |
void |
doTransferGet(TransferNamesAndCommands tncg)
Performs the real FTP get transfer. |
void |
doTransferPut(TransferNamesAndCommands tncp)
Performs the real FTP put transfer. |
void |
get()
Retrieves a file from the remote FTP server. |
void |
getIfExists()
per QAI 94512 - requested by eXchange team same as get() but will return siliently if the target does not exists; |
protected com.stc.connector.logging.Logger |
getLogger()
|
byte[] |
getPayload()
Retrieves the ETD's data payload. |
TransferNamesAndCommands |
getResolvedNamesForGet()
Resolves names from patterns for the FTP get operation. |
TransferNamesAndCommands |
getResolvedNamesForPut()
Resolves names from patterns for the FTP put operation. |
java.util.Properties |
getUserProperties()
Retrieves user-defined properties. |
void |
initialConfigValues(java.util.Properties props)
Initializes configuration properties from specified properties. |
void |
initialize(FtpETD etd)
Initializes the ETD object. |
boolean |
isConnected()
Verifies that the e*Way Connection to the external system is still available. |
boolean |
isOpen()
Verifies that the e*Way Connection to the external system is still available. |
boolean |
isXA()
Determines whether an e*Way Connection is in the XA mode. |
static void |
main(java.lang.String[] args)
Used to do stand-alone testing. |
void |
open()
Performs an FTP connection, log-in and switch modes, and so on. |
void |
open(java.lang.String encoding)
Performs an FTP connection, log-in and switch modes, and so on. |
void |
put()
Stores a remote FTP file. |
void |
releaseResources()
Releases the e*Way Connection's resources but does not close the connection to the external system. |
boolean |
reset()
Resets the data content of an FtpFileClient. |
void |
restoreConfigValues()
Restores all configuration properties from the related e*Way Connection's configuration file. |
void |
setInputStreamAdapter(com.stc.eways.common.eway.standalone.streaming.InputStreamAdapter isa)
This method is used to request data streams from another ETD. |
void |
setOutputStreamAdapter(com.stc.eways.common.eway.standalone.streaming.OutputStreamAdapter osa)
This method is used to request data streams from another ETD. |
void |
setPayload(byte[] newPayload)
Sets the ETD's data payload. |
void |
terminate()
Terminates the FtpFileClient. |
void |
undoPostTransferGet(TransferNamesAndCommands tncg)
Undoes Post Transfer for FTP get operation. |
void |
undoPostTransferPut(TransferNamesAndCommands tncp)
Undoes Post Transfer for FTP put operation. |
void |
undoPreTransferGet(TransferNamesAndCommands tncg)
Undoes Pre Transfer for FTP get operation. |
void |
undoPreTransferPut(TransferNamesAndCommands tncp)
Undoes Pre Transfer for FTP put operation. |
void |
undoRawCommands(TransferNamesAndCommands tncr)
Undo pre/post ftp raw commands. |
void |
undoTransferGet(TransferNamesAndCommands tncg)
Undoes ftp get transfer. |
void |
undoTransferPut(TransferNamesAndCommands tncp)
Undoes ftp put transfer. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected com.stc.connector.logging.Logger mLogger
protected boolean transferAllowed
| Constructor Detail |
|---|
public FtpFileClientImpl(FtpETD etd)
throws FtpFileException
etd - FtpETD instance.
FtpFileException - If some error occurs.public FtpFileClientImpl()
| Method Detail |
|---|
public void initialize(FtpETD etd)
throws FtpFileException
initialize in interface FtpFileClientetd - An instance of the FtpETD object.
FtpFileException - If some error occurs.
public void doRawCommands(java.lang.String commands)
throws FtpFileException
doRawCommands in interface FtpFileClientcommands - The FTP raw command set.commands - The raw command set.
FtpFileException - If some error occurs.public static void main(java.lang.String[] args)
args - Command line parameters.public void close()
close in interface FtpFileClient
public void open()
throws FtpFileException
open in interface FtpFileClientFtpFileException - If some error occurs.
public void open(java.lang.String encoding)
throws FtpFileException
open in interface FtpFileClientencoding - The encoding for the server.
FtpFileException - If some error occurs.public void allowTransfer()
allowTransfer in interface FtpFileClient
public boolean reset()
throws FtpFileException
reset in interface FtpFileClientfalse if the ETD doesn't have a meaningful implementation of
reset(); so do a new of the ETD instead.
Otherwise, return true if the reset will clear the data content
of the ETD.
FtpFileException - If some error occurs.
public void terminate()
throws FtpFileException
terminate in interface FtpFileClientFtpFileException - If some error occurs.public byte[] getPayload()
The data payload is a blob (byte array) used to store the raw content of a file.
getPayload in interface FtpFileClientpublic void setPayload(byte[] newPayload)
The data payload is a blob (byte array) used to store the raw content of a file.
setPayload in interface FtpFileClientnewPayload - The data payload.
public void initialConfigValues(java.util.Properties props)
throws FtpFileException
initialConfigValues in interface FtpFileClientprops - The specified properties.
FtpFileException - If some error occurs.public boolean isOpen()
isOpen in interface FtpFileClienttrue if the connection is still open and available;
false if otherwise.
public void restoreConfigValues()
throws FtpFileException
restoreConfigValues in interface FtpFileClientFtpFileException - If some error occurs.public boolean isXA()
isXA in interface FtpFileClientpublic void releaseResources()
releaseResources in interface FtpFileClientpublic java.util.Properties getUserProperties()
This method is an advanced setting and is part of the e*Way's user-extensibility features.
The properties are from the user properties file.
getUserProperties in interface FtpFileClient
public void connect()
throws FtpFileException
FtpFileClient
connect in interface FtpFileClientFtpFileException - If some error occurs.
public void connect(java.lang.String encoding)
throws FtpFileException
FtpFileClient
connect in interface FtpFileClientencoding - The encoding for the server.
FtpFileException - If some error occurs.public void disconnect()
disconnect in interface FtpFileClientpublic boolean isConnected()
isConnected in interface FtpFileClienttrue if the connection is still open and available;
false if otherwise.public void setInputStreamAdapter(com.stc.eways.common.eway.standalone.streaming.InputStreamAdapter isa)
setInputStreamAdapter in interface FtpFileClientisa - An InputStreamAdapter object.public void setOutputStreamAdapter(com.stc.eways.common.eway.standalone.streaming.OutputStreamAdapter osa)
setOutputStreamAdapter in interface FtpFileClientosa - An OutputStreamAdapter object.
public TransferNamesAndCommands getResolvedNamesForGet()
throws FtpFileException
getResolvedNamesForGet in interface FtpFileClientFtpFileException - If some error occurs.
public TransferNamesAndCommands getResolvedNamesForPut()
throws FtpFileException
getResolvedNamesForPut in interface FtpFileClientFtpFileException - If some error occurs.
public void doPostTransferGet(TransferNamesAndCommands tncg)
throws java.lang.Exception
doPostTransferGet in interface FtpFileClienttncg - An instance of TransferNamesAndCommands class.
java.lang.Exception - If some error occurs.
public void doPreTransferGet(TransferNamesAndCommands tncg)
throws java.lang.Exception
doPreTransferGet in interface FtpFileClienttncg - An instance of TransferNamesAndCommands class.
java.lang.Exception - If some error occurs.
public void doTransferGet(TransferNamesAndCommands tncg)
throws java.lang.Exception
doTransferGet in interface FtpFileClienttncg - An instance of TransferNamesAndCommands class.
java.lang.Exception - If some error occurs.
public void doPostTransferPut(TransferNamesAndCommands tncp)
throws java.lang.Exception
doPostTransferPut in interface FtpFileClienttncp - An instance of TransferNamesAndCommands class.
java.lang.Exception - If some error occurs.
public void doPreTransferPut(TransferNamesAndCommands tncp)
throws java.lang.Exception
doPreTransferPut in interface FtpFileClienttncp - An instance of TransferNamesAndCommands class.
java.lang.Exception - If some error occurs.
public void doTransferPut(TransferNamesAndCommands tncp)
throws java.lang.Exception
doTransferPut in interface FtpFileClienttncp - An instance of TransferNamesAndCommands class.
java.lang.Exception - If some error occurs.
public void put()
throws FtpFileException
put in interface FtpFileClientFtpFileException - If some error occurs.
public void undoPreTransferGet(TransferNamesAndCommands tncg)
throws java.lang.Exception
undoPreTransferGet in interface FtpFileClienttncg - An instance of TransferNamesAndCommands class.
java.lang.Exception - If some error occurs.
public void undoTransferGet(TransferNamesAndCommands tncg)
throws java.lang.Exception
undoTransferGet in interface FtpFileClienttncg - An instance of TransferNamesAndCommands class.
java.lang.Exception - If some error occurs.
public void undoPreTransferPut(TransferNamesAndCommands tncp)
throws java.lang.Exception
undoPreTransferPut in interface FtpFileClienttncp - An instance of TransferNamesAndCommands class.
java.lang.Exception - If some error occurs.
public void undoTransferPut(TransferNamesAndCommands tncp)
throws java.lang.Exception
undoTransferPut in interface FtpFileClienttncp - An instance of TransferNamesAndCommands class.
java.lang.Exception - If some error occurs.
public void undoPostTransferGet(TransferNamesAndCommands tncg)
throws java.lang.Exception
undoPostTransferGet in interface FtpFileClienttncg - An instance of TransferNamesAndCommands class.
java.lang.Exception - If some error occurs.
public void undoPostTransferPut(TransferNamesAndCommands tncp)
throws java.lang.Exception
undoPostTransferPut in interface FtpFileClienttncp - An instance of TransferNamesAndCommands class.
java.lang.Exception - If some error occurs.
public void cleanupPostTransferGet(TransferNamesAndCommands tncg)
throws java.lang.Exception
cleanupPostTransferGet in interface FtpFileClienttncg - An instance of TransferNamesAndCommands class.
java.lang.Exception - If some error occurs.
public void cleanupPostTransferPut(TransferNamesAndCommands tncp)
throws java.lang.Exception
cleanupPostTransferPut in interface FtpFileClienttncp - An instance of TransferNamesAndCommands class.
java.lang.Exception - If some error occurs.
public void cleanupPreTransferGet(TransferNamesAndCommands tncg)
throws java.lang.Exception
cleanupPreTransferGet in interface FtpFileClienttncg - An instance of TransferNamesAndCommands class.
java.lang.Exception - If some error occurs.
public void cleanupPreTransferPut(TransferNamesAndCommands tncp)
throws java.lang.Exception
cleanupPreTransferPut in interface FtpFileClienttncp - An instance of TransferNamesAndCommands class.
java.lang.Exception - If some error occurs.
public void cleanupRawCommands(TransferNamesAndCommands tncr)
throws FtpFileException
cleanupRawCommands in interface FtpFileClienttncr - An instance of TransferNamesAndCommands class.
FtpFileException - If some error occurs.
public void cleanupTransferGet(TransferNamesAndCommands tncg)
throws java.lang.Exception
cleanupTransferGet in interface FtpFileClienttncg - An instance of TransferNamesAndCommands class.
java.lang.Exception - If some error occurs.
public void cleanupTransferPut(TransferNamesAndCommands tncp)
throws java.lang.Exception
cleanupTransferPut in interface FtpFileClienttncp - An instance of TransferNamesAndCommands class.
java.lang.Exception - If some error occurs.
public void undoRawCommands(TransferNamesAndCommands tncr)
throws FtpFileException
undoRawCommands in interface FtpFileClienttncr - An instance of TransferNamesAndCommands.
FtpFileException - If some error occurs.
public void get()
throws FtpFileException
get in interface FtpFileClientFtpFileException - If some error occurs.
public void getIfExists()
throws FtpFileException
getIfExists in interface FtpFileClientFtpFileException - If some error occurs.protected com.stc.connector.logging.Logger getLogger()
|
Sun Adapter for Batch/FTP | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||