com.ibm.dse.services.comms
Class Lu0SnaSession

java.lang.Object
  |
  +--com.ibm.dse.base.DSENotifier
        |
        +--com.ibm.dse.base.Service
              |
              +--com.ibm.dse.services.comms.Lu0SnaSession

public class Lu0SnaSession
extends Service
implements Lu0SnaSessionService, java.lang.Runnable, Handler

Lu0 SNA session service.

See Also:
Serialized Form

Field Summary
protected  BIDReceivedListener aBIDReceivedListener
           
protected  MessageCancelledListener aMessageCancelledListener
           
protected  MessageListener aMessageListener
           
protected  NegativeResponseListener aNegativeResponseListener
           
protected  PositiveResponseListener aPositiveResponseListener
           
protected  SessionClosedListener aSessionClosedListener
           
protected  SessionDownListener aSessionDownListener
           
protected  SessionEstablishedListener aSessionEstablishedListener
           
protected  SessionNotEstablishedListener aSessionNotEstablishedListener
           
protected  UnsolicitedMessageCancelledListener aUnsolicitedMessageCancelledListener
           
protected  UnsolicitedMessageListener aUnsolicitedMessageListener
           
static java.lang.String COMPID
           
 Semaphore establishSem
           
protected  java.beans.PropertyChangeSupport propertyChange
           
 Semaphore sessionDownSem
           
 
Fields inherited from class com.ibm.dse.base.Service
externalizer
 
Fields inherited from class com.ibm.dse.base.DSENotifier
handlersList, name
 
Fields inherited from interface com.ibm.dse.services.comms.Lu0SnaSessionService
BETWEEN_BRACKETS, BID_RECEIVED, CLOSING, DEFAULT_CODESET, DISCARDING, 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, PENDING_BETWEEN_BRACKETS, PENDING_IN_BRACKETS, PENDING_TERM_R, PENDING_TERM_S, POSITIVE_RESPONSE, RECEIVE, RESET, SEND_BET_TR, SEND_IN_TR, SESSION_CLOSED, SESSION_DOWN, SESSION_ESTABLISHED, SESSION_NOT_ESTABLISHED, SOLICITED, UNSOLICITED, UNSOLICITED_MESSAGE, UNSOLICITED_MESSAGE_CANCELLED
 
Fields inherited from interface com.ibm.dse.services.comms.CommonCommunicationsService
CLOSED, DATA, DATASENT, ERROR, OPENED, RECEIVERC, TIMEOUT
 
Constructor Summary
Lu0SnaSession()
          This constructor creates a Lu0SnaSession object.
Lu0SnaSession(java.lang.String aString)
          This constructor creates a Lu0SnaSession object with name aString .
 
Method Summary
 void addBIDReceivedListener(BIDReceivedListener newListener)
          Generated to support the BIDReceived event.
 void addMessageCancelledListener(MessageCancelledListener newListener)
          Generated to support the .MessageCancelled event.
 void addMessageListener(MessageListener newListener)
          Generated to support the Message event.
 void addNegativeResponseListener(NegativeResponseListener newListener)
          Generated to support the NegativeResponse event.
 void addPositiveResponseListener(PositiveResponseListener newListener)
          Generated to support the PositiveResponse event.
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Generated to support the propertyChange field.
 void addSessionClosedListener(SessionClosedListener newListener)
          Generated to support the SessionClosed event.
 void addSessionDownListener(SessionDownListener newListener)
          Generated to support the SessionDown event.
 void addSessionEstablishedListener(SessionEstablishedListener newListener)
          Generated to support the SessionEstablished event.
 void addSessionNotEstablishedListener(SessionNotEstablishedListener newListener)
          Generated to support the SessionNotEstablished event.
 void addUnsolicitedMessageCancelledListener(UnsolicitedMessageCancelledListener newListener)
          Generated to support the UnsolicitedMessageCancelled event.
 void addUnsolicitedMessageListener(UnsolicitedMessageListener newListener)
          Generated to support the UnsolicitedMessage event.
 void ccClose()
          Closes the communications channel.
 void ccOpen()
          Opens the communications channel.
 CCMessage ccReceiveData(long aTimeout)
          Reads the data that has been received.
 void ccSendData(java.lang.String aString)
          Sends aData thought the communications channel.
 CCMessage ccSendReceive(java.lang.String aString, long aTimeout)
          Sends aString to communcication services, and waits for aTimeout to receive the data
 void closeSession()
          Closes the LU-LU end-to-end session.
 Handler dispatchEvent(DSEEventObject anEvent)
          Handles session events.
 void establishSession()
          Establishes the LU-LU session.
 void establishSession(int aTimeout)
          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.
protected  void fireBIDReceived(BIDReceivedEvent event)
          Supports listener events.
 void fireMessage(MessageEvent event)
          Supports listener events.
protected  void fireMessageCancelled(MessageCancelledEvent event)
          Supports listener events.
protected  void fireNegativeResponse(NegativeResponseEvent event)
          Supports listener events.
protected  void firePositiveResponse(PositiveResponseEvent event)
          Supports listener events.
 void firePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
          Generated to support the propertyChange field.
protected  void fireSessionClosed(SessionClosedEvent event)
          Supports listener events.
protected  void fireSessionDown(SessionDownEvent event)
          Supports listener events.
protected  void fireSessionEstablished(SessionEstablishedEvent event)
          Supports listener events.
protected  void fireSessionNotEstablished(SessionNotEstablishedEvent event)
          Supports listener events.
protected  void fireUnsolicitedMessage(UnsolicitedMessageEvent event)
          Supports listener events.
