This chapter describes the file Oracle Communications Network Integrity file transfer processor.
The file transfer processor is similar to other Network Integrity processors, with the following exceptions:
The complete implementation is generated.
It can be added to discovery, import, and assimilation actions.
The output parameter that the file transfer processor produces can then be used by the file parser processor as input for the parsing process.
The file transfer processor outputs a single parameter. This output parameter holds a collection of file objects, each of which points to the local version of the transferred file. This collection of files is used as input for a file parser processor, but can also be used by any type of processor in the action. The file collection output parameter can also be used as input to a For Each structure in the action to loop over the files individually.
The name of the output parameter is system-generated and based on the name of the file transfer processor. For example, the Sample File Transfer processor outputs sampleFileTransferFileCollection.
The type of the output parameter is always java.util.Collection<java.io.File>.
The Processor editor Context Parameters tab is read-only for file transfer processors, the Usage button shows which processors are using the output parameter.
When a cartridge is deployed with scan parameter groups that are generated from a file transfer processor, they appear in the Network Integrity UI as scan parameters, as shown in Figure 2-1.
Table 2-1 describes the default characteristics in the file transfer scan parameter group.
Table 2-1 Characteristics in the File Transfer Processor Scan Parameter Group
Characteristic Name | Default | Mandatory | Description |
---|---|---|---|
Transfer Type |
FTP |
Yes |
Select how files should be transferred: FTP, SFTP, Local. |
File Pattern |
N/A |
No |
A pattern to match file names. The pattern supports wildcard characters. The supported wildcard characters are "*", "%", and "_". "*" and "%" represent a match of zero or more characters. "_" represents a match of any single character. Wildcard characters can be escaped with a back slash. |
Port |
N/A |
No |
The port used to connect to the remote server. The default is 21 for FTP, and 22 for SFTP. |
User Name |
N/A |
No |
The user name to connect to the remote location. |
Password |
N/A |
No |
The password to connect to the remote location. |
Session Timeout |
60 |
No |
The amount of time in seconds before an idle connection is timed out. The valid range is from 1 to 3600. |
Source File Management |
Rename |
No |
Select the action to take on source files when the file transfer is complete. Options are: Delete, Rename, Nothing. |
Rename Suffix |
Processed |
No |
The suffix to add to the source file if the source file management characteristic has a value of Rename. |
Note:
Do not modify the characteristics listed in Table 2-1. You can create new characteristics in the generated scan parameter group, but the auto-generated characteristics must not be modified.You can configure the file transfer processor to use Java objects that are available in the action context as input. This allows predecessor processors to programmatically control the behavior of the file transfer processor at run time.
The input parameters that the file transfer processor uses depend on the options configured in Oracle Communications Design Studio. For example, if the Parameter Source option is set to Context Parameter the file transfer processor requires an input parameter of the following type: oracle.communications.sce.integrity.sdk.fileTransferCollector.FileTransferProperties
If you select Use Scope Address the file transfer processor uses the Scope Address entered in the Network Integrity UI.
If Use Scope Address is not selected, a String input parameter is required for the address. The address value must be in the form of host/path. Where host is either a host name, IPv4 or IPv6 address, and path is the directory path to where the files are located. For example, 192.168.1.1/tmp/test. If the file transfer processor is only retrieving files from the local file system, do not specify the host. For example, /tmp/test.
Note:
Only discovery actions have the Use Scope Address option because only discovery actions contain a scope address. For assimilation and import actions, there is no scope address, so the address must come from a context parameter.Table 2-2 summarizes the required input parameters based on the configuration.
Table 2-2 Input Parameters Based on Configuration
Parameter Source | Use Scope Address | Required Input Context Parameters |
---|---|---|
Scan parameter group |
Checked |
None |
Scan parameter group |
Unchecked |
String |
Context Parameter |
Checked |
oracle.communications.sce.integrity.sdk.fileTransferCollector.FileTransferProperties |
Context Parameter |
Unchecked |
oracle.communications.sce.integrity.sdk.fileTransferCollector.FileTransferProperties String |
Context parameters of type oracle.communications.sce.integrity.sdk.fileTransferCollector.FileTransferProperties can be set in a predecessor action processor so that some or all of the properties can be defined in the action. That is, the action can be configured to specify all the file transfer properties, instead of prompting the user to enter values.
The File Transfer Property Initializer processor creates and populates a FileTransferProperties object. The object can then be used by the file transfer processor to transfer the file.
Example 2-1 shows the invoke method implementation of the file transfer property initializer. The code demonstrates how to programmatically set file transfer properties. In this example, the values are static, but the values can come from scan parameter groups defined on the action, or they can come from the result of an external system API call.
Example 2-1 Invoke Method Implementation
@Override public FileTransferPropertyInitializerProcessorResponse invoke( DiscoveryProcessorContext context, FileTransferPropertyInitializerProcessorRequest request) throws ProcessorException { FileTransferProperties ftProperties = new FileTransferProperties(); ftProperties.setFilePattern("*.txt"); ftProperties.setUser("someUser"); ftProperties.setPassword("myPassword"); ftProperties.setPort(21); ftProperties.setSessionTimeOut(120); ftProperties.setFileTransferType(FileTransferTypeT.FTP); ftProperties.setSrcFileManagement(SrcFileManagementTypeT.DELETE); return new FileTransferPropertyInitializerProcessorResponse(ftProperties);}
Network Integrity can fail to complete a file transfer using FTP or SFTP, and when the Source File Management is set to Rename, if the scope location already contains a file with the processed name. This problem is an inherent problem with FTP and SFTP. Ensure that the scope location does not contain a renamed file.
For example, to transfer and rename the file sample.txt from a remote location, ensure that the location does not also contain a file named sample.txtProcessed.