com.ibm.di.connector.sapr3.aleidoc
Class SapALEIDocConnector

java.lang.Object
  extended by com.ibm.di.connector.Connector
      extended by com.ibm.di.connector.sapr3.aleidoc.SapALEIDocConnector
All Implemented Interfaces:
ConnectorInterface, VersionInfoInterface

public class SapALEIDocConnector
extends Connector
implements ConnectorInterface

The SAP R/3 and ERP ALE IDoc Server Connector.

The connector enables external applications, using TDI, to access SAP Intermediate Documents (IDocs) sent from an SAP R/3 or ERP client system. It supports the following TDI Connector Modes: Iterator The connector supports design time schema query via querySchema(java.lang.Object). When parsing is enabled the input attribute mapping must be created manually based on the IDoc message type being processed.

The configuration parameters of the connector are described below. IDoc Server SAP Gateway Host
The SAP Gateway host name or IP address for the R/3 RFC connection.

IDoc Server SAP Gateway Service
The SAP Gateway service name for R/3 RFC connection. Standard naming convention is the string "sapgw" appended with the SAP System Number. i.e. A SAP System with System number "00" would normally have a gateway service of "sapgw00".

IDoc Server Program ID
The SAP JCo Server external program identifier. This is used when configuring the SAP RFC destination to be used by logical system that will represent the TDI IDco Server Connector in SAL ALE distrbution models.

IDoc Server Program ID
The SAP JCo Server external program identifier. This is used when configuring the SAP RFC destination to be used by logical system that will represent the TDI IDco Server Connector in SAL ALE distrbution models.

IDoc Server Unicode Connection?
The SAP JCo Server needs this set when the client SAP R/3 or ERP system requires a unicode RFC connection.

IDoc Server Optional Connection Parameters
The SAP JCo Server optional RFC connection parameters. Delimite with space char. i.e. "jco.server.trace=1 jco.server.sysnr=00"

IDoc Server Poll Time
The Connector waits for incoming IDoc requests to be created on an internal Inbound IDoc queue. This is the period of time between checks on the queue for new Inbound IDoc requests. This time is also used in the TID Management processing when waiting for a particular transaction to be confirmed by the SAP Client and the connectors Iterator mode functionality.

IDoc Client Number
The SAP JCo Client RFC connection parameter that identifies the SAP System client identifier from which IDoc requests are made on the Connector.

IDoc Client User
The SAP JCo Client RFC connection parameter that identifies the SAP User Account used to authenticate the RFC connection.

IDoc Client Password
The SAP JCo Client RFC connection parameter that identifies the SAP User Account's password used to authenticate the RFC connection.

IDoc Client Lang
The SAP JCo Client RFC connection parameter that identifies the RFC connection logon language.

IDoc Client Hostname
The SAP JCo Client RFC connection parameter that identifies the client SAP R/3 or ERP system's hostname or IP address.

IDoc Client System Number
The SAP JCo Client RFC connection parameter that identifies the client SAP R/3 or ERP system number.

IDoc Client SAP Gateway Servicer
The SAP JCo Client RFC connection parameter that identifies the SAP Gateway service name for R/3 RFC connection. Standard naming convention is the string "sapgw" appended with the SAP System Number. i.e. A SAP System with System number "00" would normally have a gateway service of "sapgw00".

IDoc Client SAP Gateway Host
The SAP JCo Client RFC connection parameter that identifies the SAP Gateway host name or IP address for R/3 RFC connection.

IDoc Client Max Connections
The maximum allowed SAP JCo Client RFC connections in the internal JCo Client Connection pool.

IDoc Client Optional Connection Parameters
The SAP JCo Server optional RFC connection parameters. Delimite with space char. i.e. "jco.client.trace=1 jco.client.use_sapgui=1" pool.

IDoc As XML Only?
If set then only one attribute will be provided to represent the IDoc. This attribute's value is an XML representation of the IDoc. pool.

Process SAP RFM Requests?
If set then any Remote Function Module calls made on the JCo Server will be handled. The result is an attribute in the TDI entry who's value is an XML represenation of the RFM invoked. pool.

Parse IDoc or RFM XML?
If set then any if the attributes representing the IDoc or RFM call as XML are available, then they will be parsed with the appropriate TDI XML parser attached. The only parser options are the DOM, SAX and XSLT TDI parsers.

Enable JCo Middleware Trace Logging?
If set then the JCo trace listener will be instantiated and attached to the JCo IDoc Server. The trace messages and their level will be contained within the TDI trace mechanism.