protected  void fireUnsolicitedMessageCancelled(UnsolicitedMessageCancelledEvent event)
          Supports listener events.
 boolean getAutomaticSessionEstablishment()
          Gets the automaticSessionEstablishment property (java.lang.Boolean) value.
 boolean getBIDManaged()
          Gets the BIDManaged property (boolean) value.
 Lu0Bind getBind()
          Returns a Lu0Bind class that represents SNA BIND command received in the establishment of the current lu-lu session.
 java.lang.String getCcClosedEventName()
          Returns the name of the closed event.
 java.lang.String getCcDataReceivedEventName()
          Returns the name of the errorReceived event.
 java.lang.String getCcErrorReceivedEventName()
          Returns the name of the errorReceived event.
 java.lang.String getCcOpenedEventName()
          Returns the name of the opened event.
 boolean getChaining()
          Returns the value of the chaining protocol.
 boolean getCloseIssued()
          Gets the closeIssued property (boolean) value.
 boolean getCompression()
          Gets the compression property (boolean) value.
 Semaphore getDataReadySem()
          Gets the dataReadySem property (com.ibm.dse.base.Semaphore) value.
 java.lang.String getDefaultCodeSet()
          Gets the defaultCodeSet property (java.lang.String) value.
 boolean getDefiniteResponseSolicited()
          Returns the value of the definite response protocol.
 boolean getEndBracketSent()
          Returns the value of the end bracket protocol.
 int getEstablishSessionRetries()
          Gets the establishSessionRetries property (int) value.
 int getEstablishTimeout()
          Gets the establishTimeout property (int) value.
 boolean getFmhHeaderSent()
          Returns the value of the FMH sent protocol.
 boolean getFmhIncluded()
          Returns the value of the FMH received protocol.
 java.lang.String getHostApplicationName()
          Returns the host application name to which the session is going to be established.
 boolean getInUse()
          Gets the in use.
 Lu0Message getLastMessageReceived()
          Gets the lastMessageReceived property (com.ibm.dse.services.Lu0Message) value.
 Lu0Message getLastRuReceived()
          Gets the lastRuReceived property (com.ibm.dse.services.Lu0Message) value.
 Lu0Message getLastRuSent()
          Gets the lastRuSent property (com.ibm.dse.services.Lu0Message) value.
 java.lang.String getLastSense()
          Gets the lastSense property (java.lang.String) value.
static java.lang.String getLevel()
           
 Semaphore getListenThreadSem()
          Gets the listenThreadSem property (com.ibm.dse.base.Semaphore) value.
 java.lang.String getLuName()
          Gets the luName property (java.lang.String) value.
 boolean getManageResponses()
          Returns the value of the response protocol.
 boolean getMessageToLu()
          Returns the value message received.
protected  java.beans.PropertyChangeSupport getPropertyChange()
          Accessor for the propertyChange field.
 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.
 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.
 int getTimeBetweenRetries()
          Gets the timeBetweenRetries property (int) value.
 void handleEvent(java.lang.String anEventName, java.lang.String aNotifierName, Context aContext)
          Handles events.
 void handleEvent(java.lang.String anEventName, java.lang.String aNotifierName, Context aContext, java.lang.String aTID)
          Handles events.
protected  void initializeCounter()
          Sets the EstablishSessionCounter property to its default value.
 java.lang.Object initializeFrom(Tag aTag)
          Initializes the Service reading its attributes values from aTag.
 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 the last message received from host if there is one.
 Lu0Message messageReceived(Context aContext, FormatElement aFormat)
          Returns the last message received from host if there is one.
 Lu0Message messageReceived(Context aContext, java.lang.String aFormatName)
          Returns the 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 receive(long aTimeout, Context aContext, FormatElement aFormat)
          Returns the last message received as a Lu0SnaSession object.If there is no message, waits until the timeout expires.
 Lu0Message receive(long aTimeout, Context aContext, java.lang.String aFormatName)
          Returns the last message received as a Lu0SnaSession object.If there is no message, waits until the timeout expires.
 void removeBIDReceivedListener(BIDReceivedListener newListener)
          Generated to support the BIDReceived event.
 void removeMessageCancelledListener(MessageCancelledListener newListener)
          Generated to support the MessageCancelled event.
 void removeMessageListener(MessageListener newListener)
          Generated to support the Message event.
 void removeNegativeResponseListener(NegativeResponseListener newListener)
          Generated to support the NegativeResponse event.
 void removePositiveResponseListener(PositiveResponseListener newListener)
          Generated to support the PositiveResponse event.
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          Generated to support the propertyChange field.
 void removeSessionClosedListener(SessionClosedListener newListener)
          Generated to support the SessionClosed event.
 void removeSessionDownListener(SessionDownListener newListener)
          Generated to support the SessionDown event.
 void removeSessionEstablishedListener(SessionEstablishedListener newListener)
          Generated to support the SessionEstablished event.
 void removeSessionNotEstablishedListener(SessionNotEstablishedListener newListener)
          Generated to support the SessionNotEstablished event.
 void removeUnsolicitedMessageCancelledListener(UnsolicitedMessageCancelledListener newListener)
          Generated to support the UnsolicitedMessageCancelled event.
 void removeUnsolicitedMessageListener(UnsolicitedMessageListener newListener)
          Generated to support the UnsolicitedMessage event.
protected  void resetSession()
           
 void run()
          Implements the runnable interface.
 void send(Context aContext, FormatElement aFormat)
           Formats and sends the context (aContext) for aFormat.
 void send(Context aContext, java.lang.String aFormatName)
           Formats and sends the context (aContext) for aFormatName.
 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(Context aContext, FormatElement aFormat)
          Sends a message with the First In Chain (FIC) identifier.
 void sendFic(Context aContext, java.lang.String aFormatName)
          Sends a message with the First In Chain (FIC) identifier.
 void sendFic(java.lang.String aString)
          Sends a message with the First In Chain (FIC) identifier.
 void sendLic(Context aContext, FormatElement aFormat)
          Sends a message with the Last In Chain (LIC) identifier.
 void sendLic(Context aContext, java.lang.String aFormatName)
          Sends a message with the Last In Chain (LIC) identifier.
 void sendLic(java.lang.String aString)
          Sends a message with the Last In Chain (LIC) identifier.
 void sendMic(Context aContext, FormatElement aFormat)
          Sends a message with the Middle In Chain (MIC) identifier.
 void sendMic(Context aContext, java.lang.String aFormatName)
          Sends a message with the Middle In Chain (MIC) 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.
 void sendPositiveResponse()
          Sends a positive response to the last message received.
 void sendReadyToReceive()
          Sends a SNA RTR command.
 void setAutomaticSessionEstablishment(boolean automaticSessionEstablishment)
          Sets the automaticSessionEstablishment property (boolean) value.
 void setBIDManaged(boolean BIDManaged)
          Sets the BIDManaged property (boolean) value.
 void setChaining(boolean chaining)
          Sets the chaining protocol.
