IBM Branch Transformation Toolkit Javadoc

com.ibm.connector2.sna.lu0.host
Class Lu0SnaSession

java.lang.Object
  extended bycom.ibm.connector2.sna.lu0.host.Lu0SnaSession
All Implemented Interfaces:
Lu0SnaSessionConstants, java.lang.Runnable

public class Lu0SnaSession
extends java.lang.Object
implements Lu0SnaSessionConstants, java.lang.Runnable

Lu0 SNA session class handles EIS interaction through SNA Lu0 protocol.


Field Summary
static java.lang.String COMPID
           
(package private)  boolean isEstablishSessionThreadAlive
           
(package private) static java.lang.String RUIBIDBEGIN
           
(package private) static java.lang.String RUIBIDENDER
           
(package private) static java.lang.String RUIBIDENDOK
           
(package private) static java.lang.String RUIINITBEGIN
           
(package private) static java.lang.String RUIINITENDER
           
(package private) static java.lang.String RUIINITENDOK
           
(package private) static java.lang.String RUIREADBEGIN
           
(package private) static java.lang.String RUIREADENDER
           
(package private) static java.lang.String RUIREADENDOK
           
(package private) static java.lang.String RUITERMBEGIN
           
(package private) static java.lang.String RUITERMENDER
           
(package private) static java.lang.String RUITERMENDOK
           
(package private) static java.lang.String RUIWRITEBEGIN
           
(package private) static java.lang.String RUIWRITEENDER
           
(package private) static java.lang.String RUIWRITEENDOK
           
 
Fields inherited from interface com.ibm.connector2.sna.lu0.host.Lu0SnaSessionConstants
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
Lu0SnaSession(Lu0SnaSessionConfigurationProperties configurationProperties)
           
 
Method Summary
 void addLu0SessionEventListener(Lu0SessionEventListener listener)
          addLu0SessionEventListener method comment.
 void closeSession()
          Closes the LU-LU end-to-end session.
 boolean establishSession()
          Establishes the LU-LU session.Lu0SnaSession sends an INITSELF SNA command to initiate session with HostApplication name data , which is specified when the instance is created in the externalizer.
 Lu0Bind getBind()
          Returns a Lu0Bind class that represents SNA BIND command received in the establishment of the current lu-lu session.
 java.lang.String getBracketStatus()
          Gets the bracketStatus property (java.lang.String) value.
 boolean getCloseIssued()
          Gets the closeIssued property (boolean) value.
 Semaphore getDataReadySem()
          Gets the dataReadySem property (com.ibm.connector.lu0.host.Semaphore) value.
 boolean getInUse()
          Gets the in use.
 Lu0Message getLastMessageReceived()
          Gets the lastMessageReceived property (com.ibm.connector.lu0.host.Lu0Message) value.
 Lu0Message getLastRuReceived()
          Gets the lastRuReceived property (com.ibm.connector.lu0.host.Lu0Message) value.
 Lu0Message getLastRuSent()
          Gets the lastRuSent property (com.ibm.connector.lu0.host.Lu0Message) value.
 java.lang.String getLastSense()
          Gets the lastSense property (java.lang.String) value.
 java.lang.String getLevel()
           
 Semaphore getListenThreadSem()
          Gets the listenThreadSem property (com.ibm.connector.lu0.host.Semaphore) value.
 LuaCommon getLuaCommon2()
           
 java.lang.String getReceivingChain()
          Gets the receivingChain property (java.lang.String) value.
 boolean getResponsePendingToReceive()
          Gets the responsePendingToReceive property (boolean) value.
 boolean getResponseRequired()
          Gets the responseRequired property (boolean) value.
 boolean getSendingChain()
          Gets the sendingChain property (boolean) value
 java.lang.String getSeqNumber()
          Gets the seqNumber property (java.lang.String) value
 Semaphore getSessionDownSem()
           
 java.lang.String getSessionId()
          Returns the value of the sessionId attribute.
 java.lang.String getSessionStatus()
          Gets the communication status value.
 boolean getSynchronousMode()
          Gets the synchronousMode property (boolean) value.
 boolean getTermIssued()
          Gets the termIssued property (boolean) value.
