IBM Branch Transformation Toolkit Javadoc

com.ibm.btt.samples.business.sna.lu0.host
Class DummyLu0SnaSession

java.lang.Object
  extended bycom.ibm.btt.samples.business.sna.lu0.host.DummyLu0SnaSession
All Implemented Interfaces:
DummyLu0SnaSessionConstants, java.lang.Runnable

public class DummyLu0SnaSession
extends java.lang.Object
implements DummyLu0SnaSessionConstants, java.lang.Runnable

Dummy Lu0 Sna Session class handles dummy EIS interaction through dummy SNA Lu0 protocol.


Field Summary
protected  java.io.BufferedReader bin
           
 java.lang.String COMPID
           
protected  java.lang.String dataToHost
           
protected  java.lang.String dummyMessage
           
protected  int IDLength
           
protected  java.io.FileReader in
           
protected  boolean isListenThreadAlive
           
protected  java.lang.Thread listenThread
           
protected  int receiveReturnCode
           
protected  boolean synchronousMode
           
protected  java.lang.String transactionFile
           
 
Fields inherited from interface com.ibm.btt.samples.business.sna.lu0.host.DummyLu0SnaSessionConstants
BETWEEN_BRACKETS, BID_RECEIVED, CLOSED, CLOSING, DATA, DATASENT, DEFAULT_CODEPAGE, DEFAULT_CODESET, DISCARDING, ERROR, ESTABLISHING, IN_BRACKETS, LISTEN_THREAD, LU0_WRAPPER_DLL, LUA_ALTERNATE_CODE_NOT_SUPPORT, LUA_API_MODE_CHANGE, LUA_BAD_DATA_PTR, LUA_BAD_SESSION_ID, LUA_BB_NOT_ALLOWED, LUA_BB_REJECT_NO_RTR, LUA_BB_REJECT_RTR, LUA_BID_ALREADY_ENABLED, LUA_BID_VERB_SEG_ERROR, LUA_BIND_FM_PROFILE_ERROR, LUA_BIND_LU_TYPE_ERROR, LUA_BIND_TS_PROFILE_ERROR, LUA_BRACKET, LUA_BRACKET_RACE_ERROR, LUA_BRACKETS_NOT_SUPPORTED, LUA_CANCEL_COMMAND_RECEIVED, LUA_CANCELLED, LUA_CATEGORY_NOT_SUPPORTED, LUA_CD_NOT_ALLOWED, LUA_CD_NOT_SUPPORTED, LUA_CHAINING_ERROR, LUA_CHAINING_NOT_SUPPORTED, LUA_CHASE_RESPONSE_REQUIRED, LUA_CLOSE_PENDING, LUA_COBOL_NOT_SUPPORTED, LUA_COMM_SUBSYSTEM_ABENDED, LUA_COMM_SUBSYSTEM_NOT_LOADED, LUA_COMMAND_COUNT_ERROR, LUA_CRV_ROUTINE_REQUIRED, LUA_CRYPTOGRAPHY_INOPERATIVE, LUA_DATA_LENGTH_ERROR, LUA_DATA_SEG_LENGTH_ERROR, LUA_DATA_TRAFFIC_NOT_RESET, LUA_DATA_TRAFFIC_QUIESCED, LUA_DATA_TRAFFIC_RESET, LUA_DATA_TRUNCATED, LUA_DEFINITE_RSP_NOT_ALLOWED, LUA_DIRECTION, LUA_DUPLICATE_READ_FLOW, LUA_DUPLICATE_RUI_INIT, LUA_DUPLICATE_RUI_REINIT, LUA_DUPLICATE_WRITE_FLOW, LUA_EB_NOT_ALLOWED, LUA_ENCR_DECR_LOAD_ERROR, LUA_ENCR_DECR_PROC_ERROR, LUA_ERP_SYNC_EVENT_ERROR, LUA_EXCEPTION_RSP_NOT_ALLOWED, LUA_EXR_SENSE_INCORRECT, LUA_FM_FUNCTION_NOT_SUPPORTED, LUA_FUNCTION_NOT_SUPPORTED, LUA_HDX_BRACKET_STATE_ERROR, LUA_IMMEDIATE_REQ_MODE_ERROR, LUA_IN_PROGRESS, LUA_INCORRECT_DR1I_DR2I_ERI, LUA_INCORRECT_REQUEST_CODE, LUA_INCORRECT_RU_CATEGORY, LUA_INCORRECT_SEQUENCE_NUMBER, LUA_INCORRECT_SPEC_OF_SDI_RTI, LUA_INCORRECT_USE_OF_EDI, LUA_INCORRECT_USE_OF_FI, LUA_INCORRECT_USE_OF_PDI, LUA_INCORRECT_USE_OF_QRI, LUA_INIT_COMPLETE, LUA_INSUFFICIENT_RESOURCES, LUA_INV_ADPT_NUM, LUA_INV_NAU_ADDR, LUA_INVALID_ADAPTER, LUA_INVALID_FLOW, LUA_INVALID_FORMAT, LUA_INVALID_LUNAME, LUA_INVALID_LUNUMBER, LUA_INVALID_MESSAGE_TYPE, LUA_INVALID_OPEN_DATA, LUA_INVALID_OPEN_INIT_TYPE, LUA_INVALID_OPEN_ROUTINE_TYPE, LUA_INVALID_PARAMETER, LUA_INVALID_PARAMETER_FLAGS, LUA_INVALID_POST_HANDLE, LUA_INVALID_PROCESS, LUA_INVALID_PUNAME, LUA_INVALID_SC_OR_NC_RH, LUA_INVALID_SESSION_PARAMETERS, LUA_INVALID_SESSION_TYPE, LUA_INVALID_SLI_ENCR_OPTION, LUA_INVALID_VERB, LUA_INVALID_VERB_SEGMENT, LUA_LINK_NOT_STARTED, LUA_LINK_NOT_STARTED_RETRY, LUA_LU_COMPONENT_DISCONNECTED, LUA_LU_INOPERATIVE, LUA_MAX_NUMBER_OF_SENDS, LUA_MESSAGE_TYPE_BID, LUA_MESSAGE_TYPE_BIND, LUA_MESSAGE_TYPE_BIS, LUA_MESSAGE_TYPE_CANCEL, LUA_MESSAGE_TYPE_CHASE, LUA_MESSAGE_TYPE_CLEAR, LUA_MESSAGE_TYPE_CRV, LUA_MESSAGE_TYPE_LU_DATA, LUA_MESSAGE_TYPE_LUSTAT_LU, LUA_MESSAGE_TYPE_LUSTAT_SSCP, LUA_MESSAGE_TYPE_PASSTHRU, LUA_MESSAGE_TYPE_QC, LUA_MESSAGE_TYPE_QEC, LUA_MESSAGE_TYPE_RELQ, LUA_MESSAGE_TYPE_RQR, LUA_MESSAGE_TYPE_RSP, LUA_MESSAGE_TYPE_RTR, LUA_MESSAGE_TYPE_SBI, LUA_MESSAGE_TYPE_SDT, LUA_MESSAGE_TYPE_SHUTD, LUA_MESSAGE_TYPE_SIGNAL, LUA_MESSAGE_TYPE_SSCP_DATA, LUA_MESSAGE_TYPE_STSN, LUA_MESSAGE_TYPE_UNBIND, LUA_MODE_INCONSISTENCY, LUA_MULTIPLE_WRITE_FLOWS, LUA_NAU_INOPERATIVE, LUA_NEG_NOTIFY_RSP, LUA_NEG_RSP_FROM_BIND_ROUTINE, LUA_NEG_RSP_FROM_CRV_ROUTINE, LUA_NEG_RSP_FROM_SDT_ROUTINE, LUA_NEG_RSP_FROM_STSN_ROUTINE, LUA_NEGATIVE_RSP, LUA_NEGATIVE_RSP_CHASE, LUA_NEGATIVE_RSP_RSHUTD, LUA_NEGATIVE_RSP_SHUTC, LUA_NEGOTIABLE_BIND_ERROR, LUA_NO_BEGIN_BRACKET, LUA_NO_DATA, LUA_NO_PREVIOUS_BID_ENABLED, LUA_NO_READ_TO_PURGE, LUA_NO_RECEIVE_TO_PURGE, LUA_NO_RESPONSE_NOT_ALLOWED, LUA_NO_RUI_SESSION, LUA_NO_SESSION, LUA_NO_SLI_SESSION, LUA_NON_UNIQ_ID, LUA_NON_UNIQ_NAU_AD, LUA_NOT_ACTIVE, LUA_NOT_READY, LUA_OK, LUA_PACING_NOT_SUPPORTED, LUA_PARAMETER_CHECK, LUA_PROCEDURE_ERROR, LUA_PURGED, LUA_QUEUED_RESPONSE_ERROR, LUA_READY, LUA_REC_CORR_TABLE_FULL, LUA_RECEIVE_ON_FLOW_PENDING, LUA_RECEIVED_UNBIND, LUA_RECEIVED_UNBIND_HOLD, LUA_RECEIVED_UNBIND_NORMAL, LUA_RECEIVER_IN_TRANSMIT_MODE, LUA_REINIT_INVALID, LUA_REQ_RESOURCES_NOT_AVAIL, LUA_REQUEST_NOT_EXECUTABLE, LUA_REQUIRED_FIELD_MISSING, LUA_RESERVED_FIELD_NOT_ZERO, LUA_RESOURCE_NOT_AVAILABLE, LUA_RESPONSE_ALREADY_SENT, LUA_RESPONSE_OUT_OF_ORDER, LUA_RH_DFC, LUA_RH_FMD, LUA_RH_NC, LUA_RH_SC, LUA_RSP_BEFORE_SENDING_REQ, LUA_RSP_CORRELATION_ERROR, LUA_RSP_PROTOCOL_ERROR, LUA_RU_DATA_ERROR, LUA_RU_LENGTH_ERROR, LUA_RUI_LOGIC_ERROR, LUA_RUI_WRITE_FAILURE, LUA_SC_PROTOCOL_VIOLATION, LUA_SEC_RC_OK, LUA_SEND_CORR_TABLE_FULL, LUA_SEND_ON_FLOW_PENDING, LUA_SESSION_ALREADY_OPEN, LUA_SESSION_END_REQUESTED, LUA_SESSION_FAILURE, LUA_SESSION_LIMIT_EXCEEDED, LUA_SESSION_SERVICE_PATH_ERROR, LUA_SLI_BID_PENDING, LUA_SLI_LOGIC_ERROR, LUA_SLI_PURGE_PENDING, LUA_SLU_SESSION_LIMIT_EXCEEDED, LUA_SSCP_LU_SESSION_NOT_ACTIVE, LUA_SSCP_PLU_SESS_NOT_ACTIVE, LUA_SSCP_SLU_SESS_INACT, LUA_STACK_TOO_SMALL, LUA_STATE_CHECK, LUA_STATUS, LUA_STSN_ROUTINE_REQUIRED, LUA_SYNC_EVENT_RESPONSE, LUA_TERMINATED, LUA_UNAUTHORIZED_ACCESS, LUA_UNEXPECTED_DOS_ERROR, LUA_UNEXPECTED_SNA_SEQUENCE, LUA_UNIT_OF_WORK_ABORTED, LUA_UNSUCCESSFUL, LUA_VERB_LENGTH_INVALID, LUA_VERB_RECORD_SPANS_SEGMENTS, MAXRU, MESSAGE, MESSAGE_CANCELLED, NEGATIVE_RESPONSE, NO_RECEIVING, NO_TIMEOUT, OPENED, PENDING_BETWEEN_BRACKETS, PENDING_IN_BRACKETS, PENDING_TERM_R, PENDING_TERM_S, POSITIVE_RESPONSE, RECEIVE, RECEIVERC, RESET, RUI_BID_BEGIN, RUI_BID_END_ERROR, RUI_BID_END_OK, RUI_INIT_BEGIN, RUI_INIT_END_ERROR, RUI_INIT_END_OK, RUI_READ_BEGIN, RUI_READ_END_ERROR, RUI_READ_END_OK, RUI_TERM_BEGIN, RUI_TERM_END_ERROR, RUI_TERM_END_OK, RUI_WRITE_BEGIN, RUI_WRITE_END_ERROR, RUI_WRITE_END_OK, SEND_BET_TR, SEND_IN_TR, SESSION_CLOSED, SESSION_DOWN, SESSION_ESTABLISHED, SESSION_NOT_ESTABLISHED, SOLICITED, TIMEOUT, UNSOLICITED, UNSOLICITED_MESSAGE, UNSOLICITED_MESSAGE_CANCELLED
 