protected  void setCloseIssued(boolean closeIssued)
          Sets the closeIssued property (boolean) value.
 void setCompression(boolean compression)
          Sets the compression property (boolean) value.
 void setDefaultCodeSet(java.lang.String defaultCodeSet)
          Sets the defaultCodeSet property (java.lang.String) value.
 void setDefiniteResponseSolicited(boolean definiteResponseSolicited)
          Sets the definite response protocol to: true:messages include the definite response identifier when possible false:messages do not include the definite response identifier(the default)
 void setEndBracketSent(boolean endBracketSent)
          Sets the end bracket protocol to : true:messages include the end bracket indicator or false:messages do not include the end bracket indicator (the default)
 void setEstablishSessionRetries(int establishSessionRetries)
          Sets the establishSessionRetries property (int) value.
 void setEstablishTimeout(int aEstablishTimeout)
          Sets the timeBetweenRetries property (int) value.
 void setFmhHeaderSent(boolean fmhHeaderSent)
          Sets the FMH sent protocol to : true:sent messages include the FM header or false:sent messages do not include the FM header(the default)
 void setFmhIncluded(boolean fmhIncluded)
          Sets the FMH received protocol to : true:received messages include the FM header or false:received messages do not include the FM header(the default)
 void setHostApplicationName(java.lang.String hostApplicationName)
          Sets the host application name.
 void setInUse(boolean anuse)
          Sets the in use.
 void setLuName(java.lang.String luName)
          Sets the luName property (java.lang.String) value.
 void setManageResponses(boolean manageResponses)
          Sets the response protocol to : true:the application is responsible for sending a response to each chained message received; Positive responses (using sendPositiveResponse) has to be sent after a complete chain has been received.
 void setMessageToLu(boolean messageToLu)
          Sets the type of the host partner session to: true:the destination is the remote Lu(the default) or false:the destination is the SSCP
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.
protected  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 setTimeBetweenRetries(int timeBetweenRetries)
          Sets the timeBetweenRetries property (int) value.
 void stopHandlingEvent(java.lang.String anEventName, java.lang.String aNotifierName, Context aContext)
          Stops event handling.
 void stopHandlingEvent(java.lang.String anEventName, java.lang.String aNotifierName, Context aContext, java.lang.String aTID)
          Stops event handling.
 void terminate()
          Terminates the session.
 java.lang.String toString()
          Returns a visual representation of this object.
 
Methods inherited from class com.ibm.dse.base.Service
externalizer, getExternalizer, getTagName, readExternal, readExternal, readObject, removeExternal, setExternalizer, toStrings, toTags, writeExternal, writeExternal
 
Methods inherited from class com.ibm.dse.base.DSENotifier
addHandler, getHandlersList, getName, removeHandler, setName, signalEvent, signalEvent, signalEvent
 
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

establishSem

public Semaphore establishSem

sessionDownSem

public Semaphore sessionDownSem

propertyChange

protected transient java.beans.PropertyChangeSupport propertyChange

aSessionNotEstablishedListener

protected transient SessionNotEstablishedListener aSessionNotEstablishedListener

aSessionEstablishedListener

protected transient SessionEstablishedListener aSessionEstablishedListener

aMessageListener

protected transient MessageListener aMessageListener

aMessageCancelledListener

protected transient MessageCancelledListener aMessageCancelledListener

aNegativeResponseListener

protected transient NegativeResponseListener aNegativeResponseListener

aSessionDownListener

protected transient SessionDownListener aSessionDownListener

aSessionClosedListener

protected transient SessionClosedListener aSessionClosedListener

aPositiveResponseListener

protected transient PositiveResponseListener aPositiveResponseListener

aBIDReceivedListener

protected transient BIDReceivedListener aBIDReceivedListener

aUnsolicitedMessageListener

protected transient UnsolicitedMessageListener aUnsolicitedMessageListener

aUnsolicitedMessageCancelledListener

protected transient UnsolicitedMessageCancelledListener aUnsolicitedMessageCancelledListener
Constructor Detail

Lu0SnaSession

public Lu0SnaSession()
This constructor creates a Lu0SnaSession object.

Lu0SnaSession

public Lu0SnaSession(java.lang.String aString)
              throws java.io.IOException
This constructor creates a Lu0SnaSession object with name aString .
Parameters:
aString - java.lang.String
Method Detail

addBIDReceivedListener

public void addBIDReceivedListener(BIDReceivedListener newListener)
Generated to support the BIDReceived event.
Specified by:
addBIDReceivedListener in interface Lu0SnaSessionService
Parameters:
newListener - com.ibm.dse.services.comms.BIDReceivedListener

addMessageCancelledListener

public void addMessageCancelledListener(MessageCancelledListener newListener)
Generated to support the .MessageCancelled event.
Specified by:
addMessageCancelledListener in interface Lu0SnaSessionService
Parameters:
newListener - com.ibm.dse.services.comms.MessageCancelledListener

addMessageListener

public void addMessageListener(MessageListener newListener)
Generated to support the Message event.
Specified by:
addMessageListener in interface Lu0SnaSessionService
Parameters:
newListener - com.ibm.dse.services.comms.MessageListener

addNegativeResponseListener

public void addNegativeResponseListener(NegativeResponseListener newListener)
Generated to support the NegativeResponse event.
Specified by:
addNegativeResponseListener in interface Lu0SnaSessionService
Parameters:
newListener - com.ibm.dse.services.comms.NegativeResponseListener

addPositiveResponseListener

public void addPositiveResponseListener(PositiveResponseListener newListener)
Generated to support the PositiveResponse event.
Specified by:
addPositiveResponseListener in interface Lu0SnaSessionService
Parameters:
newListener - com.ibm.dse.services.comms.PositiveResponseListener

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Generated to support the propertyChange field.

addSessionClosedListener

public void addSessionClosedListener(SessionClosedListener newListener)
Generated to support the SessionClosed event.
Specified by:
addSessionClosedListener in interface Lu0SnaSessionService
Parameters:
newListener - com.ibm.dse.services.comms.SessionClosedListener

addSessionDownListener

public void addSessionDownListener(SessionDownListener newListener)
Generated to support the SessionDown event.
Specified by:
addSessionDownListener in interface Lu0SnaSessionService
Parameters:
newListener - com.ibm.dse.services.comms.SessionDownListener

addSessionEstablishedListener

public void addSessionEstablishedListener(SessionEstablishedListener newListener)
Generated to support the SessionEstablished event.
Specified by:
addSessionEstablishedListener in interface Lu0SnaSessionService
Parameters:
newListener - com.ibm.dse.services.comms.SessionEstablishedListener

addSessionNotEstablishedListener

public void addSessionNotEstablishedListener(SessionNotEstablishedListener newListener)
Generated to support the SessionNotEstablished event.
Specified by:
addSessionNotEstablishedListener in interface Lu0SnaSessionService
Parameters:
newListener - com.ibm.dse.services.comms.SessionNotEstablishedListener

