Sun Adapter for SAP BAPI API

com.stc.connector.sapbapiadapter.sapbapi
Class BapiClient

java.lang.Object
  extended by com.stc.connector.sapbapiadapter.sapbapi.ConnectorClient
      extended by com.stc.connector.sapbapiadapter.sapbapi.BapiClient
All Implemented Interfaces:
Connector

public class BapiClient
extends ConnectorClient

A class that encapsulates all the necessary objects essential to executing (t)RFC-enabled ABAP/4 Functions on SAP (client mode)

Author:
$Author: rmaddula $

Field Summary
 
Fields inherited from class com.stc.connector.sapbapiadapter.sapbapi.ConnectorClient
XACT_COMMITROLLBACK_BAPI_STR, XACT_NONE_STR, XACT_TRFC_STR, XACT_XA_STR
 
Constructor Summary
BapiClient(SAPConnector sapconn)
          Constructs a BapiClient object with the given properties.
 
Method Summary
 void connect()
          Creates a JCO Client connection to the Application Server.
 void disconnect()
          Closes the JCO Client connection to the Application Server.
 boolean execute(com.sap.mw.jco.JCO.Function rfm)
          Executes (calls) synchronously the BAPI/RFC function on the Application Server.
 boolean execute(com.sap.mw.jco.JCO.Function rfm, java.lang.String eid, java.lang.String queueName)
          Executes (calls) asynchronously the BAPI/RFC function on the R/3 Application Server but in an ordered (queued) fashion.
 boolean executeAsynchronous(com.sap.mw.jco.JCO.Function rfm, java.lang.String eid)
          Executes (calls) asynchronously the BAPI/RFC function on the R/3 Application Server.
 boolean executeAsynchronous(com.sap.mw.jco.JCO.Function rfm, java.lang.String eid, java.lang.String queueName)
          Executes (calls) asynchronously the BAPI/RFC function on the R/3 Application Server but in an ordered (queued) fashion.
 void setCollabModeBPEL()
           
 
Methods inherited from class com.stc.connector.sapbapiadapter.sapbapi.ConnectorClient
commit, getBapiOTDVer, getClient, getClientMaxDBRows, getClientTiDManager, getClientTransactionalMode, getConnector, getLastActivityTime, getLastError, getSAPConnector, getSystemID, getTidDatabase, init, isClientAvailable, isClientDirty, isClientTrfcEnabled, isTrfcEnabled, rollback, setBapiOTDVer, setClient, setClientDirty, setClientNeeded, setClientTransactionMode, setLastActivityTime, setLastError, setMaxDBRows, setSAPConnector, setSystemID, setTidDatabase
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BapiClient

public BapiClient(SAPConnector sapconn)
Constructs a BapiClient object with the given properties.

Method Detail

execute

public boolean execute(com.sap.mw.jco.JCO.Function rfm)
                throws SAPException
Executes (calls) synchronously the BAPI/RFC function on the Application Server.

Parameters:
rfm - Remote Function Module to execute.
Throws:
SAPException - com.stc.connector.sapbapiadapter.sapbapi.SAPException Thrown if something went wrong during communication, marshalling, etc.

executeAsynchronous

public boolean executeAsynchronous(com.sap.mw.jco.JCO.Function rfm,
                                   java.lang.String eid)
                            throws SAPException
Executes (calls) asynchronously the BAPI/RFC function on the R/3 Application Server. When appropriate, confirmTID() is automatically called (when the JCS Transaction Manager commits) to allow R/3 to delete processed TIDs (Transaction ID) from its tracking database.

Parameters:
rfm - Remote Function Module to execute.
eid - The Event ID of the triggering event (via getHashKey()) to be used for this call.
Throws:
SAPException - Thrown if something went awry in the called function.

executeAsynchronous

public boolean executeAsynchronous(com.sap.mw.jco.JCO.Function rfm,
                                   java.lang.String eid,
                                   java.lang.String queueName)
                            throws SAPException
Executes (calls) asynchronously the BAPI/RFC function on the R/3 Application Server but in an ordered (queued) fashion. When appropriate, confirmTID() is automatically called (when the JCS Transaction Manager commits) to allow R/3 to delete processed TIDs (Transaction ID) from its tracking database.

Parameters:
rfm - Remote Function Module to execute.
eid - The Event ID of the triggering event (via getHashKey()) to be used for this call. If null, a synchronous RFC execute is done.
queueName - Queue to determine ordering. If null, a tRFC (asynchronous) execute is done.
Throws:
SAPException - Thrown if something went awry in the called function.

execute

public boolean execute(com.sap.mw.jco.JCO.Function rfm,
                       java.lang.String eid,
                       java.lang.String queueName)
                throws SAPException
Executes (calls) asynchronously the BAPI/RFC function on the R/3 Application Server but in an ordered (queued) fashion. When appropriate, confirmTID() is automatically called (when the JCS Transaction Manager commits) to allow R/3 to delete processed TIDs (Transaction ID) from its tracking database.

Parameters:
rfm - Remote Function Module to execute.
eid - The Event ID of the triggering event (via getHashKey()) to be used for this call. If null, a synchronous RFC execute is done.
queueName - Queue to determine ordering. If null, a tRFC (asynchronous) execute is done.
Throws:
SAPException - com.sap.mw.jco.JCO.AbapException Thrown if something went awry in the called function.

connect

public void connect()
             throws SAPException
Creates a JCO Client connection to the Application Server.

Throws:
SAPException - com.stc.connector.sapbapiadapter.sapbapi.SAPException Thrown if something went wrong during connection creation.

disconnect

public void disconnect()
                throws SAPException
Closes the JCO Client connection to the Application Server.

Throws:
SAPException - com.stc.connector.sapbapiadapter.sapbapi.SAPException Thrown if something went wrong during closing connection.

setCollabModeBPEL

public void setCollabModeBPEL()

Sun Adapter for SAP BAPI API