Data Transformation Engine Services Guide

Chapter 17 Calling Interface for Functions
103
LpAdaptParms Used as output, contains the adapter specific parameter block of the “parsed” command
LpWildcard Used as input, contains the wildcard data to be substituted in (see Wildcard Substitutions’)
DwWildcardSize Used as input, contains the size of the wildcard
LpszMapDirectory Used as input, the full path to the directory of the MMC file
WcardNum Used as input, the card number (offset from 0?)
WcleanupAction Used as input, the action to be taken on cleanup
Wscope Used as input, the scope of the transaction
UunitSize Used as input, the size of the fetch unit
Bburst Used as input, TRUE if the card mode is burst.
BfromRule Used as input, TRUE if calling from a rule (GET or PUT)
Bsource Used as input, TRUE if calling as a source of data (input card or GET function)
The function parses the command line (lpszCmdLine) and returns an adapter specific
structure (in lpAdaptParms) that contains the parsed elements of the command. The
adapter must also copy into its structure those other properties that influence whether
connections may be shared or not (such as transactional scope, rollback, backup and so
on). When the Resource Manager calls the ‘Compare Connections’ function, the only
information the adapter has is the information in the adapter-specific parameters;
therefore the adapter must store anything relevant to this decision.
If any errors are found in the command line, an error message and code is returned.
As an example, the sample adapter useradapter defines the lpAdaptParms structure as
follows:
typedef struct UAAdaptParms
{
BOOL bRollback;
WORD wScope;
int nLtime;
int nRtime;
int nTS;
int connect;
char szHname[128];
char szService[128];
char szThishost[128];
UAContext_t *context;
} UAAdaptParms_t;
A command line such as “-s serviceh hostname” would populate the structure fields:
SzHname = “hostname”;
SzService = “service”;
Connect Command
This function is called by the Resource Manager to make the connection to the resource.
The function has the prototype:
void Connect ( EXITPARAM *lpep );
where:
DwSize The size of EXITPARAM to assure correct compatibility.
DwMapInstance Used as input, a unique identifier based on an instance of a particular map.
Lpv Used as output, the adapter may use lpv for its own purpose to store some contextual information. The value
of lpv will be preserved and returned to the adapter on subsequent calls. Although this value could now be
stored in lpAdaptParms, lpv should be preserved so applications or adapters that reference it do not have to
change.
URetryCount Used as input, a retry count specified by the user.
URetryInterval Used as input, a retry interval (in seconds) specified by the user.
BRollback Used as input, whether or not the user specified rollback.
NReturn Used as output, contains the return code representing whether a connection could be made or not.