addUnsolicitedMessageCancelledListener

public void addUnsolicitedMessageCancelledListener(UnsolicitedMessageCancelledListener newListener)
Generated to support the UnsolicitedMessageCancelled event.
Specified by:
addUnsolicitedMessageCancelledListener in interface Lu0SnaSessionService
Parameters:
newListener - com.ibm.dse.services.comms.UnsolicitedMessageCancelledListener

addUnsolicitedMessageListener

public void addUnsolicitedMessageListener(UnsolicitedMessageListener newListener)
Generated to support the UnsolicitedMessage event.
Specified by:
addUnsolicitedMessageListener in interface Lu0SnaSessionService
Parameters:
newListener - com.ibm.dse.services.comms.UnsolicitedMessageListener

ccClose

public void ccClose()
             throws DSECCException
Closes the communications channel. It returns control immediately. When the communications channel is correctly started, the event ChanelClosed is signaled.
Parameters:
aString - java.lang.String

ccOpen

public void ccOpen()
            throws DSECCException
Opens the communications channel. It returns control immediately. When the communications channel is correctly started, the event ChanelOpened is signaled.

ccReceiveData

public CCMessage ccReceiveData(long aTimeout)
                        throws DSECCException
Reads the data that has been received. If the data is not ready, it waits only for the timeout.
Parameters:
aTimeout - long

ccSendData

public void ccSendData(java.lang.String aString)
                throws DSECCException
Sends aData thought the communications channel. It returns control inmediately. When a response is received, two events might be signaled: DataReceived event (in case of data received) or ErrorReceived (in case of error).
Parameters:
aString - java.lang.String

ccSendReceive

public CCMessage ccSendReceive(java.lang.String aString,
                               long aTimeout)
                        throws DSECCException
Sends aString to communcication services, and waits for aTimeout to receive the data
Parameters:
aString - java.lang.String
aTimeout - long

closeSession

public void closeSession()
                  throws DSELu0InternalErrorException

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.

Specified by:
closeSession in interface Lu0SnaSessionService

dispatchEvent

public Handler dispatchEvent(DSEEventObject anEvent)
Handles session events.
Specified by:
dispatchEvent in interface Handler
Parameters:
event - com.ibm.dse.base.DSEEventObject
Returns:
com.ibm.dse.base.Handler

establishSession

public void establishSession()
                      throws DSELu0InternalErrorException

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.

Specified by:
establishSession in interface Lu0SnaSessionService

establishSession

public void establishSession(int aTimeout)
                      throws DSELu0InternalErrorException

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.


fireBIDReceived

protected void fireBIDReceived(BIDReceivedEvent event)

Supports listener events.

Parameters:
event - com.ibm.dse.services.comms.BIDReceivedEvent

fireMessage

public void fireMessage(MessageEvent event)

Supports listener events.

Parameters:
event - com.ibm.dse.services.comms.MessageEvent

fireMessageCancelled

protected void fireMessageCancelled(MessageCancelledEvent event)

Supports listener events.

Parameters:
event - com.ibm.dse.services.comms.MessageCancelledEvent

fireNegativeResponse

protected void fireNegativeResponse(NegativeResponseEvent event)

Supports listener events.

Parameters:
event - com.ibm.dse.services.comms.NegativeResponseEvent

firePositiveResponse

protected void firePositiveResponse(PositiveResponseEvent event)

Supports listener events.

Parameters:
event - com.ibm.dse.services.comms.PositiveResponseEvent

firePropertyChange

public void firePropertyChange(java.lang.String propertyName,
                               java.lang.Object oldValue,
                               java.lang.Object newValue)
Generated to support the propertyChange field.

fireSessionClosed

protected void fireSessionClosed(SessionClosedEvent event)

Supports listener events.

Parameters:
event - com.ibm.dse.services.comms.SessionClosedEvent

fireSessionDown

protected void fireSessionDown(SessionDownEvent event)

Supports listener events.

Parameters:
event - com.ibm.dse.services.comms.SessionDownEvent

fireSessionEstablished

protected void fireSessionEstablished(SessionEstablishedEvent event)

Supports listener events.

Parameters:
event - com.ibm.dse.services.comms.SessionEstablishedEvent

fireSessionNotEstablished

protected void fireSessionNotEstablished(SessionNotEstablishedEvent event)

Supports listener events.

Parameters:
event - com.ibm.dse.services.comms.SessionNotEstablishedEvent

fireUnsolicitedMessage

protected void fireUnsolicitedMessage(UnsolicitedMessageEvent event)

Supports listener events.

Parameters:
event - com.ibm.dse.services.comms.UnsolicitedMessageEvent

fireUnsolicitedMessageCancelled

protected void fireUnsolicitedMessageCancelled(UnsolicitedMessageCancelledEvent event)

Supports listener events.

Parameters:
event - com.ibm.dse.services.comms.UnsolicitedMessageCancelledEvent

getAutomaticSessionEstablishment

public boolean getAutomaticSessionEstablishment()

Gets the automaticSessionEstablishment property (java.lang.Boolean) value.

Specified by:
getAutomaticSessionEstablishment in interface Lu0SnaSessionService
Returns:
The automaticSessionEstablishment property value.
See Also:
setAutomaticSessionEstablishment(boolean)

getBIDManaged

public boolean getBIDManaged()

Gets the BIDManaged property (boolean) value.

Specified by:
getBIDManaged in interface Lu0SnaSessionService
Returns:
The BIDManaged property value.
See Also:
setBIDManaged(boolean)

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.
See Also:
#setBind

getCcClosedEventName

public java.lang.String getCcClosedEventName()
Returns the name of the closed event.

getCcDataReceivedEventName

public java.lang.String getCcDataReceivedEventName()
Returns the name of the errorReceived event.

getCcErrorReceivedEventName

public java.lang.String getCcErrorReceivedEventName()
Returns the name of the errorReceived event.

getCcOpenedEventName

public java.lang.String getCcOpenedEventName()
Returns the name of the opened event.

getChaining

public boolean getChaining()

Returns the value of the chaining protocol. If chaining is true, the messages received are complete chains. If chaining is false, the messages are received as they are sent by the host (FIC,MIC,LIC or OIC). The default value is false.

Specified by:
getChaining in interface Lu0SnaSessionService
Returns:
The chaining property value.
See Also:
setChaining(boolean)

getCloseIssued