protected  void initializeCounter()
          Sets the EstablishSessionCounter property to its default value.
 void initInstance()
          Initiates all handlers that have a default treatment.
 boolean isFree()
          Returns if the session is free
 boolean isOffline()
          Returns if the session is offline
 Lu0Message messageReceived()
          Returns last message received from host if there is one.
 Lu0Message peekMessageReceived()
          Reads the last message received.
 Lu0Message receive(long aTimeout)
          Returns the last message received as a Lu0SnaSession object.If there is no message, waits until the timeout expires.
 Lu0Message receiveData(long aTimeout)
          Reads the data that has been received.
 void removeLu0SessionEventListener()
          removeLu0SessionEventListener method comment.
protected  void resetSession()
           
 void run()
          Implements the runnable interface.
 void send(java.lang.String aString)
          Sends a message unit.
 void sendCancel()
          Sends a SNA Cancel command.
 void sendCommand(java.lang.String aCommand)
          Sends the SNA aCommand, which must be a valid command (Lustat, Signal) in hexadecimal.
 void sendFic(java.lang.String aString)
          Sends a message with the First In Chain (FIC) identifier.
 void sendLic(java.lang.String aString)
          Sends a message with the Last In Chain (LIC) identifier
 void sendMic(java.lang.String aString)
          Sends a message with the Middle In Chain (MIC) identifier
 void sendNegativeResponse(java.lang.String aSense)
          Sends a negative response to the last message received and aSense is expected to be a valid SNA sense code in hexadecimal
 void sendPositiveResponse()
          Sends a positive response to the last message received
 void sendReadyToReceive()
          Sends a SNA RTR command.
 Lu0Message sendReceive(java.lang.String aString, long aTimeout)
          Sends aString (ASCII) to communication services, and waits for aTimeout to receive the data
protected  void setCloseIssued(boolean closeIssued)
          Sets the closeIssued property (boolean) value.
 void setInUse(boolean inUse)
          Sets the in use
protected  void setOpenIssued(boolean openIssued)
          Sets the openIssued property (boolean) value.
protected  void setReceivingChain(java.lang.String receivingChain)
          Sets the receivingChain property (java.lang.String) value.
protected  void setResponsePendingToReceive(boolean responsePendingToReceive)
          Sets the responsePendingToReceive property (boolean) value.
protected  void setResponseRequired(boolean responseRequired)
          Sets the responseRequired property (boolean) value.
 void setSessionId(java.lang.String sessionId)
          Sets the sessionId property (java.lang.String) value.
 void setSessionStatus(java.lang.String sessionStatus)
          Sets the sessionStatus property (java.lang.String) value.
 void setSynchronousMode(boolean synchronousMode)
          Sets the synchronousMode property (boolean) value.
protected  void setTermIssued(boolean termIssued)
          Sets the termIssued property (boolean) value.
 void terminate()
          Terminates the session.
 java.lang.String toString()
          Returns a visual representation of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

COMPID

public static final java.lang.String COMPID
See Also:
Constant Field Values

isEstablishSessionThreadAlive

boolean isEstablishSessionThreadAlive

RUIBIDBEGIN

static final java.lang.String RUIBIDBEGIN
See Also:
Constant Field Values

RUIBIDENDOK

static final java.lang.String RUIBIDENDOK
See Also:
Constant Field Values

RUIBIDENDER

static final java.lang.String RUIBIDENDER
See Also:
Constant Field Values

RUIWRITEBEGIN

static final java.lang.String RUIWRITEBEGIN
See Also:
Constant Field Values

RUIWRITEENDOK

static final java.lang.String RUIWRITEENDOK
See Also:
Constant Field Values

RUIWRITEENDER

static final java.lang.String RUIWRITEENDER
See Also:
Constant Field Values

RUIREADBEGIN

static final java.lang.String RUIREADBEGIN
See Also:
Constant Field Values

RUIREADENDOK

