File and FTP adapters enable OIC to process files. These technology adapters are based on J2EE connector architecture (JCA).
Now the question is when to use File and when to use FTP adapter?
The selection of File and FTP adapters depends on the capabilities of these adapters and the use cases. let's see the different use cases and understand their usage
Use Case 1: You have to connect with a local file system which no security policy.
Use Case 2: You have to poll the files from the FTP server
Use Case 3: You have to connect the FTP server with a different authentication policy
Use Case 4: You have to Encrypt and Decrypt the file using PGP Key
For use cases 1 and 2 File Adapter is the best choice because it connects the file system without authentication and it also allows to poll of the data from the File server where an FTP adapter does not allow polling the data from FTP server
For use cases 3 and 4 FTP adapter is the best choice because it connects the file system with different authentication policies and it also allows to encrypt and decrypt the file where the File adapter does not allow these features till OIC version 22.2.1
File Adapter:
A file adapter is basically used to connect the local file system with the help of the agent.
File Adapter can be used as a trigger as well as invoke
Only Read File i.e. polling operation is possible for trigger type connection
For invoke type connection, multiple operations are possible like below
- Read File --> To read the file from the local file server
- Write File --> To write a file to the local file server
- List File --> To list the files
- Move File --> To move a file from location to other
- Delete File --> Delete file
- Download File --> Download from local file server to OIC server temporarily
To use the File adapter first create the connection
Sometimes you might work on the file content and sometimes you do not need the file content.
Depending on the use case you can select the structure of the content of the file by selecting yes. If you select no, it means you do not need the file content.
The structure of the file content can be described by choosing any one of the options below
- Sample delimited document (e.g. CSV)
- XML Schema (XSD document)
- Sample XML document (With one or no namespace)
- Sample JSON document
File Adapter as a Trigger
To use a file adapter for polling you have to create an app-driven integration. Post that drag and drop the file connection at the trigger point of the integration. By doing this, it will poll the files from the local file system one by one means per file one instance will be created at OIC.
You need to specify the parameters like input directory, file name pattern, and rejection directory, optionally you can select read files recursively.
You can also throttle the limit by entering Maximum file values and polling frequency and polling delays in seconds
After a successful read, you can also delete the file
No comments:
Post a Comment