public boolean getCloseIssued()

Gets the closeIssued property (boolean) value.

Returns:
The closeIssued property value.
See Also:
setCloseIssued(boolean)

getCompression

public boolean getCompression()
Gets the compression property (boolean) value.
Specified by:
getCompression in interface Lu0SnaSessionService
Returns:
The compression property value.
See Also:
setCompression(boolean)

getDataReadySem

public Semaphore getDataReadySem()

Gets the dataReadySem property (com.ibm.dse.base.Semaphore) value.

Returns:
The dataReadySem property value.
See Also:
#setDataReadySem

getDefaultCodeSet

public java.lang.String getDefaultCodeSet()
Gets the defaultCodeSet property (java.lang.String) value.
Specified by:
getDefaultCodeSet in interface Lu0SnaSessionService
Returns:
The defaultCodeSet property value.
See Also:
setDefaultCodeSet(java.lang.String)

getDefiniteResponseSolicited

public boolean getDefiniteResponseSolicited()

Returns the value of the definite response protocol. If the value is true ,messages are sent with a Definite Response (if BIND allows it). If the value is false and if BIND specifies definite or exception, messages are sent with an exception response. The default value is false.

Specified by:
getDefiniteResponseSolicited in interface Lu0SnaSessionService
Returns:
The definiteResponseSolicited property value.
See Also:
setDefiniteResponseSolicited(boolean)

getEndBracketSent

public boolean getEndBracketSent()

Returns the value of the end bracket protocol. If the value is true, each message sent ends brackets. If the value is false, the messages sent do not have end brackets. The default value is false.

Specified by:
getEndBracketSent in interface Lu0SnaSessionService
Returns:
The endBracketSent property value.
See Also:
setEndBracketSent(boolean)

getEstablishSessionRetries

public int getEstablishSessionRetries()
Gets the establishSessionRetries property (int) value. If it is negative, it means that the session tries to establish itself forever, otherwise this property says how many times it establishs itself.
Specified by:
getEstablishSessionRetries in interface Lu0SnaSessionService
Returns:
The establishSessionRetries property value.
See Also:
setEstablishSessionRetries(int)

getEstablishTimeout

public int getEstablishTimeout()
Gets the establishTimeout property (int) value.
Specified by:
getEstablishTimeout in interface Lu0SnaSessionService
Returns:
The establishTimeout property value.
See Also:
setEstablishTimeout(int)

getFmhHeaderSent

public boolean getFmhHeaderSent()

Returns the value of the FMH sent protocol. . If the value is true, the message sent includes an FM Header. The default value is false.

Specified by:
getFmhHeaderSent in interface Lu0SnaSessionService
Returns:
The fmhHeaderSent property value.
See Also:
setFmhHeaderSent(boolean)

getFmhIncluded

public boolean getFmhIncluded()

Returns the value of the FMH received protocol. If the value is true, the messages received with FMH preserve it. If the value is false, FMH is removed from the messages received. The default value is false.

Specified by:
getFmhIncluded in interface Lu0SnaSessionService
Returns:
The fmhIncluded property value.
See Also:
setFmhIncluded(boolean)

getHostApplicationName

public java.lang.String getHostApplicationName()
Returns the host application name to which the session is going to be established.
Specified by:
getHostApplicationName in interface Lu0SnaSessionService
Returns:
The hostApplicationName property value.
See Also:
setHostApplicationName(java.lang.String)

getInUse

public boolean getInUse()

Gets the in use.

Specified by:
getInUse in interface Lu0SnaSessionService
Returns:
boolean

getLastMessageReceived

public Lu0Message getLastMessageReceived()

Gets the lastMessageReceived property (com.ibm.dse.services.Lu0Message) value.

Returns:
The lastMessageReceived property value.
See Also:
#setLastMessageReceived

getLastRuReceived

public Lu0Message getLastRuReceived()

Gets the lastRuReceived property (com.ibm.dse.services.Lu0Message) value.

Returns:
The lastRuReceived property value.
See Also:
#setLastRuReceived

getLastRuSent

public Lu0Message getLastRuSent()

Gets the lastRuSent property (com.ibm.dse.services.Lu0Message) value.

Returns:
The lastRuSent property value.
See Also:
#setLastRuSent

getLastSense

public java.lang.String getLastSense()

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

Returns:
The lastSense property value.
See Also:
#setLastSense

getLevel

public static java.lang.String getLevel()
                                 throws DSEException
Returns:
java.lang.String

getListenThreadSem

public Semaphore getListenThreadSem()

Gets the listenThreadSem property (com.ibm.dse.base.Semaphore) value.

Returns:
The listenThreadSem property value.
See Also:
#setListenThreadSem

getLuName

public java.lang.String getLuName()

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

Specified by:
getLuName in interface Lu0SnaSessionService
Returns:
The luName property value.
See Also:
setLuName(java.lang.String)

getManageResponses

public boolean getManageResponses()

Returns the value of the response protocol. If the value is true, the application must send the sendNegativeResponse or sendPositiveResponse after receiving each chain. If the value is false, sendPositiveResponse is sent internally if it is needed. The default value is false.

Specified by:
getManageResponses in interface Lu0SnaSessionService
Returns:
The manageResponses property value.
See Also:
setManageResponses(boolean)

getMessageToLu

public boolean getMessageToLu()

Returns the value message received. If the value is true, the next message is sent to the LU-LU session. If the value is false, the message is sent to the SSCP-LU session.

Specified by:
getMessageToLu in interface Lu0SnaSessionService
Returns:
The messageToLu property value.
See Also:
setMessageToLu(boolean)

getPropertyChange

protected java.beans.PropertyChangeSupport getPropertyChange()
Accessor for the propertyChange field.

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.
See Also:
setReceivingChain(java.lang.String)

getResponsePendingToReceive

public boolean getResponsePendingToReceive()

Gets the responsePendingToReceive property (boolean) value.

Returns:
The responsePendingToReceive property value.
See Also:
setResponsePendingToReceive(boolean)

getResponseRequired

public boolean getResponseRequired()

Gets the responseRequired property (boolean) value.

Returns:
The responseRequired property value.
See Also:
setResponseRequired(boolean)

getSendingChain

public boolean getSendingChain()

Gets the sendingChain property (boolean) value.

Returns:
The sendingChain property value.
See Also:
#setSendingChain

getSeqNumber

public java.lang.String getSeqNumber()

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

Returns:
The seqNumber property value.
See Also:
#setSeqNumber

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

getSessionStatus