Constructor Summary
DummyLu0SnaSession(DummyLu0SnaSessionConfigurationProperties configurationProperties)
          DummyLu0SnaSession default constructor.
 
Method Summary
 void addLu0SessionEventListener(DummyLu0SessionEventListener listener)
          addLu0SessionEventListener method comment.
 void closeSession()
          Closes the session.
protected  DummyLu0Message createWhatReceived()
          Creates a whatReceived hashTable with its defaults.
 void establishSession()
          Establish a session with the host.
 java.io.BufferedReader getBin()
          Gets the TXIDLength property (boolean) value.
protected  java.lang.String getDummyTransaction()
           
 int getIDLength()
          Gets the TXIDLength property (boolean) value.
 java.util.Vector getMessageFromDummyHost(java.lang.String transactionName)
           
 java.lang.String getReceivingChain()
          Gets the receivingChain property (java.lang.String) value.
 java.lang.String getSessionStatus()
          Gets the communication status value.
 boolean getSynchronousMode()
          Gets the synchronousMode property (boolean) value.
protected  void initializeCounter()
          Sets the EstablishSessionCounter property to its default value.
 void initInstance()
          Initializes the instance.
protected  boolean isNullString(java.lang.String aString)
           
 DummyLu0Message messageReceived()
           
 DummyLu0Message receive(long aTimeout)
          Receive with timeout.
 DummyLu0Message receiveData(long aTimeout)
          Reads the data that has been received, if data not ready waits only for the timeout.
 void removeLu0SessionEventListener()
          removeLu0SessionEventListener method comment.
 void run()
          Implementing the Runnable interface
 void send(java.lang.String aString)
          Sends the message.
 DummyLu0Message sendReceive(java.lang.String aString, long aTimeout)
          Send aString and wait aTimeout to receive the reply.