static final java.lang.String RUIREADENDOK
See Also:
Constant Field Values

RUIREADENDER

static final java.lang.String RUIREADENDER
See Also:
Constant Field Values

RUIINITBEGIN

static final java.lang.String RUIINITBEGIN
See Also:
Constant Field Values

RUIINITENDOK

static final java.lang.String RUIINITENDOK
See Also:
Constant Field Values

RUIINITENDER

static final java.lang.String RUIINITENDER
See Also:
Constant Field Values

RUITERMBEGIN

static final java.lang.String RUITERMBEGIN
See Also:
Constant Field Values

RUITERMENDOK

static final java.lang.String RUITERMENDOK
See Also:
Constant Field Values

RUITERMENDER

static final java.lang.String RUITERMENDER
See Also:
Constant Field Values
Constructor Detail

Lu0SnaSession

public Lu0SnaSession(Lu0SnaSessionConfigurationProperties configurationProperties)
Method Detail

addLu0SessionEventListener

public void addLu0SessionEventListener(Lu0SessionEventListener listener)
addLu0SessionEventListener method comment.


removeLu0SessionEventListener

public void removeLu0SessionEventListener()
removeLu0SessionEventListener method comment.


receiveData

public Lu0Message receiveData(long aTimeout)
                       throws Lu0Exception
Reads the data that has been received. If the data is not ready, it waits only for the timeout.

Parameters:
aTimeout - long
Throws:
Lu0Exception

sendReceive

public Lu0Message sendReceive(java.lang.String aString,
                              long aTimeout)
                       throws Lu0Exception
Sends aString (ASCII) to communication services, and waits for aTimeout to receive the data

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

closeSession

public void closeSession()
                  throws Lu0Exception

Closes the LU-LU end-to-end session. The establishSession method is used to establish the session again. Lu0SnaSession send a TERMSELF message to close the session with the host application program. The host answers this call with UNBIND message, at this moment event sessionClosed is signaled.

Throws:
Lu0Exception

establishSession

public boolean establishSession()
                         throws Lu0Exception

Establishes the LU-LU session.Lu0SnaSession sends an INITSELF SNA command to initiate session with HostApplication name data , which is specified when the instance is created in the externalizer. When SDT arrives SessionEstablished event is signaled. If the SSCP sends a NSPE command to the secondary Lu then the event SessionNotEstablished is notified. If aTimeout is reached the event SessionNotEstablished is notified.

Throws:
Lu0Exception

getBind

public Lu0Bind getBind()

Returns a Lu0Bind class that represents SNA BIND command received in the establishment of the current lu-lu session. If there is no session, nil is returned.

Returns:
The bind property value.

getBracketStatus

public java.lang.String getBracketStatus()

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

Returns:
The bracketStatus property value.

getCloseIssued

public boolean getCloseIssued()

Gets the closeIssued property (boolean) value.

Returns:
The closeIssued property value.

getDataReadySem

public Semaphore getDataReadySem()

Gets the dataReadySem property (com.ibm.connector.lu0.host.Semaphore) value.

Returns:
The dataReadySem property value.

getInUse

public boolean getInUse()

Gets the in use.

Returns:
boolean

getLastMessageReceived

public Lu0Message getLastMessageReceived()

Gets the lastMessageReceived property (com.ibm.connector.lu0.host.Lu0Message) value.

Returns:
The lastMessageReceived property value.

getLastRuReceived

public Lu0Message getLastRuReceived()

Gets the lastRuReceived property (com.ibm.connector.lu0.host.Lu0Message) value.

Returns:
The lastRuReceived property value.

getLastRuSent

public Lu0Message getLastRuSent()

Gets the lastRuSent property (com.ibm.connector.lu0.host.Lu0Message) value.

Returns:
The lastRuSent property value.

getLastSense

public java.lang.String getLastSense()

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

Returns:
The lastSense property value.

getLevel

public java.lang.String getLevel()
                          throws Lu0Exception
Returns:
java.lang.String
Throws:
Lu0Exception

getListenThreadSem

public Semaphore getListenThreadSem()

