Overview of User Exit Messages

Sterling Connect:Direct sends and receives messages, using the send_exit_msg() and the recv_exit_msg() functions for a C++ program or the send_exit_msg_c() and the recv_exit_msg_c() functions for a C program. For the exact definition of the data sent in each message, see the files located in d_dir/ndm/include/ user_exit.h and d_dir/ndm/include/user_exit2.h.

Note: The copy control block is defined in user_exit2.h.

Statistics Exit Message

The statistics exit has only one type of message, the STATISTICS_LOG_MSG.

Sterling Connect:Direct sends a STATISTICS_LOG_MSG to the user exit program. Every time Sterling Connect:Direct writes a statistic record, this message provides an exact copy of the character string. The STATISTICS_LOG_MSG contains the Sterling Connect:Direct statistics record.

File Open Exit Messages

The file open exit has four types of messages:

vFILE_OPEN_OUTPUT_MSG

vFILE_OPEN_OUTPUT_REPLY_MSG

vFILE_OPEN_INPUT_MSG

vFILE_OPEN_INPUT_REPLY_MSG

The file open exit has the following limitations:

vThe oflag parameter passed to the user exit is already calculated based on the file disposition, as explicitly specified on the copy statement or using the default value. If the user exit changes the oflag to truncate and the original disposition is mod meaning the copy will append to the end of file if the file already exists, then the user exit causes the Process to behave differently from how the Process language is documented.

vDo not change the file type specified by the Process. For example, if the Process specifies a regular file, the user exit cannot open and return a file descriptor for a pipe. No facility is available to modify contents of the copy control block and return it to Sterling Connect:Direct.

vIf the oflag specifies opening a file with write access and the user exit changes access to read-only, Sterling Connect:Direct will fail when it attempts to write to a read-only file.

vThe upload and download parameters that restrict directory access are ignored for this user exit.

FILE_OPEN_OUTPUT_MSG

During the copy statement process, Sterling Connect:Direct sends a

FILE_OPEN_OUTPUT_MSG to the user exit program to open the destination file. The FILE_OPEN_OUTPUT_MSG contains:

vThe open function oflag parameter (for example, O_CREATO_RDWRO_TRUNC)

vThe open function mode parameter, which controls file permissions

vUNIX user ID that will own the file

vUNIX group ID that will own the file

Chapter 5. Writing User Exits 79

Page 85
Image 85
IBM 4J manual Overview of User Exit Messages, Statistics Exit Message, File Open Exit Messages