-
Examine the input stream (pInput) and decide how to use it.
This input type depends on the value of the Charset adapter setting:
-
Create an instance of the request message, which will be the message that your business service sends.
For information on creating message classes, see Defining Messages.
-
For the request message, set its properties as appropriate, using values in the input.
-
Call a suitable method of the business service to send the request to some destination within the production. Specifically, call SendRequestSync(), SendRequestAsync(), or (less common) SendDeferredResponse(). For details, see Sending Request Messages.
Each of these methods returns a status (specifically, an instance of %StatusOpens in a new tab).
-
Make sure that you set the output argument (pOutput). Typically you set this equal to the response message that you have received. This step is required.
-
Return an appropriate status. This step is required.
Invoking Adapter Methods
Within your business service, you might want to invoke the following instance methods of the adapter:
Connect()
Method Connect(pTimeout As %Numeric = 30,
pInbound As %Boolean = 0) As %Status
Connect to the FTP server and log in, setting the directory and transfer mode.
Disconnect()
Method Disconnect(pInbound As %Boolean = 0) As %Status
Disconnect from the FTP server.
ParseFilename()
Method ParseFilename(pFilenameLine As %String,
Output pTimestamp As %String,
Output pSize As %String) As %Boolean
TestConnection()
Method TestConnection()
Correct the properties reflecting the connection state, in case the adapter thinks it is connected but has lost the socket.
The following methods are also available. Each method corresponds to an adapter setting that the user can adjust using the Management Portal. Each time the user clicks Apply to accept changes to the value of a Setting, the corresponding SettingSet method executes. These methods provide the opportunity to make adjustments following a change in any setting. For detailed descriptions of each setting, see Reference for Settings.
ArchivePathSet()
Method ArchivePathSet(pInVal As %String) As %Status
ArchivePath is the directory where the adapter should place a copy of each file after processing.
CharsetSet()
Method CharsetSet(cset As %String) As %Status
Charset is the character set of the input file.
ConnectedSet()
Method ConnectedSet(pValue As %Boolean) As %Status
Connected is an internal property that tracks the adapter’s connection to the FTP server.
CredentialsSet()
Method CredentialsSet(pInVal As %String) As %Status
Credentials is a production credentials entry that can authorize a connection to the FTP server. For information on creating production credentials, see Defining Credentials.
FilePathSet()
Method FilePathSet(path As %String) As %Status
FilePath is the directory on the FTP server in which to look for files.
FTPPortSet()
Method FTPPortSet(port As %String) As %Status
FTPPort is the TCP Port on the FTP Server to connect to.
FTPServerSet()
Method FTPServerSet(server As %String) As %Status
FTPServer is the FTP Server to connect to. This can be the IP address or server name, as long as the domain host controller can resolve the name.
SSLConfigSet()
Method SSLConfigSet(sslcfg As %String) As %Status
SSLConfig is the TLS configuration entry to use to authenticate this connection.