Gets the listenThreadSem property (com.ibm.connector.lu0.host.Semaphore) value.

Returns:
The listenThreadSem property value.

getLuaCommon2

public LuaCommon getLuaCommon2()
Returns:
com.ibm.connector.lu0.host.lua_common

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.

getResponsePendingToReceive

public boolean getResponsePendingToReceive()

Gets the responsePendingToReceive property (boolean) value.

Returns:
The responsePendingToReceive property value.

getResponseRequired

public boolean getResponseRequired()

Gets the responseRequired property (boolean) value.

Returns:
The responseRequired property value.

getSendingChain

public boolean getSendingChain()

Gets the sendingChain property (boolean) value

Returns:
The sendingChain property value.

getSeqNumber

public java.lang.String getSeqNumber()

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

Returns:
The seqNumber property value.

getSessionId

public java.lang.String getSessionId()

Returns the value of the sessionId attribute. When loading the Lu0SnaSession instance, a call to Communication Server is made to establish SSCP_LU session. If this call is made correctly, a Session Id identifies the new session.

Returns:
The sessionId property value.
See Also:
setSessionId(java.lang.String)

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)

getSynchronousMode

public boolean getSynchronousMode()
Gets the synchronousMode property (boolean) value.

Returns:
The synchronousMode property value.
See Also:
setSynchronousMode(boolean)

getTermIssued

public boolean getTermIssued()

Gets the termIssued property (boolean) value.

Returns:
The termIssued property value.

initializeCounter

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


initInstance

public void initInstance()
                  throws Lu0Exception
Initiates all handlers that have a default treatment. It also does an Init to the Communication Server and creates the listenThread.

Throws:
com.ibm.connector.lu0.host.Lu0InternalErrorException
com.ibm.connector.lu0.host.Lu0InvalidArgumentException
Lu0Exception

isFree

public boolean isFree()

Returns if the session is free

Returns:
boolean

isOffline

public boolean isOffline()

Returns if the session is offline

Returns:
boolean

messageReceived

public Lu0Message messageReceived()
                           throws Lu0Exception
Returns last message received from host if there is one. Fails if: after receiving an RU of a multiRu chain (chaining = false), the host has cancelled the complete chain. After receiving a message, listenThread is signaled. There is not data ready until next message is received from host."

Returns:
Lu0Message
Throws:
Lu0Exception

peekMessageReceived

public Lu0Message peekMessageReceived()
                               throws Lu0Exception

Reads the last message received. The message is not removed from the messages queue.

Return a Lu0Message if there is a message ready, null if there is no message ready.

Fails if, after receiving an RU of a multiRu chain (chaining = false), the host has cancelled the complete chain. After receiving a message, listenThread is NOT signaled.

This method should be received using the messageReceived method, otherwise no more data is received from the host.

Throws:
Lu0Exception

receive

public Lu0Message receive(long aTimeout)
                   throws Lu0Exception

Returns the last message received as a Lu0SnaSession object.If there is no message, waits until the timeout expires. In this case, an exception is raised.

Parameters:
aTimeout - int
Returns:
com.ibm.connector.lu0.host.Lu0Message
Throws:
Lu0Exception

resetSession

protected void resetSession()

run

public void run()

Implements the runnable interface.

Specified by:
run in interface java.lang.Runnable

send

public void send(java.lang.String aString)
          throws Lu0Exception

Sends a message unit. If the length of the message is longer than the inbound RU size, it is broken into smaller RUs. This is transparent to the application which only sees the message as Only In Chain (OIC).

Parameters:
aString - java.lang.String

aString is the formatted data that will be sent to host. This ASCII string will be converted to EBCDIC. If aString length is longer than the maximum inbound RU size, it has to be segmented into smaller RUs.

Fails if:

  1. - Client manages responses and there is one pending response.
  2. - A chain is being sent and FIC is sent and not LIC.
  3. - Session status not correct.
Throws:
Lu0Exception

sendCancel

public void sendCancel()
                throws Lu0Exception

Sends a SNA Cancel command.

Throws:
Lu0Exception

