The adapter developer must create a shared library or Dynamic Link Library (DLL) that contains functions to send or retrieve data from an application.
The e-ADK provides an example makefile to build the NNADKStubPlugIn.cpp into a library named:
On NT, nnadkstub.dll
On Solaris, libnnadkstub.so
On HP-UX, libnnadkstub.sl
On AIX, libnnadkstub.so
The functions must be named to conform to the e-ADK 3.9 requirements.
To set up your adapter, connect to your application, and create user data context:
initAdapter()
To shut down, disconnect from your application, and destroy user data:
shutdownAdapter()
For NDO Mode:
acquireSchema() - Create the structure to contain your data.
acquireData() - Retrieve data in an NDO from your application.
acquireCatalog() - Find formats available for your adapter.
deliverData() - Write data to your application.
acknowledgePutData() - Do processing necessary as the result of the e-ADK notifying the adapter plug-in of the success in putting a message (ack) or failing to put a message (nack) to a transport. Applicable for acquire and process modes.
processData() - Modify given data by interacting with your application.
handleQuietState() - Do processing necessary during a prolonged retry loop when the e-ADK is trying to get a message from a transport but the transport is empty. Applicable during Process and Deliver mode. For example, while waiting for messages from the transport, you could shut down your database or do some other processing to prevent your database from timing out. handleQuietState is supported in both tree and buffer data representation.
commitDeliveredMessages() - Optional callback function that is required only if batch Deliver mode is implemented. The e-ADK calls this function to notify the adapter plug-in that it is ready to commit the delivered batch. Based on the return value, the e-ADK commits the batch and continues, rolls back the batch and continues, or rolls back the batch and initiates a shutdown.
For Buffer Mode:
acquireBuffer() - Retrieve data in a buffer from your application
deliverBuffer() - Write buffer data to your application
acknowledgePutBuffer() - Do any processing necessary as the result of the e-ADK notifying the adapter plug-in of the success or failure in putting a message to a transport. Applicable for acquire and process modes.
process buffer() - Modify given buffer data by interacting with your application
commitDeliveredMessages() - Optional callback function that is required only if batch Deliver mode is implemented. The e-ADK calls this function to notify the adapter plug-in that it is ready to commit the delivered batch. Based on the return value, the e-ADK commits the batch and continues, rolls back the batch and continues, or rolls back the batch and initiates a shutdown.
The following classes are used by the adapter plug-in functions:
NDO classes with header file references
include/NDO/NNDOObject.h
include/NDO/NNDODataTree.h
include/NDO/NNDOSchemaTree.h
include/NDO/NNDODataNode.h
include/NDO/NNDOSchemaNode.h
include/ADK/NNDataBuffer.h
include/ADK/NNADKOutOfBand.h
include/CFG/NNConfig.h