protected  void setCloseIssued(boolean closeIssued)
          Sets the closeIssued property (boolean) value.
protected  void setDummyTransaction(java.lang.String aString)
           
 void setIDLength()
          This method was created in VisualAge.
 void setIDLength(int anIDLength)
          Sets the IDLength property (int) value.
protected  void setOpenIssued(boolean openIssued)
          Sets the openIssued property (boolean) value.
 void setSessionStatus(java.lang.String sessionStatus)
          Sets the sessionStatus property (java.lang.String) value.
 void setSynchronousMode(boolean aSynchronousMode)
          Sets the synchronousMode property (boolean) value.
protected  void setTermIssued(boolean termIssued)
          Sets the termIssued property (boolean) value.
 void start()
          Method to start listenThread
 void stop()
          Method to stop listenThread
 void terminate()
          Terminates the session.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

transactionFile

protected java.lang.String transactionFile

dataToHost

protected java.lang.String dataToHost

dummyMessage

protected java.lang.String dummyMessage

receiveReturnCode

protected int receiveReturnCode

listenThread

protected java.lang.Thread listenThread

isListenThreadAlive

protected boolean isListenThreadAlive

synchronousMode

protected boolean synchronousMode

IDLength

protected int IDLength

in

protected java.io.FileReader in

bin