sendCommand

public void sendCommand(java.lang.String aCommand)
                 throws Lu0Exception

Sends the SNA aCommand, which must be a valid command (Lustat, Signal) in hexadecimal.

Parameters:
aCommand - java.lang.String
Throws:
Lu0Exception

sendFic

public void sendFic(java.lang.String aString)
             throws Lu0Exception

Sends a message with the First In Chain (FIC) identifier.

aString is the formatted data that will be sent to the host. This data is sent as First In Chain.

aString length must be smaller than the MAXIMUM inbound RU size.

Fails if:

  1. - The client manages responses and there is one response pending
  2. - A chain is being sent to the host (FIC has already been sent)
  3. - The sessionStatus is not SESSION_SEND_BET_TR or SESSION_SEND_IN_TR
  4. - The Communication Server returns an error

Parameters:
aString - java.lang.String
Throws:
Lu0Exception

sendLic

public void sendLic(java.lang.String aString)
             throws Lu0Exception

Sends a message with the Last In Chain (LIC) identifier

Parameters:
aString - java.lang.String
Throws:
Lu0Exception

sendMic

public void sendMic(java.lang.String aString)
             throws Lu0Exception

Sends a message with the Middle In Chain (MIC) identifier

Parameters:
aString - java.lang.String
Throws:
Lu0Exception

sendNegativeResponse

public void sendNegativeResponse(java.lang.String aSense)
                          throws Lu0Exception

Sends a negative response to the last message received and aSense is expected to be a valid SNA sense code in hexadecimal

Parameters:
aSense - java.lang.String
Throws:
Lu0Exception

sendPositiveResponse

public void sendPositiveResponse()
                          throws Lu0Exception

Sends a positive response to the last message received

Throws:
Lu0Exception

sendReadyToReceive

public void sendReadyToReceive()
                        throws Lu0Exception

Sends a SNA RTR command. It is sent when the BID is managed by the application and it is ready to receive an unsolicited message previously denied.

Throws:
Lu0Exception

setCloseIssued

protected void setCloseIssued(boolean closeIssued)

Sets the closeIssued property (boolean) value.

Parameters:
closeIssued - The new value for the property.
See Also:
getCloseIssued()

setInUse

public void setInUse(boolean inUse)

Sets the in use

Parameters:
inUse - boolean

setOpenIssued

protected void setOpenIssued(boolean openIssued)

Sets the openIssued property (boolean) value.

Parameters:
openIssued - The new value for the property.

setReceivingChain

protected void setReceivingChain(java.lang.String receivingChain)

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

Parameters:
receivingChain - The new value for the property.
See Also:
getReceivingChain()

setResponsePendingToReceive

protected void setResponsePendingToReceive(boolean responsePendingToReceive)

Sets the responsePendingToReceive property (boolean) value.

Parameters:
responsePendingToReceive - The new value for the property.
See Also:
getResponsePendingToReceive()

setResponseRequired

protected void setResponseRequired(boolean responseRequired)

Sets the responseRequired property (boolean) value.

Parameters:
responseRequired - The new value for the property.
See Also:
getResponseRequired()

setSessionId

public void setSessionId(java.lang.String sessionId)

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

Parameters:
sessionId - The new value for the property.
See Also:
getSessionId()

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()

setSynchronousMode

public void setSynchronousMode(boolean synchronousMode)
Sets the synchronousMode property (boolean) value.

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

setTermIssued

protected void setTermIssued(boolean termIssued)

Sets the termIssued property (boolean) value.

Parameters:
termIssued - The new value for the property.
See Also:
getTermIssued()

terminate

public void terminate()
               throws Lu0Exception

Terminates the session. This method should be sent before de-referencing an Lu0SnaSession instance. It ends both the LU-LU session and the SSCP-LU session. The sessionStatus will be RESET.

Throws:
Lu0Exception

toString

public java.lang.String toString()
Returns a visual representation of this object.

Returns:
java.lang.String - The object visual representation.

getSessionDownSem

public Semaphore getSessionDownSem()

IBM Branch Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2005