在使用 WMQ-FTE 传输文件后,我想将一些文件移动到带时间戳的目录中。我正在运行 v7.0.4.1。
我的问题是总是有新文件被写入我要转出的目录,所以只是盲目地转移所有内容不是办法。我还批量处理传输触发器,因为它们以大约 1000 个批次发生,因此每 1000 个要传输的文件只发生一次传输。
我希望有一些元数据包含传输文件的路径列表,这样我就可以在传输发生之前或之后将它们移动到目录中。目录创建将是前或后源调用的一部分。
在使用 WMQ-FTE 传输文件后,我想将一些文件移动到带时间戳的目录中。我正在运行 v7.0.4.1。
我的问题是总是有新文件被写入我要转出的目录,所以只是盲目地转移所有内容不是办法。我还批量处理传输触发器,因为它们以大约 1000 个批次发生,因此每 1000 个要传输的文件只发生一次传输。
我希望有一些元数据包含传输文件的路径列表,这样我就可以在传输发生之前或之后将它们移动到目录中。目录创建将是前或后源调用的一部分。
查看DestinationTransferEndExit.java
API 文档。特别是看fileResults
参数。ANT 任务可以使用此参数对特定文件执行操作。
/**
* Invoked immediately after the completion of a transfer on the agent acting as
* the destination of the transfer.
*
* @param transferExitResult
* a result object reflecting whether or not the transfer completed
* successfully.
*
* @param sourceAgentName
* the name of the agent acting as the source of the transfer.
*
* @param destinationAgentName
* the name of the agent acting as the destination of the
* transfer. This is the name of the agent that the
* implementation of this method will be invoked from.
*
* @param environmentMetaData
* meta data about the environment in which the implementation
* of this method is running. This information can only be read,
* it cannot be updated by the implementation. The constants
* defined in <code>EnvironmentMetaDataConstants</code> class can
* be used to access the data held by this map.
*
* @param transferMetaData
* meta data to associate with the transfer. The information can
* only be read, it cannot be updated by the implementation. This
* map may also contain keys with IBM reserved names. These
* entries are defined in the <code>TransferMetaDataConstants</code>
* class and have special semantics.
*
* @param fileResults
* a list of file transfer result objects that describe the source
* file name, destination file name and result of each file transfer
* operation attempted.
*
* @return an optional description to enter into the log message describing
* transfer completion. A value of <code>null</code> can be used
* when no description is required.
*/
String onDestinationTransferEnd(TransferExitResult transferExitResult,
String sourceAgentName,
String destinationAgentName,
Map<String, String>environmentMetaData,
Map<String, String>transferMetaData,
List<FileTransferResult>fileResults);