protected java.io.BufferedReader bin

COMPID

public java.lang.String COMPID
Constructor Detail

DummyLu0SnaSession

public DummyLu0SnaSession(DummyLu0SnaSessionConfigurationProperties configurationProperties)
DummyLu0SnaSession default constructor.

Method Detail

addLu0SessionEventListener

public void addLu0SessionEventListener(DummyLu0SessionEventListener listener)
addLu0SessionEventListener method comment.


removeLu0SessionEventListener

public void removeLu0SessionEventListener()
removeLu0SessionEventListener method comment.


receiveData

public DummyLu0Message receiveData(long aTimeout)
                            throws DummyLu0Exception

Reads the data that has been received, if data not ready waits only for the timeout.

Parameters:
aTimeout - long
Throws:
DummyLu0Exception

sendReceive

public DummyLu0Message sendReceive(java.lang.String aString,
                                   long aTimeout)
                            throws DummyLu0Exception
Send aString and wait aTimeout to receive the reply.

Parameters:
aString - java.lang.String
aTimeout - long
Throws:
DummyLu0Exception

closeSession

public void closeSession()
                  throws DummyLu0Exception
Closes the session.

Throws:
DummyLu0Exception

setCloseIssued

protected void setCloseIssued(boolean closeIssued)

Sets the closeIssued property (boolean) value.

Parameters:
closeIssued - The new value for the property.

getSessionStatus

public java.lang.String getSessionStatus()

Gets the communication status value. Possible values are:

Returns:
The sessionStatus property value.
See Also:
setSessionStatus(java.lang.String)