JCo Middleware Trace Level
Sets the minimum JCo trace level allowed to be captured by the TDI trace mechanism.

JCo Middleware Trace File Path
Sets the path where the JCo trace files will be dumped.


Field Summary
static String ATTR_ARCKEY
           
static String ATTR_CHILD_SEG_PREFIX
           
static String ATTR_CIMTYP
           
static String ATTR_CREDAT
           
static String ATTR_CRETIM
           
static String ATTR_DESC_SEG_PREFIX
           
static String ATTR_DIRECT
           
static String ATTR_DOCNUM
           
static String ATTR_DOCREL
           
static String ATTR_DOCTYP
           
static String ATTR_EXPRSS
           
static String ATTR_IDOC_AS_XML
           
static String ATTR_IDOC_TID
           
static String ATTR_IDOCTYP
           
static String ATTR_LENGTH_STRING
           
static String ATTR_MANDT
           
static String ATTR_MESCOD
           
static String ATTR_MESFCT
           
static String ATTR_MESTYP
           
static String ATTR_OUTMOD
           
static String ATTR_RCVLAD
           
static String ATTR_RCVPFC
           
static String ATTR_RCVPOR
           
static String ATTR_RCVPRN
           
static String ATTR_RCVPRT
           
static String ATTR_RCVSAD
           
static String ATTR_REFGRP
           
static String ATTR_REFINT
           
static String ATTR_REFMES
           
static String ATTR_RFM_AS_XML
           
static String ATTR_SCHEMA_LENGTH
           
static String ATTR_SCHEMA_NAME
           
static String ATTR_SCHEMA_SYNTAX
           
static String ATTR_SERIAL
           
static String ATTR_SNDLAD
           
static String ATTR_SNDPFC
           
static String ATTR_SNDPOR
           
static String ATTR_SNDPRN
           
static String ATTR_SNDPRT
           
static String ATTR_SNDSAD
           
static String ATTR_STATUS
           
static String ATTR_STD
           
static String ATTR_STDMES
           
static String ATTR_STDVRS
           
static String ATTR_SYNTAX_STRING
           
static String ATTR_TABNAM
           
static String ATTR_TEST
           
protected  Properties clientConnProps
           
static String CONFIG_PARAM_IDOC_XMLONLY
           
static String CONFIG_PARAM_PARSE_IDOC_XML
           
static String CONFIG_PARAM_QUEUE_POLE_TIME
           
static String CONFIG_PARAM_RFM_XML
           
static String JCO_TRACE_PATH
           
static String LINE_SEP
           
 boolean mDebugEnabled
           
static String NO
           
static String OFF
           
static String ON
           
protected  com.sap.mw.idoc.IDoc.Repository sapALEIDocRepos
           
protected  SapIDocServerImpl sapALEIDocServer
           
protected  SapIDocServerListener sapALEIdocSrvrListener
           
protected  com.sap.mw.jco.IRepository sapALEIRepos
           
protected  Properties serverConnProps
           
static String UNKNOWN_TID
           
static String YES
           
 
Fields inherited from class com.ibm.di.connector.Connector
ALL_MODES, myLog, PROPERTY_MESSAGE, PROPERTY_READER, PROPERTY_WRITER
 
Constructor Summary
SapALEIDocConnector()
          Default constucter for SapALEIDocConnector object.
 
Method Summary
 String getJcoServerProgId()
           
 ConnectorInterface getNextClient()
          This method is to called for Server modes.
 Entry getNextEntry()
          Returns a TDI entry that represents either an SAP client IDoc or RFM request.
 SapIDocServerListener getSapALEIdocApp()
           
 com.sap.mw.idoc.IDoc.Repository getSapALEIDocRepos()
           
 SapIDocServerImpl getSapALEIDocServer()
           
 com.sap.mw.jco.IRepository getSapALEIRepos()
           
 Properties getServerConnProps()
           
 Map getTidIDocMap()
           
 String getVersion()
          Returns the version of the connector based on source repository variables.
 void initialize(Object o)
          This method is called once after the connector configuration file has been provided by the caller.
 boolean isConnParamValueValid(String key, boolean mandatory)
          Checks if a Connector configuration parameter is valid for use.
 Object querySchema(Object o)
          This method is to populate the available connector variables for input and output mapping into AL work entry attributes.
 void reconnect()
          This method is to called for all modes.
 void replyEntry(Entry requestResult)
          This method is to called for Server modes.
 void selectEntries()
          This method is to called for both Iterator and Server modes.
 void terminate()
          This method is to called for all modes.
 void terminateServer()
          This method is to called for all modes.
 
Methods inherited from class com.ibm.di.connector.Connector
addFindEntry, allModes, clearFindEntries, debug, debugMode, deleteEntry, findEntry, findEntry, getBoolean, getClassInstance, getConfiguration, getContext, getFindEntryCount, getFirstFindEntry, getLog, getMaxDuplicateEntries, getModes, getModes, getName, getNextFindEntry, getParam, getParser, getProperty, getPushbackEntry, getRawConnectorConfiguration, getRSInterface, getUI, hasConfigValue, hasParser, initParser, isDeltaSupported, isExceptionFatal, isIOException, logError, logmsg, modEntry, modEntry, pushback, putEntry, queryOperations, queryReply, queryTables, reconnect, registerScriptBeans, setConfiguration, setContext, setCurrent, setDebugMode, setLog, setMaxDuplicateEntries, setModes, setModes, setName, setParam, setParser, setProperty, setRSInterface
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ibm.di.connector.ConnectorInterface
deleteEntry, findEntry, getConfiguration, getContext, getFindEntryCount, getFirstFindEntry, getMaxDuplicateEntries, getName, getNextFindEntry, getParam, getPushbackEntry, getRawConnectorConfiguration, isDeltaSupported, isExceptionFatal, isIOException, modEntry, modEntry, pushback, putEntry, queryOperations, queryReply, reconnect, registerScriptBeans, setConfiguration, setContext, setCurrent, setLog, setMaxDuplicateEntries, setName, setParam, setRSInterface
 

Field Detail

LINE_SEP

public static final String LINE_SEP

UNKNOWN_TID

public static final String UNKNOWN_TID
See Also:
Constant Field Values

ATTR_SCHEMA_NAME

public static final String ATTR_SCHEMA_NAME
See Also:
Constant Field Values

ATTR_SCHEMA_SYNTAX

public static final String ATTR_SCHEMA_SYNTAX
See Also:
Constant Field Values

ATTR_SYNTAX_STRING

public static final String ATTR_SYNTAX_STRING
See Also:
Constant Field Values

ATTR_SCHEMA_LENGTH

public static final String ATTR_SCHEMA_LENGTH
See Also:
Constant Field Values

ATTR_LENGTH_STRING

public static final String ATTR_LENGTH_STRING
See Also:
Constant Field Values

ATTR_IDOC_TID

public static final String ATTR_IDOC_TID
See Also:
Constant Field Values

ATTR_IDOC_AS_XML

public static final String ATTR_IDOC_AS_XML
See Also:
Constant Field Values

ATTR_ARCKEY

public static final String ATTR_ARCKEY
See Also:
Constant Field Values

ATTR_MANDT

public static final String ATTR_MANDT
See Also:
Constant Field Values

ATTR_CREDAT

public static final String ATTR_CREDAT
See Also:
Constant Field Values

ATTR_CRETIM

public static final String ATTR_CRETIM
See Also:
Constant Field Values

ATTR_DIRECT

public static final String ATTR_DIRECT
See Also:
Constant Field Values

ATTR_REFMES

public static final String ATTR_REFMES
See Also:
Constant Field Values

ATTR_REFGRP

public static final String ATTR_REFGRP
See Also:
Constant Field Values

ATTR_STDMES

public static final String ATTR_STDMES
See Also:
Constant Field Values

ATTR_STD

public static final String ATTR_STD
See Also:
Constant Field Values

ATTR_STDVRS

public static final String ATTR_STDVRS
See Also:
Constant Field Values

ATTR_REFINT

public static final String ATTR_REFINT
See Also:
Constant Field Values

ATTR_EXPRSS

public static final String ATTR_EXPRSS
See Also:
Constant Field Values

ATTR_DOCTYP

public static final String ATTR_DOCTYP
See Also:
Constant Field Values

ATTR_DOCNUM

public static final String ATTR_DOCNUM
See Also:
Constant Field Values

ATTR_DOCREL

public static final String ATTR_DOCREL
See Also:
Constant Field Values

ATTR_IDOCTYP

public static final String ATTR_IDOCTYP
See Also:
Constant Field Values

ATTR_CIMTYP

public static final String ATTR_CIMTYP
See Also:
Constant Field Values

ATTR_MESCOD

public static final String ATTR_MESCOD
See Also:
Constant Field Values

ATTR_MESFCT

public static final String ATTR_MESFCT
See Also:
Constant Field Values

ATTR_MESTYP

public static final String ATTR_MESTYP
See Also:
Constant Field Values

ATTR_OUTMOD

public static final String ATTR_OUTMOD
See Also:
Constant Field Values

ATTR_RCVSAD

public static final String ATTR_RCVSAD
See Also:
Constant Field Values

ATTR_RCVLAD

public static final String ATTR_RCVLAD
See Also:
Constant Field Values

ATTR_RCVPFC

public static final String ATTR_RCVPFC
See Also:
Constant Field Values

ATTR_RCVPRN

public static final String ATTR_RCVPRN
See Also:
Constant Field Values

ATTR_RCVPRT

public static final String ATTR_RCVPRT
See Also:
Constant Field Values

ATTR_RCVPOR

public static final String ATTR_RCVPOR
See Also:
Constant Field Values

ATTR_SNDSAD

public static final String ATTR_SNDSAD
See Also:
Constant Field Values

ATTR_SNDLAD

public static final String ATTR_SNDLAD
See Also:
Constant Field Values

ATTR_SNDPFC

public static final String ATTR_SNDPFC
See Also:
Constant Field Values

ATTR_SNDPRN

public static final String ATTR_SNDPRN
See Also:
Constant Field Values

ATTR_SNDPRT

public static final String ATTR_SNDPRT
See Also:
Constant Field Values

ATTR_SNDPOR

public static final String ATTR_SNDPOR
See Also:
Constant Field Values

ATTR_SERIAL

public static final String ATTR_SERIAL
See Also:
Constant Field Values

ATTR_TABNAM

public static final String ATTR_TABNAM
See Also:
Constant Field Values

ATTR_STATUS

public static final String ATTR_STATUS
See Also:
Constant Field Values

ATTR_TEST

public static final String ATTR_TEST
See Also:
Constant Field Values

ATTR_RFM_AS_XML

public static final String ATTR_RFM_AS_XML
See Also:
Constant Field Values

ATTR_CHILD_SEG_PREFIX

public static final String ATTR_CHILD_SEG_PREFIX
See Also:
Constant Field Values

ATTR_DESC_SEG_PREFIX

public static final String ATTR_DESC_SEG_PREFIX
See Also:
Constant Field Values

CONFIG_PARAM_QUEUE_POLE_TIME

public static final String CONFIG_PARAM_QUEUE_POLE_TIME
See Also:
Constant Field Values

CONFIG_PARAM_IDOC_XMLONLY

public static final String CONFIG_PARAM_IDOC_XMLONLY
See Also:
Constant Field Values

CONFIG_PARAM_RFM_XML

public static final String CONFIG_PARAM_RFM_XML
See Also:
Constant Field Values

CONFIG_PARAM_PARSE_IDOC_XML

public static final String CONFIG_PARAM_PARSE_IDOC_XML
See Also:
Constant Field Values

JCO_TRACE_PATH

public static final String JCO_TRACE_PATH
See Also:
Constant Field Values

YES

public static final String YES
See Also:
Constant Field Values

NO

public static final String NO
See Also:
Constant Field Values

ON

public static final String ON
See Also:
Constant Field Values

OFF

public static final String OFF
See Also:
Constant Field Values

sapALEIdocSrvrListener

protected SapIDocServerListener sapALEIdocSrvrListener

serverConnProps

protected Properties serverConnProps

clientConnProps

protected Properties clientConnProps

sapALEIRepos

protected com.sap.mw.jco.IRepository sapALEIRepos

sapALEIDocRepos

protected com.sap.mw.idoc.IDoc.Repository sapALEIDocRepos

sapALEIDocServer

protected SapIDocServerImpl sapALEIDocServer

mDebugEnabled

public boolean mDebugEnabled
Constructor Detail

SapALEIDocConnector

public SapALEIDocConnector()
Default constucter for SapALEIDocConnector object.

Method Detail

getVersion

public String getVersion()
Returns the version of the connector based on source repository variables.

Specified by:
getVersion in interface VersionInfoInterface
Returns:
A String format for the version of this released Connector.

initialize

public void initialize(Object o)
                throws SapALEIDocConnectorException
This method is called once after the connector configuration file has been provided by the caller.

Specified by:
initialize in interface ConnectorInterface
Overrides:
initialize in class Connector
Parameters:
o - TDI config object. Not used.
Throws:
SapALEIDocConnectorException - When an error happens during class initialization.

isConnParamValueValid

public boolean isConnParamValueValid(String key,
                                     boolean mandatory)
Checks if a Connector configuration parameter is valid for use.

Parameters:
key - - The key for the Connector configuration parameter being checked.
mandatory - - flag indicating if the Connector configuration parameter is obligatory.
Returns:
boolean result on the validity of the Connector configuration parameter.

getNextEntry

public Entry getNextEntry()
                   throws SapALEIDocConnectorException
Returns a TDI entry that represents either an SAP client IDoc or RFM request. The entries are pulled from TIDManager objects sitting in the Inbound IDoc queue.

Specified by:
getNextEntry in interface ConnectorInterface
Overrides:
getNextEntry in class Connector
Returns:
TDI entry or null.
Throws:
SapALEIDocConnectorException - When an error occurs.
See Also:
ConnectorInterface.selectEntries()

querySchema

public Object querySchema(Object o)
                   throws SapALEIDocConnectorException
This method is to populate the available connector variables for input and output mapping into AL work entry attributes.

Specified by:
querySchema in interface ConnectorInterface
Overrides:
querySchema in class Connector
Parameters:
o - TDI schema object. Not used.
Returns:
A Vector of com.ibm.di.entry.Entry objects describing each entity
Throws:
SapALEIDocConnectorException - When an error occurs.
See Also:
Entry, Vector

selectEntries

public void selectEntries()
                   throws SapALEIDocConnectorException
This method is to called for both Iterator and Server modes. Normally this method would block until there was an IDoc to process. This connector has a non-standard iterator mode where getNextEntry() will block and not return null to mimick an asynchronous Server mode.

Specified by:
selectEntries in interface ConnectorInterface
Overrides:
selectEntries in class Connector
Throws:
SapALEIDocConnectorException - When an error occurs.

getNextClient

public ConnectorInterface getNextClient()
                                 throws SapALEIDocConnectorException
This method is to called for Server modes. This method blocks until there is an IDoc to process. If the IDoc Server can't be started then this method will return null.

Specified by:
getNextClient in interface ConnectorInterface
Overrides:
getNextClient in class Connector
Returns:
An instance of this connector for a seperate thread in the AL.
Throws:
SapALEIDocConnectorException - When an error occurs.

replyEntry

public void replyEntry(Entry requestResult)
This method is to called for Server modes. This method would normally be used to build and send a response to the client. As the IDoc communication is asynchronous this method does nothing for this release of the Connector.

Specified by:
replyEntry in interface ConnectorInterface
Overrides:
replyEntry in class Connector
Parameters:
requestResult - the information as an Entry

terminateServer

public void terminateServer()
This method is to called for all modes. This method is used to stop the IDoc Server.

Specified by:
terminateServer in interface ConnectorInterface
Overrides:
terminateServer in class Connector

terminate

public void terminate()
This method is to called for all modes. This method is used to stop the IDoc Server. Stopping the IDoc Server affects the TID management cycle so this method does nothing for this release of the Connector.

Specified by:
terminate in interface ConnectorInterface
Overrides:
terminate in class Connector

reconnect

public void reconnect()
               throws SapALEIDocConnectorException
This method is to called for all modes. This method is used to stop and start the IDoc Server. If the IDoc server is stopped it can't be restarted so this method suspends then restarts the IDoc Server.

Overrides:
reconnect in class Connector
Throws:
SapALEIDocConnectorException
See Also:
Connector.initialize(Object)

getSapALEIdocApp

public SapIDocServerListener getSapALEIdocApp()
Returns:
Returns the IDoc Server listener object.

getSapALEIDocRepos

public com.sap.mw.idoc.IDoc.Repository getSapALEIDocRepos()
Returns:
Returns the IDoc Server IDoc repository object.

getSapALEIDocServer

public SapIDocServerImpl getSapALEIDocServer()
Returns:
Returns the IDoc Server object

getSapALEIRepos

public com.sap.mw.jco.IRepository getSapALEIRepos()
Returns:
Returns the IDoc Server JCo repository object.

getServerConnProps

public Properties getServerConnProps()
Returns:
Returns the IDoc Server RFC Connection properties.

getTidIDocMap

public Map getTidIDocMap()
Returns:
Returns the IDoc Server Inbound IDoc request queue.

getJcoServerProgId

public String getJcoServerProgId()
Returns:
Returns the IDoc Server program ID. Required when configuring the RFC Destination on the SAP Client.