|
Sun Adapter for SAP BAPI API | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.stc.connector.sapbapiadapter.sapbapi.FileTIDManagerImpl
public class FileTIDManagerImpl
A File-based implementation of a SAP Transactional ID (TID) Manager.
| Nested Class Summary | |
|---|---|
static class |
FileTIDManagerImpl.TestFileTIDmanagerImpl
A standalone tester helper |
| Field Summary | |
|---|---|
protected static char |
COMMITTED
Const COMMITTED, state of the TID |
protected static java.lang.String |
ENCODING
Const ENCODING |
protected static int |
INBOUND_RECORD_SEP_OFFSET
Const INBOUND_RECORD_SEP_OFFSET |
protected static int |
INBOUND_STATE_OFFSET
Const INBOUND_STATE_OFFSET |
protected static int |
INBOUND_TID_RECORD_SIZE
Const INBOUND_TID_RECORD_SIZE |
protected static char |
LF
Line Feed |
static int |
OUTBOUND_EID_OFFSET
Const OUTBOUND_EID_OFFSET |
protected static char |
RESERVED
Const RESERVED, state of the TID |
protected static char |
UNPROCESSED
Const UNPROCESSED, state of the TID |
| Fields inherited from interface com.stc.connector.sapbapiadapter.sapbapi.TIDManager |
|---|
EID_SIZE, TID_SIZE |
| Constructor Summary | |
|---|---|
protected |
FileTIDManagerImpl()
Creates a new FileTIDManagerImpl object for local testing. |
|
FileTIDManagerImpl(Connector connector,
boolean isServer)
Creates a new FileTIDManagerImpl object. |
| Method Summary | |
|---|---|
void |
confirmTID()
Confirms the TID in SAP's database. |
java.lang.String |
createTID(java.lang.String eid)
Creates a TID (using SAP's method) and stores it persistently, marking it as reserved (R). |
static java.io.File |
getFullPath(java.lang.String fname)
Converts a partial (maybe) pathname to a fully qualified abstract File object, normalized relative to e*Gate. |
boolean |
getLockErr()
|
com.stc.connector.management.util.ObjectReference |
getMonitor()
Gets the mbean object for alerts |
protected int |
indexOf(java.lang.StringBuffer sb,
char ch,
int fromIndex)
Returns you an index of the char ch given. |
static void |
main(java.lang.String[] args)
Standalone tester for the FileTIDManagerImpl |
boolean |
onCheckTID(java.lang.String tid)
Checks if the TID has been reserved (R) or committed (C). |
void |
onCommit(java.lang.String tid)
Commits the TID into the persistent database. |
void |
onConfirmTID(java.lang.String tid)
Confirms the TID in the persistent database. |
void |
onRollback(java.lang.String tid)
Rollbacks the TID from the persistent database (marks it as unprocessed, U). |
protected java.lang.StringBuffer |
readOutboundTIDFile(java.io.RandomAccessFile tidRf)
Reads the outbound EID/TID database file. |
protected java.lang.StringBuffer |
readTIDFileFully(java.io.RandomAccessFile raf)
Reads the TID file in a buffer |
void |
setMonitor(com.stc.connector.management.util.ObjectReference mbean)
Sets the mbean object for alerts |
protected void |
writeTIDFileFully(java.io.RandomAccessFile raf,
java.lang.String s)
Writes TID buffer to file |
protected void |
writeTIDFileFully(java.io.RandomAccessFile raf,
java.lang.StringBuffer sb)
Writes TID buffer to file |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final char LF
protected static final char RESERVED
protected static final char COMMITTED
protected static final char UNPROCESSED
protected static final java.lang.String ENCODING
protected static final int INBOUND_STATE_OFFSET
protected static final int INBOUND_RECORD_SEP_OFFSET
protected static final int INBOUND_TID_RECORD_SIZE
public static final int OUTBOUND_EID_OFFSET
| Constructor Detail |
|---|
protected FileTIDManagerImpl()
public FileTIDManagerImpl(Connector connector,
boolean isServer)
connector - Connector object associated with this File TID Manager.isServer - boolean value to indicate client or server mode of operation| Method Detail |
|---|
public boolean getLockErr()
protected java.lang.StringBuffer readTIDFileFully(java.io.RandomAccessFile raf)
throws java.io.IOException
raf - the handle to the TID file
java.io.IOException - IOException
protected void writeTIDFileFully(java.io.RandomAccessFile raf,
java.lang.StringBuffer sb)
throws java.io.IOException
raf - the file handle to write tosb - the TID buffer to be written to file
java.io.IOException - IOException
protected void writeTIDFileFully(java.io.RandomAccessFile raf,
java.lang.String s)
throws java.io.IOException
raf - the file handle to write tos - the TID buffer to be written to file
java.io.IOException - IOExceptionpublic void setMonitor(com.stc.connector.management.util.ObjectReference mbean)
setMonitor in interface TIDManagermbean - The mbean object.public com.stc.connector.management.util.ObjectReference getMonitor()
getMonitor in interface TIDManager
public boolean onCheckTID(java.lang.String tid)
throws com.sap.mw.jco.JCO.Exception
onCheckTID in interface TIDManagertid - The incoming tRFC Transaction ID (TID).
true if TID has not been Reserved (R) nor
committed (C). false otherwise.
com.sap.mw.jco.JCO.Exceptionpublic void onCommit(java.lang.String tid)
onCommit in interface TIDManagertid - The TID to commit.public void onConfirmTID(java.lang.String tid)
onConfirmTID in interface TIDManagertid - The TID to confirm.public void onRollback(java.lang.String tid)
onRollback in interface TIDManagertid - The TID to confirm.
protected java.lang.StringBuffer readOutboundTIDFile(java.io.RandomAccessFile tidRf)
throws java.io.IOException
tidRf - RandomAccessFile pointer to EID/TID database file
java.io.IOException - When IO errors occurpublic java.lang.String createTID(java.lang.String eid)
createTID in interface TIDManagereid - The eid for which a tid will be created.
protected int indexOf(java.lang.StringBuffer sb,
char ch,
int fromIndex)
sb - the buffer of charactersch - the char whose index is to be locatedfromIndex - the fromIndex
public void confirmTID()
confirmTID in interface TIDManagerpublic static java.io.File getFullPath(java.lang.String fname)
File object, normalized relative to e*Gate.
fname - The partial pathname.
public static void main(java.lang.String[] args)
args - command line arguments
|
Sun Adapter for SAP BAPI API | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||