public java.lang.String getSessionStatus()

Gets the communication status value. Possible values are:

Specified by:
getSessionStatus in interface Lu0SnaSessionService
Returns:
The sessionStatus property value.
See Also:
setSessionStatus(java.lang.String)

getSynchronousMode

public boolean getSynchronousMode()
Gets the synchronousMode property (boolean) value.
Specified by:
getSynchronousMode in interface Lu0SnaSessionService
Returns:
The synchronousMode property value.
See Also:
setSynchronousMode(boolean)

getTimeBetweenRetries

public int getTimeBetweenRetries()
Gets the timeBetweenRetries property (int) value. It is the time (specified in seconds in the services SGML file but stored in milliseconds) between each unsuccessful attempt to establish a session.
Specified by:
getTimeBetweenRetries in interface Lu0SnaSessionService
Returns:
The timeBetweenRetries property value.
See Also:
setTimeBetweenRetries(int)

handleEvent

public void handleEvent(java.lang.String anEventName,
                        java.lang.String aNotifierName,
                        Context aContext)
                 throws DSEInvalidArgumentException
Handles events.
Specified by:
handleEvent in interface Handler

handleEvent

public void handleEvent(java.lang.String anEventName,
                        java.lang.String aNotifierName,
                        Context aContext,
                        java.lang.String aTID)
                 throws DSEInvalidArgumentException
Handles events.
Specified by:
handleEvent in interface Handler

initializeCounter

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

initializeFrom

public java.lang.Object initializeFrom(Tag aTag)
                                throws java.io.IOException,
                                       DSEInvalidArgumentException,
                                       DSELu0InternalErrorException,
                                       DSELu0InvalidRequestException
Description copied from class: Service
Initializes the Service reading its attributes values from aTag.
Overrides:
initializeFrom in class Service
Parameters:
aTag - com.ibm.dse.base.Tag
Returns:
java.lang.Object

initInstance

public void initInstance()
                  throws DSELu0InternalErrorException,
                         DSEInvalidArgumentException
Initiates all handlers that have a default treatment. It also does an Init to the Communication Server and creates the listenThread.
Specified by:
initInstance in interface Lu0SnaSessionService
Throws:
com.ibm.dse.srevices.comms.DSELu0InternalErrorException -  
com.ibm.dse.srevices.comms.DSEInvalidArgumentException -  

isFree

public boolean isFree()

Returns if the session is free

Specified by:
isFree in interface Lu0SnaSessionService
Returns:
boolean

isOffline

public boolean isOffline()

Returns if the session is offline

Specified by:
isOffline in interface Lu0SnaSessionService
Returns:
boolean

messageReceived

public Lu0Message messageReceived()
                           throws DSELu0InternalErrorException

Returns the last message received from host if there is one.

Specified by:
messageReceived in interface Lu0SnaSessionService
Returns:
com.ibm.dse.services.comms.Lu0Message

messageReceived

public Lu0Message messageReceived(Context aContext,
                                  FormatElement aFormat)
                           throws DSELu0InternalErrorException

Returns the last message received from host if there is one.

Specified by:
messageReceived in interface Lu0SnaSessionService
Parameters:
aContext - com.ibm.dse.base.Context
aFormat - com.ibm.dse.base.FormatElement
Returns:
com.ibm.dse.services.comms.Lu0Message

messageReceived

public Lu0Message messageReceived(Context aContext,
                                  java.lang.String aFormatName)
                           throws DSELu0InternalErrorException

Returns the last message received from host if there is one.

Specified by:
messageReceived in interface Lu0SnaSessionService
Parameters:
aContext - com.ibm.dse.base.Context
aFormatName - java.lang.String
Returns:
com.ibm.dse.services.comms.Lu0Message

peekMessageReceived

public Lu0Message peekMessageReceived()
                               throws DSELu0InternalErrorException

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.

Specified by:
peekMessageReceived in interface Lu0SnaSessionService

receive

public Lu0Message receive(long aTimeout)
                   throws DSELu0InternalErrorException

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.

Specified by:
receive in interface Lu0SnaSessionService
Parameters:
aTimeOut - int
Returns:
com.ibm.dse.services.comms.Lu0Message

receive

public Lu0Message receive(long aTimeout,
                          Context aContext,
                          FormatElement aFormat)
                   throws DSELu0InternalErrorException

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.

Specified by:
receive in interface Lu0SnaSessionService
Parameters:
aTimeout - long
aContext - com.ibm.dse.base.Context
aFormat - com.ibm.dse.base.FormatElement
Returns:
com.ibm.dse.services.comms.Lu0Message

receive

public Lu0Message receive(long aTimeout,
                          Context aContext,
                          java.lang.String aFormatName)
                   throws DSELu0InternalErrorException

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.

Specified by:
receive in interface Lu0SnaSessionService
Parameters:
aTimeout - long
aContext - com.ibm.dse.base.Context
aFormatName - java.lang.String
Returns:
com.ibm.dse.services.comms.Lu0Message

removeBIDReceivedListener

public void removeBIDReceivedListener(BIDReceivedListener newListener)
Generated to support the BIDReceived event.
Specified by:
removeBIDReceivedListener in interface Lu0SnaSessionService
Parameters:
newListener - com.ibm.dse.services.comms.BIDReceivedListener

removeMessageCancelledListener

public void removeMessageCancelledListener(MessageCancelledListener newListener)
Generated to support the MessageCancelled event.
Specified by:
removeMessageCancelledListener in interface Lu0SnaSessionService
Parameters:
newListener - com.ibm.dse.services.comms.MessageCancelledListener

removeMessageListener

public void removeMessageListener(MessageListener newListener)
Generated to support the Message event.
Specified by:
removeMessageListener in interface Lu0SnaSessionService
Parameters:
newListener - com.ibm.dse.services.comms.MessageListener

removeNegativeResponseListener

public void removeNegativeResponseListener(NegativeResponseListener newListener)
Generated to support the NegativeResponse event.
Specified by:
removeNegativeResponseListener in interface Lu0SnaSessionService
Parameters:
newListener - com.ibm.dse.services.comms.NegativeResponseListener

removePositiveResponseListener

public void removePositiveResponseListener(PositiveResponseListener newListener)
Generated to support the PositiveResponse event.
Specified by:
removePositiveResponseListener in interface Lu0SnaSessionService
Parameters:
newListener - com.ibm.dse.services.comms.PositiveResponseListener

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Generated to support the propertyChange field.

removeSessionClosedListener

