|
IBM Branch Transformation Toolkit Javadoc | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.connector2.sna.lu0.host.Lu0SnaSession
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
|
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 |
public static final java.lang.String COMPID
boolean isEstablishSessionThreadAlive
static final java.lang.String RUIBIDBEGIN
static final java.lang.String RUIBIDENDOK
static final java.lang.String RUIBIDENDER
static final java.lang.String RUIWRITEBEGIN
static final java.lang.String RUIWRITEENDOK
static final java.lang.String RUIWRITEENDER
static final java.lang.String RUIREADBEGIN
static final java.lang.String RUIREADENDOK
static final java.lang.String RUIREADENDER
static final java.lang.String RUIINITBEGIN
static final java.lang.String RUIINITENDOK
static final java.lang.String RUIINITENDER
static final java.lang.String RUITERMBEGIN
static final java.lang.String RUITERMENDOK
static final java.lang.String RUITERMENDER
Constructor Detail |
public Lu0SnaSession(Lu0SnaSessionConfigurationProperties configurationProperties)
Method Detail |
public void addLu0SessionEventListener(Lu0SessionEventListener listener)
public void removeLu0SessionEventListener()
public Lu0Message receiveData(long aTimeout) throws Lu0Exception
aTimeout
- long
Lu0Exception
public Lu0Message sendReceive(java.lang.String aString, long aTimeout) throws Lu0Exception
aString
- java.lang.StringaTimeout
- long
Lu0Exception
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.
Lu0Exception
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.
Lu0Exception
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.
public java.lang.String getBracketStatus()
Gets the bracketStatus property (java.lang.String) value.
public boolean getCloseIssued()
Gets the closeIssued property (boolean) value.
public Semaphore getDataReadySem()
Gets the dataReadySem property (com.ibm.connector.lu0.host.Semaphore) value.
public boolean getInUse()
Gets the in use.
public Lu0Message getLastMessageReceived()
Gets the lastMessageReceived property (com.ibm.connector.lu0.host.Lu0Message) value.
public Lu0Message getLastRuReceived()
Gets the lastRuReceived property (com.ibm.connector.lu0.host.Lu0Message) value.
public Lu0Message getLastRuSent()
Gets the lastRuSent property (com.ibm.connector.lu0.host.Lu0Message) value.
public java.lang.String getLastSense()
Gets the lastSense property (java.lang.String) value.
public java.lang.String getLevel() throws Lu0Exception
Lu0Exception
public Semaphore getListenThreadSem()
Gets the listenThreadSem property (com.ibm.connector.lu0.host.Semaphore) value.
public LuaCommon getLuaCommon2()
public java.lang.String getReceivingChain()
Gets the receivingChain property (java.lang.String) value.
receivingChain can have one of the following values:
public boolean getResponsePendingToReceive()
Gets the responsePendingToReceive property (boolean) value.
public boolean getResponseRequired()
Gets the responseRequired property (boolean) value.
public boolean getSendingChain()
Gets the sendingChain property (boolean) value
public java.lang.String getSeqNumber()
Gets the seqNumber property (java.lang.String) value
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.
setSessionId(java.lang.String)
public java.lang.String getSessionStatus()
Gets the communication status value. Possible values are:
setSessionStatus(java.lang.String)
public boolean getSynchronousMode()
setSynchronousMode(boolean)
public boolean getTermIssued()
Gets the termIssued property (boolean) value.
protected void initializeCounter()
public void initInstance() throws Lu0Exception
com.ibm.connector.lu0.host.Lu0InternalErrorException
com.ibm.connector.lu0.host.Lu0InvalidArgumentException
Lu0Exception
public boolean isFree()
Returns if the session is free
public boolean isOffline()
Returns if the session is offline
public Lu0Message messageReceived() throws Lu0Exception
Lu0Exception
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.
Lu0Exception
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.
aTimeout
- int
Lu0Exception
protected void resetSession()
public void run()
Implements the runnable interface.
run
in interface java.lang.Runnable
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).
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:
Lu0Exception
public void sendCancel() throws Lu0Exception
Sends a SNA Cancel command.
Lu0Exception
public void sendCommand(java.lang.String aCommand) throws Lu0Exception
Sends the SNA aCommand, which must be a valid command (Lustat, Signal) in hexadecimal.
aCommand
- java.lang.String
Lu0Exception
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:
aString
- java.lang.String
Lu0Exception
public void sendLic(java.lang.String aString) throws Lu0Exception
Sends a message with the Last In Chain (LIC) identifier
aString
- java.lang.String
Lu0Exception
public void sendMic(java.lang.String aString) throws Lu0Exception
Sends a message with the Middle In Chain (MIC) identifier
aString
- java.lang.String
Lu0Exception
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
aSense
- java.lang.String
Lu0Exception
public void sendPositiveResponse() throws Lu0Exception
Sends a positive response to the last message received
Lu0Exception
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.
Lu0Exception
protected void setCloseIssued(boolean closeIssued)
Sets the closeIssued property (boolean) value.
closeIssued
- The new value for the property.getCloseIssued()
public void setInUse(boolean inUse)
Sets the in use
inUse
- booleanprotected void setOpenIssued(boolean openIssued)
Sets the openIssued property (boolean) value.
openIssued
- The new value for the property.protected void setReceivingChain(java.lang.String receivingChain)
Sets the receivingChain property (java.lang.String) value.
receivingChain
- The new value for the property.getReceivingChain()
protected void setResponsePendingToReceive(boolean responsePendingToReceive)
Sets the responsePendingToReceive property (boolean) value.
responsePendingToReceive
- The new value for the property.getResponsePendingToReceive()
protected void setResponseRequired(boolean responseRequired)
Sets the responseRequired property (boolean) value.
responseRequired
- The new value for the property.getResponseRequired()
public void setSessionId(java.lang.String sessionId)
Sets the sessionId property (java.lang.String) value.
sessionId
- The new value for the property.getSessionId()
public void setSessionStatus(java.lang.String sessionStatus)
Sets the sessionStatus property (java.lang.String) value.
sessionStatus
- The new value for the property.getSessionStatus()
public void setSynchronousMode(boolean synchronousMode)
synchronousMode
- The new value for the property.getSynchronousMode()
protected void setTermIssued(boolean termIssued)
Sets the termIssued property (boolean) value.
termIssued
- The new value for the property.getTermIssued()
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.
Lu0Exception
public java.lang.String toString()
public Semaphore getSessionDownSem()
|
IBM Branch Transformation Toolkit Javadoc | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |