Data Transformation Engine Services Guide

Chapter 21 – Adding the Adapter to Mercator Command Server
120
after $(USER_ADAPTERS). This adds the libmynewadapter.a as an archive library to
be linked with the Mercator Command Server.
There is also a makefile for the SDK called testapi.mak. Similar changes will be
necessary here in order to add a new adapter.
Mercadpt.ini
The mercadpt is a component of Mercator Command Server that maintains
information about what each adapter is capable of. This information is hard-coded into
that component for Mercator supplied adapters (for example, FTP adapter, Tuxedo
adapter). For the NonStop server implementation, the ability to add adapters at build
time has been implemented. The mercadpt.ini file is the mechanism that allows this
capability. Mercator Command Server will read this file at startup time to obtain
information about new adapters and add such information to it’s internal tables.
The mercadpt.ini file is located by a environment variable
MERC_ADAPT_INIT_FILE. This environment variable should contain the path and
filename; for example, /installdir/bin/mercadpt.ini. If the environment variable is not
defined, it will be assumed the filename is mercadpt.ini in the current directory.
You must add information to the mercadpt.ini file pertaining to your adapter. Below is
the mercadpt.ini file as it is shipped to include the sample adapter “useradapter”.
To add your new adapter, duplicate all of the lines in this file (starting with
[USERADPTER]) as shown below. You may optionally remove all the entries for
[USERADAPTER] or just leave them there. The mercadpt.ini file can have up to 10
adapter definitions. The first definition that is found will be used. Subsequent definitions
for the same entry will be ignored.
mercadpt.ini parameters:
Defaults for all string parameters are “NULL”.
Defaults for TRUE/FALSE parameters are indicated as underlined.
PARAMETER NAME: PARAMETER PARAMETER DESCRIPTION:
Cmdline_Arg String Abbreviation to use in command-line overrides (that is, -IM, -IA, -OM, -OA).
For example, to specify the sample adapter in a file override, the
map would say “-IAUA” or “-IMUA”.
Cmdline_Mask String Resource Mask applied to command-line when resolving
resource contention. For example, on the sample adapter the flags
are “-s % -h %”; meaning that they cannot be the same values
and achieve an identical connection.
Init_Function String Entry point name of the Adapter Initialization Function
Get_Function String Entry point name of the Get Data Function
Put_Function String Entry point name of the Put Data Function
Shutdown_Function String Entry point name of the Adapter Shutdown Function
Validate_Cmd_Function String Entry point name of the Command-line parsing Function
Compare_Connection_Function String Entry point name of the Compare Connection Function.
Connect_Function String Entry point name of the Connect Function.
DisConnect_Function String Entry point name of the Disconnect Function.
Validate_Connection_Function String Entry point name of the Validate Connection Function
Free_Adapter_Parm String Entry point name of the Free Adapter Parm function.
Case_Sensitive TRUE/FALSE Command line parameter case sensitivity. For example, on a command line, is
“-h hostname” equivalent to-H hostname”. TRUE says it is not equivalent.
Defunct TRUE/FALSE Adapter is functional or non-functional. A FALSE value here will effectively not