public void removeSessionClosedListener(SessionClosedListener newListener)
Generated to support the SessionClosed event.
Specified by:
removeSessionClosedListener in interface Lu0SnaSessionService
Parameters:
newListener - com.ibm.dse.services.comms.SessionClosedListener

removeSessionDownListener

public void removeSessionDownListener(SessionDownListener newListener)
Generated to support the SessionDown event.
Specified by:
removeSessionDownListener in interface Lu0SnaSessionService
Parameters:
newListener - com.ibm.dse.services.comms.SessionDownListener

removeSessionEstablishedListener

public void removeSessionEstablishedListener(SessionEstablishedListener newListener)
Generated to support the SessionEstablished event.
Specified by:
removeSessionEstablishedListener in interface Lu0SnaSessionService
Parameters:
newListener - com.ibm.dse.services.comms.SessionEstablishedListener

removeSessionNotEstablishedListener

public void removeSessionNotEstablishedListener(SessionNotEstablishedListener newListener)
Generated to support the SessionNotEstablished event.
Specified by:
removeSessionNotEstablishedListener in interface Lu0SnaSessionService
Parameters:
newListener - com.ibm.dse.services.comms.SessionNotEstablishedListener

removeUnsolicitedMessageCancelledListener

public void removeUnsolicitedMessageCancelledListener(UnsolicitedMessageCancelledListener newListener)
Generated to support the UnsolicitedMessageCancelled event.
Specified by:
removeUnsolicitedMessageCancelledListener in interface Lu0SnaSessionService
Parameters:
newListener - com.ibm.dse.services.comms.UnsolicitedMessageCancelledListener

removeUnsolicitedMessageListener

public void removeUnsolicitedMessageListener(UnsolicitedMessageListener newListener)
Generated to support the UnsolicitedMessage event.
Specified by:
removeUnsolicitedMessageListener in interface Lu0SnaSessionService
Parameters:
newListener - com.ibm.dse.services.comms.UnsolicitedMessageListener

resetSession

protected void resetSession()

run

public void run()

Implements the runnable interface.

Specified by:
run in interface java.lang.Runnable

send

public void send(Context aContext,
                 FormatElement aFormat)
          throws DSELu0InvalidRequestException,
                 DSELu0InternalErrorException

Formats and sends the context (aContext) for aFormat.

Specified by:
send in interface Lu0SnaSessionService
Parameters:
aContext - com.ibm.dse.base.Context
aFormat - com.ibm.dse.base.FormatElement

send

public void send(Context aContext,
                 java.lang.String aFormatName)
          throws DSELu0InvalidRequestException,
                 DSELu0InternalErrorException

Formats and sends the context (aContext) for aFormatName.

Specified by:
send in interface Lu0SnaSessionService
Parameters:
aContext - com.ibm.dse.base.Context
aFormatName - java.lang.String

send

public void send(java.lang.String aString)
          throws DSELu0InvalidRequestException,
                 DSELu0InternalErrorException

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

Specified by:
send in interface Lu0SnaSessionService
Parameters:
aString - java.lang.String

aString is the formatted data that will be sent to host. 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.

sendCancel

public void sendCancel()
                throws DSELu0InvalidRequestException,
                       DSELu0InternalErrorException

Sends a SNA Cancel command.

Specified by:
sendCancel in interface Lu0SnaSessionService

sendCommand

public void sendCommand(java.lang.String aCommand)
                 throws DSELu0InvalidRequestException,
                        DSELu0InternalErrorException

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

Specified by:
sendCommand in interface Lu0SnaSessionService
Parameters:
aCommand - java.lang.String

sendFic

public void sendFic(Context aContext,
                    FormatElement aFormat)
             throws DSEException

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

Specified by:
sendFic in interface Lu0SnaSessionService
Parameters:
aContext - com.ibm.dse.base.Context
aFormat - com.ibm.dse.base.FormatElement

sendFic

public void sendFic(Context aContext,
                    java.lang.String aFormatName)
             throws DSEException

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

Specified by:
sendFic in interface Lu0SnaSessionService
Parameters:
aContext - com.ibm.dse.base.Context
aFormatName - java.lang.String

sendFic

public void sendFic(java.lang.String aString)
             throws DSELu0InvalidRequestException,
                    DSELu0InternalErrorException

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 CS returns an error
Specified by:
sendFic in interface Lu0SnaSessionService
Parameters:
aString - java.lang.String

sendLic

public void sendLic(Context aContext,
                    FormatElement aFormat)
             throws DSEException

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

Specified by:
sendLic in interface Lu0SnaSessionService
Parameters:
aContext - com.ibm.dse.base.Context
aFormat - com.ibm.dse.base.FormatElement

sendLic

public void sendLic(Context aContext,
                    java.lang.String aFormatName)
             throws DSEException

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

Specified by:
sendLic in interface Lu0SnaSessionService
Parameters:
aContext - com.ibm.dse.base.Context
aFormatName - java.lang.String

sendLic

public void sendLic(java.lang.String aString)
             throws DSELu0InvalidRequestException,
                    DSELu0InternalErrorException

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

Specified by:
sendLic in interface Lu0SnaSessionService
Parameters:
aDataString - java.lang.String

sendMic

public void sendMic(Context aContext,
                    FormatElement aFormat)
             throws DSEException

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

Specified by:
sendMic in interface Lu0SnaSessionService
Parameters:
aContext - com.ibm.dse.base.Context
aFormat - com.ibm.dse.base.FormatElement

sendMic

public void sendMic(Context aContext,
                    java.lang.String aFormatName)
             throws DSEException

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

Specified by:
sendMic in interface Lu0SnaSessionService
Parameters:
aContext - com.ibm.dse.base.Context
aFormatName - java.lang.String

sendMic

public void sendMic(java.lang.String aString)
             throws DSELu0InvalidRequestException,
                    DSELu0InternalErrorException

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

Specified by:
sendMic in interface Lu0SnaSessionService
Parameters:
aDataString - java.lang.String

sendNegativeResponse

public void sendNegativeResponse(java.lang.String aSense)
                          throws DSELu0InvalidRequestException,
                                 DSELu0InternalErrorException

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

Specified by:
sendNegativeResponse in interface Lu0SnaSessionService
Parameters:
aSense - java.lang.String

sendPositiveResponse

public void sendPositiveResponse()
                          throws DSELu0InvalidRequestException,
                                 DSELu0InternalErrorException

Sends a positive response to the last message received.

