To develop a JCA adapter for other native protocols, you must create a MessageTranslator class and then define objects that define how your JCA adapter communicates with the native protocols.
These attributes are initialized to null values, so that if a particular JCA implementation does not require any of the fields, you can create a BaseConnectionSpec object using its default constructor and initialize the values or retrieve the values only for the required attributes using the setter/getter methods.
public class ProtocolName lInteration implments javax.resource.cci.Interaction { public void close() throws javax.resource..ResourceException { // Close the connections established with the Network Entity } public Connection getConnection() { // Retrieves the object corresponding to the connection //established with the SMSC } public boolean execute(InteractionSpec arg0, Record request, Record response)throws ResourceException { // Type cast the InteractionSpec to BaseInteractionSpec type. BaseInteractionSpec csSepc = (BaseInteractionSpec) ispec; // Extract the function Name from the InteractionSpec String functionName = csSepc.getFunctionName(); // Check the function name for the values // SendMessage // BindToNE // StartMOMessages // MonitorHeartBeat // QueryMessageStatus if(functionName.equals("BindToNE ") || functionName.equals("StartMOMessages ")){ // Parse the Record corresponding to the function BindToNERequest bindRecordFrmReq = (BindToNetworkElement)record; // Construct the JCA Records corresponding to the native protocol // Establish a connection with the Network Element // Construct the JCA Record corresponding to Parlay X adding the conection status // Send the response back to SI Layer using the "BindToNEResponse" record } if(functionName.equals("SendMessage"){ // Send the response back to SI Layer using the record SendMessageResponse SendMessageRequest smsRecord = (SendMessageRequest)record; // Construct the JCA Records corresponding to the native protocol using the MessageTranslator object // Send the message to the Network Element // Send the response back to SI Layer } if(functionName.equals("MonitorHeartBeat "){ // Parse the Record corresponding to Parlay X MonitorHeartBeat heartBeatRecord = (MonitorHeartBeat)record; // Construct the JCA Records corresponding to the native protocol using the // MessageTranslator object // Send the message to the Network Element // Send the response with the connection status to SI Layer } if(functionName.equals("QueryMessageStatus"){ // Parse the Record corresponding to Parlay X QueryStatusRequest queryStatusRecord = (QueryStatusRequest)record; // Construct the JCA Records corresponding to the native protocol using the // MessageTranslator object // Send the message to the Network Element // Send the response with the message status to SI Layer using the record "QueryStatusResponse" } }