com.waveset.adapter
Class SAPHRActiveSyncAdapter.AdapterIDocServer

java.lang.Object
  extended bycom.sap.mw.jco.JCO.Connection
      extended bycom.sap.mw.jco.JCO.Server
          extended bycom.sap.mw.idoc.jco.JCoIDoc.Server
              extended bycom.waveset.adapter.SAPHRActiveSyncAdapter.AdapterIDocServer
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Runnable
Enclosing class:
SAPHRActiveSyncAdapter

public class SAPHRActiveSyncAdapter.AdapterIDocServer
extends com.sap.mw.idoc.jco.JCoIDoc.Server

Class MyIDocServer is for receiving IDocs and function requests. The reason for implementing the class as an inner class of the adapter is only to keep all the source code within one file.


Field Summary
 
Fields inherited from class com.sap.mw.jco.JCO.Server
AUTHORIZATION_MODE_BASIC, AUTHORIZATION_MODE_SNC, FUNCTION_MODEL, m_middleware, REQUEST_RESPONSE_MODEL
 
Fields inherited from class com.sap.mw.jco.JCO.Connection
attributes, codepage_converter, conn_object, conn_params, connection_cpc_mode, dsr_monitor, jarm_monitor, last_active_timestamp, num_received_bytes, num_sent_bytes, passport_bytes, pool, properties, rfc_handle, rfm_name, start_time, state, throughput, time_handle_request, time_middleware, time_total
 
Constructor Summary
SAPHRActiveSyncAdapter.AdapterIDocServer(java.util.Properties properties, com.sap.mw.jco.IRepository jcoRepository, com.sap.mw.idoc.IDoc.Repository idocRepository)
          Overridden constructor of JCoIDoc.Server.
SAPHRActiveSyncAdapter.AdapterIDocServer(java.lang.String gwhost, java.lang.String gwserv, java.lang.String progid, com.sap.mw.jco.IRepository jcoRepository, com.sap.mw.idoc.IDoc.Repository idocRepository)
          Overridden constructor of JCoIDoc.Server.
 
Method Summary
protected  void getPath(com.sap.mw.idoc.IDoc.Segment seg, java.lang.StringBuffer sb)
          Recurse up the tree, put the segment names in the string buffer as the recursion unwinds.
protected  void handleRequest(com.sap.mw.idoc.IDoc.DocumentList documentList)
          Overridden method of JCoIDoc.Server.
protected  void handleRequest(com.sap.mw.jco.JCO.Function function)
          Overridden method of JCoIDoc.Server.
protected  boolean onCheckTID(java.lang.String tid)
          This function will be invoked when a transactional RFC is being called from a SAP R/3 system.
protected  void onCommit(java.lang.String tid)
          This function will be called after all RFC functions belonging to a certain transaction have been successfully completed.
protected  void onConfirmTID(java.lang.String tid)
          This function will be called after the local transaction has been completed.
protected  void onRollback(java.lang.String tid)
          This function will be called if an error in one of the RFC functions belonging to a certain transaction has occurred.
protected  SAPHRActiveSyncAdapter.IDOC_Segment processRecord(com.sap.mw.idoc.IDoc.Segment seg, java.util.Set infotypeFilter)
          Read the IDOC record and convert it to a Map.
 
Methods inherited from class com.sap.mw.idoc.jco.JCoIDoc.Server
dispatchRequest, getFunction, getIDocRepository, setIDocRepository
 
Methods inherited from class com.sap.mw.jco.JCO.Server
abort, beginCall, checkAuthorization, disconnect, endCall, getAttributes, getCallModel, getDsrPassport, getGWHost, getGWServ, getMiddlewareImplementation, getProgID, getPropertyInfo, getRepository, getServerInterface, getState, getThread, getTrace, handleRequest, isAlive, listen, run, setCallModel, setProperty, setRepository, setState, setThread, setTrace, start, stop, suspend
 
Methods inherited from class com.sap.mw.jco.JCO.Connection
checkProperties, clone, finalize, getConnectionHandle, getProperties, getProperty, getThroughput, isValid, setThroughput
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SAPHRActiveSyncAdapter.AdapterIDocServer

public SAPHRActiveSyncAdapter.AdapterIDocServer(java.lang.String gwhost,
                                                java.lang.String gwserv,
                                                java.lang.String progid,
                                                com.sap.mw.jco.IRepository jcoRepository,
                                                com.sap.mw.idoc.IDoc.Repository idocRepository)
Overridden constructor of JCoIDoc.Server. Choose the constructors that one would like to make public.


SAPHRActiveSyncAdapter.AdapterIDocServer

public SAPHRActiveSyncAdapter.AdapterIDocServer(java.util.Properties properties,
                                                com.sap.mw.jco.IRepository jcoRepository,
                                                com.sap.mw.idoc.IDoc.Repository idocRepository)
Overridden constructor of JCoIDoc.Server. Choose the constructors that one would like to make public.

Method Detail

handleRequest

protected void handleRequest(com.sap.mw.jco.JCO.Function function)
Overridden method of JCoIDoc.Server. Function requests that do not contain IDocs will be handled here. These requests will be stored as XML file in the incoming path. No other action will be done. The return values won't be filled and no exception will be thrown to the caller.


handleRequest

protected void handleRequest(com.sap.mw.idoc.IDoc.DocumentList documentList)
Overridden method of JCoIDoc.Server. Function requests that contain IDocs will be handled here. All IDocs will be stored as XML files in the incoming path. Additionally, IDocs that are part of an ORDERS message will be processed specifically. Some relevant information is extracted from these IDocs and will be stored in a text file in the incoming path.


getPath

protected void getPath(com.sap.mw.idoc.IDoc.Segment seg,
                       java.lang.StringBuffer sb)
Recurse up the tree, put the segment names in the string buffer as the recursion unwinds.


processRecord

protected SAPHRActiveSyncAdapter.IDOC_Segment processRecord(com.sap.mw.idoc.IDoc.Segment seg,
                                                            java.util.Set infotypeFilter)
Read the IDOC record and convert it to a Map. Parse the person number, and start and end effective dates.

Parameters:
seg - - the IDoc.segment to process
infotypeFilter - - the infotype filter resource attribute.
Returns:
an IDOC_Segment object (which is a Map) with a Map.Entry for each attribute of the IDoc. At least one entry must contain: PERNO Person number (String) BEGDA Begin effective Date object ENDDA End effective Date object

onCheckTID

protected boolean onCheckTID(java.lang.String tid)
This function will be invoked when a transactional RFC is being called from a SAP R/3 system. The function has to store the TID in permanent storage and return true. The method has to return false if the a transaction with this ID has already been processed. Throw an exception if anything goes wrong. The transaction processing will be aborted thereafter. Derived servers must override this method to actually implement the transaction ID management.

Parameters:
tid - the transaction ID
Returns:
true if the ID is valid and not in use otherwise, false otherwise

onConfirmTID

protected void onConfirmTID(java.lang.String tid)
This function will be called after the local transaction has been completed. All resources assiciated with this TID can be released. Derived servers must override this method to actually implement the transaction ID management.

Parameters:
tid - the transaction ID

onCommit

protected void onCommit(java.lang.String tid)
This function will be called after all RFC functions belonging to a certain transaction have been successfully completed. Derived servers can override this method to locally commit the transaction.

Parameters:
tid - the transaction ID

onRollback

protected void onRollback(java.lang.String tid)
This function will be called if an error in one of the RFC functions belonging to a certain transaction has occurred. Derived servers can override this method to locally rollback the transaction.

Parameters:
tid - the transaction ID