Specified by:
sendPositiveResponse in interface Lu0SnaSessionService
Parameters:
aSense - java.lang.String

sendReadyToReceive

public void sendReadyToReceive()
                        throws DSELu0InvalidRequestException,
                               DSELu0InternalErrorException

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.

Specified by:
sendReadyToReceive in interface Lu0SnaSessionService

setAutomaticSessionEstablishment

public void setAutomaticSessionEstablishment(boolean automaticSessionEstablishment)

Sets the automaticSessionEstablishment property (boolean) value.

Specified by:
setAutomaticSessionEstablishment in interface Lu0SnaSessionService
Parameters:
automaticSessionEstablishment - The new value for the property.
See Also:
getAutomaticSessionEstablishment()

setBIDManaged

public void setBIDManaged(boolean BIDManaged)

Sets the BIDManaged property (boolean) value.

Specified by:
setBIDManaged in interface Lu0SnaSessionService
Parameters:
BIDManaged - The new value for the property.
See Also:
getBIDManaged()

setChaining

public void setChaining(boolean chaining)

Sets the chaining protocol.

Specified by:
setChaining in interface Lu0SnaSessionService
Parameters:
chaining - The new value for the property.
See Also:
getChaining()

setCloseIssued

protected void setCloseIssued(boolean closeIssued)

Sets the closeIssued property (boolean) value.

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

setCompression

public void setCompression(boolean compression)
Sets the compression property (boolean) value.
Specified by:
setCompression in interface Lu0SnaSessionService
Parameters:
compression - The new value for the property.
See Also:
getCompression()

setDefaultCodeSet

public void setDefaultCodeSet(java.lang.String defaultCodeSet)
Sets the defaultCodeSet property (java.lang.String) value.
Specified by:
setDefaultCodeSet in interface Lu0SnaSessionService
Parameters:
defaultCodeSet - The new value for the property.
See Also:
getDefaultCodeSet()

setDefiniteResponseSolicited

public void setDefiniteResponseSolicited(boolean definiteResponseSolicited)

Sets the definite response protocol to:

Specified by:
setDefiniteResponseSolicited in interface Lu0SnaSessionService
Parameters:
definiteResponseSolicited - The new value for the property.
See Also:
getDefiniteResponseSolicited()

setEndBracketSent

public void setEndBracketSent(boolean endBracketSent)

Sets the end bracket protocol to :

Specified by:
setEndBracketSent in interface Lu0SnaSessionService
Parameters:
endBracketSent - The new value for the property.
See Also:
getEndBracketSent()

setEstablishSessionRetries

public void setEstablishSessionRetries(int establishSessionRetries)
Sets the establishSessionRetries property (int) value.
Specified by:
setEstablishSessionRetries in interface Lu0SnaSessionService
Parameters:
establishSessionRetries - The new value for the property.
See Also:
getEstablishSessionRetries()

setEstablishTimeout

public void setEstablishTimeout(int aEstablishTimeout)
Sets the timeBetweenRetries property (int) value.
Specified by:
setEstablishTimeout in interface Lu0SnaSessionService
Parameters:
timeBetweenRetries - The new value for the property.
See Also:
getTimeBetweenRetries()

setFmhHeaderSent

public void setFmhHeaderSent(boolean fmhHeaderSent)

Sets the FMH sent protocol to :

Specified by:
setFmhHeaderSent in interface Lu0SnaSessionService
Parameters:
fmhHeaderSent - The new value for the property.
See Also:
getFmhHeaderSent()

setFmhIncluded

public void setFmhIncluded(boolean fmhIncluded)

Sets the FMH received protocol to :

Specified by:
setFmhIncluded in interface Lu0SnaSessionService
Parameters:
fmhIncluded - The new value for the property.
See Also:
getFmhIncluded()

setHostApplicationName

public void setHostApplicationName(java.lang.String hostApplicationName)

Sets the host application name.

Specified by:
setHostApplicationName in interface Lu0SnaSessionService
Parameters:
hostApplicationName - The new value for the property.
See Also:
getHostApplicationName()

setInUse

public void setInUse(boolean anuse)

Sets the in use.

Specified by:
setInUse in interface Lu0SnaSessionService
Parameters:
anuse - boolean

setLuName

public void setLuName(java.lang.String luName)

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

Specified by:
setLuName in interface Lu0SnaSessionService
Parameters:
luName - The new value for the property.
See Also:
getLuName()

setManageResponses

public void setManageResponses(boolean manageResponses)

Sets the response protocol to :

Specified by:
setManageResponses in interface Lu0SnaSessionService
Parameters:
manageResponses - The new value for the property.
See Also:
getManageResponses()

setMessageToLu

public void setMessageToLu(boolean messageToLu)

Sets the type of the host partner session to:

Specified by:
setMessageToLu in interface Lu0SnaSessionService
Parameters:
messageToLu - The new value for the property.
See Also:
getMessageToLu()

setOpenIssued

protected void setOpenIssued(boolean openIssued)

Sets the openIssued property (boolean) value.

Parameters:
openIssued - The new value for the property.
See Also:
#getOpenIssued

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

setSessionStatus

protected 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.
Specified by:
setSynchronousMode in interface Lu0SnaSessionService
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

setTimeBetweenRetries

public void setTimeBetweenRetries(int timeBetweenRetries)
Sets the timeBetweenRetries property (int) value.
Specified by:
setTimeBetweenRetries in interface Lu0SnaSessionService
Parameters:
timeBetweenRetries - The new value for the property.
See Also:
getTimeBetweenRetries()

stopHandlingEvent

public void stopHandlingEvent(java.lang.String anEventName,
                              java.lang.String aNotifierName,
                              Context aContext)
                       throws DSEHandlerNotFoundException,
                              DSEInvalidArgumentException
Stops event handling.
Specified by:
stopHandlingEvent in interface Handler

stopHandlingEvent

public void stopHandlingEvent(java.lang.String anEventName,
                              java.lang.String aNotifierName,
                              Context aContext,
                              java.lang.String aTID)
                       throws DSEHandlerNotFoundException,
                              DSEInvalidArgumentException
Stops event handling.
Specified by:
stopHandlingEvent in interface Handler

terminate

public void terminate()
               throws DSELu0InternalErrorException

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.

Specified by:
terminate in interface Lu0SnaSessionService
Overrides:
terminate in class Service

toString

public java.lang.String toString()
Returns a visual representation of this object.
Overrides:
toString in class Service
Returns:
java.lang.String - The object visual representation.