getReceivingChain

public java.lang.String getReceivingChain()

Gets the receivingChain property (java.lang.String) value.

receivingChain can have one of the following values:

Returns:
The receivingChain property value.

setSessionStatus

public void setSessionStatus(java.lang.String sessionStatus)

Sets the sessionStatus property (java.lang.String) value.

Parameters:
sessionStatus - The new value for the property.
See Also:
getSessionStatus()

createWhatReceived

protected DummyLu0Message createWhatReceived()

Creates a whatReceived hashTable with its defaults.

Returns:
hashtable whatReceived

establishSession

public void establishSession()
                      throws DummyLu0Exception
Establish a session with the host.

Throws:
DummyLu0Exception

setOpenIssued

protected void setOpenIssued(boolean openIssued)

Sets the openIssued property (boolean) value.

Parameters:
openIssued - The new value for the property.

getBin

public java.io.BufferedReader getBin()
                              throws java.io.FileNotFoundException

Gets the TXIDLength property (boolean) value.

Returns:
The IDLength property.
Throws:
java.io.FileNotFoundException

getDummyTransaction

protected java.lang.String getDummyTransaction()
Returns:
java.lang.String

getIDLength

public int getIDLength()

Gets the TXIDLength property (boolean) value.

Returns:
The IDLength property.

getMessageFromDummyHost

public java.util.Vector getMessageFromDummyHost(java.lang.String transactionName)
                                         throws DummyLu0Exception
Parameters:
transactionName - java.lang.String
Returns:
java.lang.String[]
Throws:
DummyLu0Exception

getSynchronousMode

public boolean getSynchronousMode()

Gets the synchronousMode property (boolean) value. If synchronousMode is true, no event is signaled, neither java events.

Returns:
The confirmMode property value.

initInstance

public void initInstance()
                  throws DummyLu0Exception
Initializes the instance.

Throws:
com.ibm.dse.services.comms.DSELu0InternalErrorException.
com.ibm.dse.services.comms.DSELu0InvalidArgumentException
DummyLu0Exception

initializeCounter

protected void initializeCounter()
Sets the EstablishSessionCounter property to its default value.


isNullString

protected final boolean isNullString(java.lang.String aString)
Parameters:
aString - java.lang.String
Returns:
boolean

messageReceived

public DummyLu0Message messageReceived()
                                throws DummyLu0Exception
Returns:
com.ibm.dse.services.DummyLu0Message
Throws:
com.ibm.dse.services.DSELu0InternalErrorException.
DummyLu0Exception

receive

public DummyLu0Message receive(long aTimeout)
                        throws DummyLu0Exception
Receive with timeout.

Parameters:
aTimeout - long
Returns:
com.ibm.dse.services.comms.DummyLu0Message
Throws:
DummyLu0Exception

run

public void run()

Implementing the Runnable interface

Specified by:
run in interface java.lang.Runnable

send

public void send(java.lang.String aString)
          throws DummyLu0Exception
Sends the message.

Parameters:
aString - java.lang.String
Throws:
com.ibm.dse.services.DSELu0InternalErrorException.
com.ibm.dse.services.DSELu0InvalidRequestException.
DummyLu0Exception

setDummyTransaction

protected void setDummyTransaction(java.lang.String aString)
Parameters:
aString - java.lang.String
Returns:
java.lang.String

setIDLength

public void setIDLength()
This method was created in VisualAge.


setIDLength

public void setIDLength(int anIDLength)

Sets the IDLength property (int) value.

Parameters:
anIDLength - the length to use to retrieve the message from file.

setSynchronousMode

public void setSynchronousMode(boolean aSynchronousMode)

Sets the synchronousMode property (boolean) value.

Parameters:
aSynchronousMode - The new value for the property.
See Also:
getSynchronousMode()

start

public void start()

Method to start listenThread


stop

public void stop()

Method to stop listenThread


terminate

public void terminate()
               throws DummyLu0Exception

Terminates the session. This method should be sent before dereferencing Lu0SnaSession instance. It ends both LU-LU session and the SSCP-LU session, the sessionStatus will be RESET.

Throws:
DummyLu0Exception

setTermIssued

protected void setTermIssued(boolean termIssued)

Sets the termIssued property (boolean) value.

Parameters:
termIssued - The new value for the property.

toString

public java.lang.String toString()
Returns:
com.ibm.dse.base.Vector

IBM Branch Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2005