com.ibm.dse.services.comms
Class Lu62Conversation

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

public class Lu62Conversation
extends Service
implements Lu62ConversationService, Handler

See Also:
Serialized Form

Field Summary
protected  ConfirmedReceivedListener aConfirmedReceivedListener
           
protected  ConversationClosedListener aConversationClosedListener
           
protected  ConversationDownListener aConversationDownListener
           
protected  ConversationEstablishedListener aConversationEstablishedListener
           
protected  ConversationNotEstablishedListener aConversationNotEstablishedListener
           
protected  DataCancelledListener aDataCancelledListener
           
protected  DataListener aDataListener
           
protected  ErrorReceivedListener aErrorReceivedListener
           
static java.lang.String COMPID
           
 boolean listenThreadAlive
           
 Semaphore receiveSem
           
 
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.Lu62ConversationService
ACCEPT_CONVERSATION, ALLOCATEERROR, BUFFER_LENGTH, CLOSED, CM_ALLOCATE_FAILURE_NO_RETRY, CM_ALLOCATE_FAILURE_RETRY, CM_ALLOCATION_ERROR, CM_BASIC_CONVERSATION, CM_BLOCKING, CM_BUFFER_DATA, CM_BUFFER_TOO_SMALL, CM_CALL_NOT_SUPPORTED, CM_COMPLETE_DATA_RECEIVED, CM_CONFIRM, CM_CONFIRM_DEALLOC_RECEIVED, CM_CONFIRM_RECEIVED, CM_CONFIRM_SEND_RECEIVED, CM_CONV_DEALLOC_AFTER_SYNCPT, CM_CONVERSATION_CANCELLED, CM_CONVERSATION_ENDING, CM_CONVERSATION_TYPE_MISMATCH, CM_DATA_RECEIVED, CM_DEALLOC_CONFIRM_REJECT, CM_DEALLOCATE_ABEND, CM_DEALLOCATE_CONFIRM, CM_DEALLOCATE_FLUSH, CM_DEALLOCATE_SYNC_LEVEL, CM_DEALLOCATED_ABEND, CM_DEALLOCATED_ABEND_BO, CM_DEALLOCATED_ABEND_SVC, CM_DEALLOCATED_ABEND_SVC_BO, CM_DEALLOCATED_ABEND_TIMER, CM_DEALLOCATED_ABEND_TIMER_BO, CM_DEALLOCATED_NORMAL, CM_DEALLOCATED_NORMAL_BO, CM_EXP_DATA_NOT_SUPPORTED, CM_INCLUDE_PARTNER_REJECT_BO, CM_INCOMPLETE_DATA_RECEIVED, CM_JOIN_TRANSACTION, CM_MAPPED_CONVERSATION, CM_NO_DATA_RECEIVED, CM_NO_SECONDARY_INFORMATION, CM_NO_STATUS_RECEIVED, CM_NON_BLOCKING, CM_NONE, CM_OK, CM_OPERATION_INCOMPLETE, CM_OPERATION_NOT_ACCEPTED, CM_PARAMETER_ERROR, CM_PARM_VALUE_NOT_SUPPORTED, CM_PIP_NOT_SPECIFIED_CORRECTLY, CM_PREPARE_OK, CM_PRODUCT_SPECIFIC_ERROR, CM_PROGRAM_ERROR_NO_TRUNC, CM_PROGRAM_ERROR_PURGING, CM_PROGRAM_ERROR_TRUNC, CM_PROGRAM_PARAMETER_CHECK, CM_PROGRAM_STATE_CHECK, CM_RECEIVE_AND_WAIT, CM_RECEIVE_IMMEDIATE, CM_RESOURCE_FAIL_NO_RETRY_BO, CM_RESOURCE_FAILURE_NO_RETRY, CM_RESOURCE_FAILURE_RETRY, CM_RESOURCE_FAILURE_RETRY_BO, CM_RETRY_LIMIT_EXCEEDED, CM_SECURITY_MUTUAL_FAILED, CM_SECURITY_NOT_SUPPORTED, CM_SECURITY_NOT_VALID, CM_SEND_AND_CONFIRM, CM_SEND_AND_DEALLOCATE, CM_SEND_AND_FLUSH, CM_SEND_AND_PREP_TO_RECEIVE, CM_SEND_RCV_MODE_NOT_SUPPORTED, CM_SEND_RECEIVED, CM_SVC_ERROR_NO_TRUNC, CM_SVC_ERROR_PURGING, CM_SVC_ERROR_TRUNC, CM_SYNC_LEVEL_NOT_SUPPORTED_LU, CM_SYNC_LEVEL_NOT_SUPPORTED_PGM, CM_SYNC_LVL_NOT_SUPPORTED_LU, CM_SYNC_LVL_NOT_SUPPORTED_PGM, CM_SYNC_LVL_NOT_SUPPORTED_SYS, CM_SYSTEM_EVENT, CM_TAKE_BACKOUT, CM_TAKE_COMMIT, CM_TAKE_COMMIT_DATA_OK, CM_TAKE_COMMIT_DEALLOC_DATA_OK, CM_TAKE_COMMIT_DEALLOCATE, CM_TAKE_COMMIT_SEND, CM_TAKE_COMMIT_SEND_DATA_OK, CM_TP_NOT_AVAILABLE_NO_RETRY, CM_TP_NOT_AVAILABLE_RETRY, CM_TPN_NOT_RECOGNISED, CM_TPN_NOT_RECOGNIZED, CM_UNSUCCESSFUL, COMPLETE, CONFIRM, CONFIRM_CONVERSATION, CONFIRM_DEALLOCATE, CONFIRM_SEND, CONFIRMED_RECEIVED, CONVERSATION_CLOSED, CONVERSATION_DOWN, CONVERSATION_ESTABLISHED, CONVERSATION_NOT_ESTABLISHED, DATA, DATA_CANCELLED, DEALLOCATE_CONVERSATION, ERROR, ERROR_RECEIVED, IBM_AIX, IBM_OS2, INCOMING, INFO, INITIALIZE, LISTEN, LU62_WRAPPER_DLL, LUNAME, MVS, OPENED, OSNAME, OUTGOING, RECEIVE, REGISTERERROR, RESET, RESET_PENDING, SDN, SEND, SEND_PENDING, SENDERROR, SRTERROR, TPNAME, WINDOWS_NT
 
Fields inherited from interface com.ibm.dse.services.comms.CommonCommunicationsService
CLOSED, DATA, DATASENT, ERROR, OPENED, RECEIVERC, TIMEOUT
 
Constructor Summary
Lu62Conversation()
          This constructor creates a Lu62Conversation object.
Lu62Conversation(java.lang.String aString)
          This constructor creates a Lu62Conversation object with name aString .
 
Method Summary
 void acceptConversation()
          Issued by the invoked program to accept an incoming conversation for the 390 system.
 void acceptIncoming()
          Issued by the invoked program to accept an incoming conversation that has previously been initialized with initializeForIncoming.
 void addConfirmedReceivedListener(ConfirmedReceivedListener newListener)
          Generated to support the ConfirmedReceived event.
 void addConversationClosedListener(ConversationClosedListener newListener)
          Generated to support the ConversationClosed event.
 void addConversationDownListener(ConversationDownListener newListener)
          Generated to support the ConversationDown event.
 void addConversationEstablishedListener(ConversationEstablishedListener newListener)
          Generated to support the ConversationEstablished event.
 void addConversationNotEstablishedListener(ConversationNotEstablishedListener newListener)
          Generated to support the ConversationNotEstablished event.
 void addDataCancelledListener(DataCancelledListener newListener)
          Generated to support the DataCancelled event.
 void addDataListener(DataListener newListener)
          Generated to support the Data event.
 void addErrorReceivedListener(ErrorReceivedListener newListener)
          Generated to support the ErrorReceived event.
 void allocateConversation(java.lang.String aTPName)
          Issued by the invoked program to accept an incoming conversation that has previously been initialized with initializeForIncoming.
 void cancelConversation()
          Ends a specified conversation, cancels any incomplete operation (a previous call that returned with CM_OPERATION_INCOMPLETE) on this conversation, and ends the session used by the conversation.
 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 chanel.
 CCMessage ccSendReceive(java.lang.String aString, long aTimeout)
          Sends aData thought the communications channel.
 void closeConversation()
          Leaves the communications closed.
 void confirm()
          Sends the contents of the local LU's send buffer and a confirmation request to the partner program.
 void deallocate()
          De-allocates a conversation between two programs.
 Handler dispatchEvent(DSEEventObject anEvent)
          Handles session events.
 void establishConversation()
          Establishes the conversation.
 void establishConversation(java.lang.String aTPName)
          Establishes the conversation.
 void finalize()
          Clears all the atributes when there is no reference to this instance.
protected  void fireConfirmedReceived(ConfirmedReceivedEvent event)
          Supports listener events.
protected  void fireConversationClosed(ConversationClosedEvent event)
          Supports listener events.
protected  void fireConversationDown(ConversationDownEvent event)
          Supports listener events.
protected  void fireConversationEstablished(ConversationEstablishedEvent event)
          Supports listener events.
protected  void fireConversationNotEstablished(ConversationNotEstablishedEvent event)
          Supports listener events.
protected  void fireData(DataEvent event)
          Supports listener events.
protected  void fireDataCancelled(DataCancelledEvent event)
          Supports listener events.
protected  void fireErrorReceived(ErrorReceivedEvent event)
          Supports listener events.
 void flush()
          Sends the contents of the local LU's send buffer to the partner LU (and program).
 boolean getAutomaticConversationEstablishment()
          Gets the automaticConversationEstablishment property (boolean) value.
 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 getConfirmMode()
          Gets the confirmMode property (boolean) value.
 ConversationHandler getConversationHandler()
          Gets the conversationHandler property (ConversationHandler) value.
 java.lang.String getConversationId()
          Gets the conversationId property (char[]) value.
 java.lang.String getConversationStatus()
          Gets the conversationStatus property (java.lang.String) value.It has the value of Conversation Status, the valid values are: RESET INITIALIZE SEND RECEIVE CONFIRM CONFIRM_SEND CONFIRM_DEALLOCATE
 int getEstablishConversationRetries()
          Gets the establishConversationRetries property (int) value.
 boolean getFlushMode()
          Gets the flushMode property (boolean) value.
 boolean getInUse()
          Gets the inUse property (boolean) value.
static java.lang.String getLevel()
          This method returns the WrapperLU62 version.
 Lu62Message getLu62Message()
          Gets the lu62Message property (Lu62Message) value.
 java.lang.String getLUName()
          Gets the LUName property (java.lang.String) value.
 boolean getManageResponses()
          Gets the manageResponses property (boolean) value.
 boolean getOutgoing()
          Gets the outgoing property (boolean) value.
 java.lang.String getSymbolicDestinationName()
          Gets the symbolicDestinationName property (java.lang.String) value.
 boolean getSynchronousMode()
          Gets the synchronousMode property (boolean) value.
 int getTimeBetweenRetries()
          Gets the timeBetweenRetries property (int) value.
 java.lang.String getTpName()
          Gets the tpName property (java.lang.String) 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 EstablishConnectionSessionCounter property to its default value.
 java.lang.Object initializeFrom(Tag aTag)
          Actualizes all attributes that are defined in SGML files.
 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
protected  Lu62Message lu62SendReceive(java.lang.String aString, long aTimeout)
          Send aString to communcication services, and wait aTimeout to receive the data
 Lu62Message peekData()
          Returns the Lu62Message received, without reading it.
 Lu62Message readData()
          Returns the Lu62Message received.
 Lu62Message readData(Context aContext, FormatElement aFormat)
           
 Lu62Message readData(Context aContext, java.lang.String aFormatName)
          Returns the Lu62Message received.
 Lu62Message readData(long timeout)
          Returns the Lu62Message received.
 void receive()
          The receive call receives any data that is currently available from the partner program.
 Lu62Message receiveAndRequestToSend()
           
 void removeConfirmedReceivedListener(ConfirmedReceivedListener newListener)
          Generated to support the ConfirmedReceived event.
 void removeConversationClosedListener(ConversationClosedListener newListener)
          Generated to support the ConversationClosed event.
 void removeConversationDownListener(ConversationDownListener newListener)
          Generated to support the ConversationDown event.
 void removeConversationEstablishedListener(ConversationEstablishedListener newListener)
          Generated to support the ConversationEstablished event.
 void removeConversationNotEstablishedListener(ConversationNotEstablishedListener newListener)
          Generated to support the ConversationNotEstablished event.
 void removeDataCancelledListener(DataCancelledListener newListener)
          Generated to support the DataCancelled event.
 void removeDataListener(DataListener newListener)
          Generated to support the Data event.
 void removeErrorReceivedListener(ErrorReceivedListener newListener)
          Generated to support the ErrorReceived event.
 void send(Context aContext, FormatElement aFormat)
          Puts data in the local LU's send buffer for transmission to the partner program.
 void send(Context aContext, java.lang.String aFormatName)
          Puts data in the local LU's send buffer for transmission to the partner program.
 void send(java.lang.String aMessage)
          Puts data in the local LU's send buffer for transmission to the partner program.
 void sendAndPrepareToReceive(Context aContext, FormatElement aFormat)
          Causes data to be sent , with the SEND indicator to the remote LU, witch enters the local LU in RECEIVE state.
 void sendAndPrepareToReceive(Context aContext, java.lang.String aFormatName)
          Causes data to be sent , with the SEND indicator to the remote LU, witch enters the local LU in RECEIVE state.
 void sendAndPrepareToReceive(java.lang.String aMessage)
          Causes data to be sent , with the SEND indicator to the remote LU, witch enters the local LU in RECEIVE state.
 void sendCancel(java.lang.String aMessage)
          Cancels the current block of data by sending an error indication to the remote LU and keeping the local LU in a SEND state.
 void sendConfirmed()
          Replies to a confirmation request from the partner program.
 void sendError()
          Notifies the partner program that the local program has encountered an application-level error.
protected  CCMessage sendReceive(java.lang.String aString, long aTimeout)
          Send aString to communcication services, and wait aTimeout to receive the data
 void setAutomaticConversationEstablishment(boolean anAutomaticConversationEstablishment)
          Sets the automaticConversationEstablishment property (boolean) value.
 void setConfirmMode(boolean aConfirmMode)
          Sets the confirmMode property (boolean) value.
 void setEstablishConversationRetries(int establishConversationRetries)
          Sets the establishConversationRetries property (int) value.
 void setFlushMode(boolean aFlushMode)
          Sets the flushMode property (boolean) value.
 void setInUse(boolean anInUse)
          Sets the inUse property (boolean) value.
 void setLU_Name(java.lang.String aLUName)
          Issued by the invoking program to specify the local LU for a conversation.
 void setLUName(java.lang.String aLUName)
          Issued by the invoking program to specify the local LU for a conversation.
 void setManageResponses(boolean aManageResponses)
          Sets the manageResponses property (boolean) value.
 void setOutgoing(boolean aOutgoing)
          Sets the outgoing property (boolean) value.
 void setPassword(java.lang.String aPass)
          Issued by the invoking program to specify the password.
 void setSendType(int aSendType)
          Specifies how data will be sent by the next send call.
 void setSymbolicDestinationName(java.lang.String aSymbolicDestinationName)
          Sets the symbolicDestinationName property (java.lang.String) value.
 void setSynchronousMode(boolean aSynchronousMode)
          Sets the synchronousMode property (boolean) value.
 void setTimeBetweenRetries(int timeBetweenRetries)
          Sets the timeBetweenRetries property (int) value.
 void setTpName(java.lang.String aTpName)
          Sets the tpName property (java.lang.String) value.
 void setUserId(java.lang.String aUserId)
          Issued by the invoking program to specify the user ID.
 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 conversation.
 java.lang.String toString()
          Returns a visual representation of this object.
protected  void unregister()
          Unregisters conversations already registered for allocate.
 
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, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

COMPID

public static final java.lang.String COMPID

receiveSem

public Semaphore receiveSem

listenThreadAlive

public boolean listenThreadAlive

aConversationEstablishedListener

protected transient ConversationEstablishedListener aConversationEstablishedListener

aConversationNotEstablishedListener

protected transient ConversationNotEstablishedListener aConversationNotEstablishedListener

aConversationDownListener

protected transient ConversationDownListener aConversationDownListener

aConversationClosedListener

protected transient ConversationClosedListener aConversationClosedListener

aDataListener

protected transient DataListener aDataListener

aDataCancelledListener

protected transient DataCancelledListener aDataCancelledListener

aErrorReceivedListener

protected transient ErrorReceivedListener aErrorReceivedListener

aConfirmedReceivedListener

protected transient ConfirmedReceivedListener aConfirmedReceivedListener
Constructor Detail

Lu62Conversation

public Lu62Conversation()
This constructor creates a Lu62Conversation object.

Lu62Conversation

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

acceptConversation

public void acceptConversation()
                        throws DSELu62InternalErrorException,
                               DSELu62InvalidRequestException
Issued by the invoked program to accept an incoming conversation for the 390 system.

acceptIncoming

public void acceptIncoming()
                    throws DSELu62InternalErrorException,
                           DSELu62InvalidRequestException
Issued by the invoked program to accept an incoming conversation that has previously been initialized with initializeForIncoming.

addConfirmedReceivedListener

public void addConfirmedReceivedListener(ConfirmedReceivedListener newListener)
Generated to support the ConfirmedReceived event.
Specified by:
addConfirmedReceivedListener in interface Lu62ConversationService
Parameters:
newListener - com.ibm.dse.services.comms.ConfirmedReceivedListener

addConversationClosedListener

public void addConversationClosedListener(ConversationClosedListener newListener)
Generated to support the ConversationClosed event.
Specified by:
addConversationClosedListener in interface Lu62ConversationService
Parameters:
newListener - com.ibm.dse.services.comms.ConversationClosedListener

addConversationDownListener

public void addConversationDownListener(ConversationDownListener newListener)
Generated to support the ConversationDown event.
Specified by:
addConversationDownListener in interface Lu62ConversationService
Parameters:
newListener - com.ibm.dse.services.comms.ConversationDownListener

addConversationEstablishedListener

public void addConversationEstablishedListener(ConversationEstablishedListener newListener)
Generated to support the ConversationEstablished event.
Specified by:
addConversationEstablishedListener in interface Lu62ConversationService
Parameters:
newListener - com.ibm.dse.services.comms.ConversationEstablishedListener

addConversationNotEstablishedListener

public void addConversationNotEstablishedListener(ConversationNotEstablishedListener newListener)
Generated to support the ConversationNotEstablished event.
Specified by:
addConversationNotEstablishedListener in interface Lu62ConversationService
Parameters:
newListener - com.ibm.dse.services.comms.ConversationNotEstablishedListener

addDataCancelledListener

public void addDataCancelledListener(DataCancelledListener newListener)
Generated to support the DataCancelled event.
Specified by:
addDataCancelledListener in interface Lu62ConversationService
Parameters:
newListener - com.ibm.dse.services.comms.DataCancelledListener

addDataListener

public void addDataListener(DataListener newListener)
Generated to support the Data event.
Specified by:
addDataListener in interface Lu62ConversationService
Parameters:
newListener - com.ibm.dse.services.comms.DataListener

addErrorReceivedListener

public void addErrorReceivedListener(ErrorReceivedListener newListener)
Generated to support the ErrorReceived event.
Specified by:
addErrorReceivedListener in interface Lu62ConversationService
Parameters:
newListener - com.ibm.dse.services.comms.ErrorReceivedListener

allocateConversation

public void allocateConversation(java.lang.String aTPName)
                          throws DSELu62InternalErrorException,
                                 DSELu62InvalidRequestException
Issued by the invoked program to accept an incoming conversation that has previously been initialized with initializeForIncoming.

cancelConversation

public void cancelConversation()
                        throws DSELu62InternalErrorException,
                               DSELu62InvalidRequestException
Ends a specified conversation, cancels any incomplete operation (a previous call that returned with CM_OPERATION_INCOMPLETE) on this conversation, and ends the session used by the conversation.
Specified by:
cancelConversation in interface Lu62ConversationService

ccClose

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

ccOpen

public void ccOpen()
            throws DSECCException
Opens the communications channel. It returns control inmediately. When the communications channel is started correctly, 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 for the timeout.
Parameters:
aTimeout - long

ccSendData

public void ccSendData(java.lang.String aString)
                throws DSECCException

Sends aData thought the communications chanel. It returns control inmediately. When response is received from parner, two events migth 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)
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
aTimeout - long

closeConversation

public void closeConversation()
                       throws DSEException

Leaves the communications closed. To establish them again, the establishConversation method must be invoked.

Specified by:
closeConversation in interface Lu62ConversationService

confirm

public void confirm()
             throws DSELu62InternalErrorException,
                    DSELu62InvalidRequestException
Sends the contents of the local LU's send buffer and a confirmation request to the partner program. When the confirmation arrives, confirmedReceived or errorReceived is signaled.
Specified by:
confirm in interface Lu62ConversationService

deallocate

public void deallocate()
                throws DSELu62InternalErrorException
De-allocates a conversation between two programs.
See Also:
#CPIC_Deallocate

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

establishConversation

public void establishConversation()
                           throws DSELu62InternalErrorException,
                                  DSELu62InvalidRequestException

Establishes the conversation. Depending on whether the outgoing atribute is true or false, it has two different behaviours:

When Outgoing is true, establishConversation method, request to allocate a conversation using a session where the local LU is the contention winner (the one that can send data right after session setup - SEND state).

When Outgoing is false, establishConversation method requests to allocate a conversation using a contention looser session (the one that has to wait for data right after session setup - RECEIVE state).

As soon as, the conversation is allocated, the event conversationEstablished is signaled, and both partners can begin exchanging data on a half-duplex flip flop protocol

Specified by:
establishConversation in interface Lu62ConversationService

establishConversation

public void establishConversation(java.lang.String aTPName)
                           throws DSEException

Establishes the conversation. Depending on whether the outgoing atribute is true or false, it has two different behaviours:

When Outgoing is true, establishConversation method, request to allocate a conversation using a session where the local LU is the contention winner (the one that can send data right after session setup - SEND state).

When Outgoing is false, establishConversation method requests to allocate a conversation using a contention looser session (the one that has to wait for data right after session setup - RECEIVE state).

As soon as, the conversation is allocated, the event conversationEstablished is signaled, and both partners can begin exchanging data on a half-duplex flip flop protocol

Specified by:
establishConversation in interface Lu62ConversationService
Parameters:
aTPName - java.lang.String

finalize

public void finalize()

Clears all the atributes when there is no reference to this instance.

Overrides:
finalize in class java.lang.Object

fireConfirmedReceived

protected void fireConfirmedReceived(ConfirmedReceivedEvent event)
Supports listener events.
Parameters:
event - com.ibm.dse.services.comms.ConfirmedReceivedEvent

fireConversationClosed

protected void fireConversationClosed(ConversationClosedEvent event)
Supports listener events.
Parameters:
event - com.ibm.dse.services.comms.ConversationClosedEvent

fireConversationDown

protected void fireConversationDown(ConversationDownEvent event)
Supports listener events.
Parameters:
event - com.ibm.dse.services.comms.ConversationDownEvent

fireConversationEstablished

protected void fireConversationEstablished(ConversationEstablishedEvent event)
Supports listener events.
Parameters:
event - com.ibm.dse.services.comms.ConversationEstablishedEvent

fireConversationNotEstablished

protected void fireConversationNotEstablished(ConversationNotEstablishedEvent event)
Supports listener events.
Parameters:
event - com.ibm.dse.services.comms.ConversationNotEstablishedEvent

fireData

protected void fireData(DataEvent event)
Supports listener events.
Parameters:
event - com.ibm.dse.services.comms.DataEvent

fireDataCancelled

protected void fireDataCancelled(DataCancelledEvent event)
Supports listener events.
Parameters:
event - com.ibm.dse.services.comms.DataCancelledEvent

fireErrorReceived

protected void fireErrorReceived(ErrorReceivedEvent event)
Supports listener events.
Parameters:
event - com.ibm.dse.services.comms.ErrorReceivedEvent

flush

public void flush()
           throws DSELu62InternalErrorException,
                  DSELu62InvalidRequestException
Sends the contents of the local LU's send buffer to the partner LU (and program). If the send buffer is empty, no action takes place.
Specified by:
flush in interface Lu62ConversationService

getAutomaticConversationEstablishment

public boolean getAutomaticConversationEstablishment()

Gets the automaticConversationEstablishment property (boolean) value. If it is true, the conversation should be established at class instantiation.

Returns:
The automaticConversationEstablishment property value.
See Also:
setAutomaticConversationEstablishment(boolean)

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.

getConfirmMode

public boolean getConfirmMode()

Gets the confirmMode property (boolean) value. If confirmMode is true, the data is sent immediately with a request for confirmation.

Returns:
The confirmMode property value.
See Also:
setConfirmMode(boolean)

getConversationHandler

public ConversationHandler getConversationHandler()

Gets the conversationHandler property (ConversationHandler) value. This attribute points to the default ConversationHandler class.

Returns:
The conversationHandler property value.

getConversationId

public java.lang.String getConversationId()

Gets the conversationId property (char[]) value. This is the identifier for the conversation. It is used by subsequent CPI-C calls.

Specified by:
getConversationId in interface Lu62ConversationService
Returns:
The conversationId property value.
See Also:
#setConversationId

getConversationStatus

public java.lang.String getConversationStatus()

Gets the conversationStatus property (java.lang.String) value.It has the value of Conversation Status, the valid values are:

Specified by:
getConversationStatus in interface Lu62ConversationService
Returns:
The conversationStatus property value.

getEstablishConversationRetries

public int getEstablishConversationRetries()
Gets the establishConversationRetries property (int) value. If it is negative, it means that session will retry to establish itself forever, otherwise this property says how many times it will establish itself.
Returns:
The establishConnectionRetries property value.
See Also:
setEstablishConversationRetries(int)

getFlushMode

public boolean getFlushMode()

Gets the flushMode property (boolean) value. If flushMode is true, every time the application wants to send data to partner, this data is stored in buffers, which are automatically flushed, so that these data are inmediately sent to partner.

This method could be useful in some cases; however, it is not highly recommended, since it can affect the workstation and network performance.

Returns:
The flushMode property value.
See Also:
setFlushMode(boolean)

getInUse

public boolean getInUse()

Gets the inUse property (boolean) value. If true, if this instance is in use.

Specified by:
getInUse in interface Lu62ConversationService
Returns:
The inUse property value.
See Also:
setInUse(boolean)

getLevel

public static java.lang.String getLevel()
                                 throws DSEException
This method returns the WrapperLU62 version.
Returns:
java.lang.String

getLu62Message

public Lu62Message getLu62Message()

Gets the lu62Message property (Lu62Message) value. This attribute points to the default Lu62Message class.

Returns:
The lu62Message property value.

getLUName

public java.lang.String getLUName()

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

Returns:
The LUName property value.
See Also:
setLUName(java.lang.String)

getManageResponses

public boolean getManageResponses()

Gets the manageResponses property (boolean) value. If manageResponses is true, the client application has to send a response to each message received. If manageResponses is false, the client application can not send responses to received messages.

Returns:
The manageResponses property value.
See Also:
setManageResponses(boolean)

getOutgoing

public boolean getOutgoing()

Gets the outgoing property (boolean) value. If true, Lu62Conversation requests to allocate a conversation using a contention winner session (the one that has to wait for data right after session setup - RECEIVE state). If false ,Lu62Conversation requests to allocate a conversation using a contention losser session (the one that has to wait for data right after session setup - SEND state).

Returns:
The symbolicDestinationName property value.
See Also:
setOutgoing(boolean)

getSymbolicDestinationName

public java.lang.String getSymbolicDestinationName()

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

This parameter specifies the symbolic destination name -the name associated with a side information entry loaded from the CS configuration file .

Returns:
The symbolicDestinationName property value.
See Also:
setSymbolicDestinationName(java.lang.String)

getSynchronousMode

public boolean getSynchronousMode()

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

Returns:
The confirmMode property value.
See Also:
setConfirmMode(boolean)

getTimeBetweenRetries

public int getTimeBetweenRetries()
Gets the timeBetweenRetries property (int) value. It is the time (specified in seconds in services sgml file but stored in milisecons) between each unsuccessful try to establish session.
Returns:
The timeBetweenRetries property value.
See Also:
setTimeBetweenRetries(int)

getTpName

public java.lang.String getTpName()

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

Returns:
The tpName property value.
See Also:
setTpName(java.lang.String)

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 EstablishConnectionSessionCounter property to its default value.

initializeFrom

public java.lang.Object initializeFrom(Tag aTag)
                                throws java.io.IOException,
                                       DSEException
Actualizes all attributes that are defined in SGML files. If automaticConversationEstablishment is true, the establishConversation is issued.
Overrides:
initializeFrom in class Service
Parameters:
aTag - com.ibm.dse.base.Tag
Returns:
java.lang.Object

initInstance

public void initInstance()
                  throws DSELu62InternalErrorException,
                         DSELu62InvalidRequestException

Initiates all handlers that have a default treatment. It will also create the listenThread.

Specified by:
initInstance in interface Lu62ConversationService

isFree

public boolean isFree()

Returns if the session is free

Returns:
boolean

isOffline

public boolean isOffline()

Returns if the session is offline

Returns:
boolean

lu62SendReceive

protected Lu62Message lu62SendReceive(java.lang.String aString,
                                      long aTimeout)
Send aString to communcication services, and wait aTimeout to receive the data
Parameters:
aString - java.lang.String
aTimeout - long

peekData

public Lu62Message peekData()
Returns the Lu62Message received, without reading it.
Specified by:
peekData in interface Lu62ConversationService
Returns:
com.ibm.dse.services.Lu62Message

readData

public Lu62Message readData()
                     throws DSEException
Returns the Lu62Message received.
Specified by:
readData in interface Lu62ConversationService
Returns:
com.ibm.dse.services.Lu62Message

readData

public Lu62Message readData(long timeout)
                     throws DSEException
Returns the Lu62Message received.
Specified by:
readData in interface Lu62ConversationService
Returns:
com.ibm.dse.services.Lu62Message

readData

public Lu62Message readData(Context aContext,
                            FormatElement aFormat)
                     throws DSEException
Specified by:
readData in interface Lu62ConversationService
Parameters:
aContext - com.ibm.dse.base.Context
aFormat - com.ibm.dse.base.FormatElement
Returns:
com.ibm.dse.services.Lu62Message

readData

public Lu62Message readData(Context aContext,
                            java.lang.String aFormatName)
                     throws DSEException
Returns the Lu62Message received.
Specified by:
readData in interface Lu62ConversationService
Parameters:
aContext - com.ibm.dse.base.Context
aFormatName - java.lang.String
Returns:
com.ibm.dse.services.Lu62Message

receive

public void receive()
             throws DSEException

The receive call receives any data that is currently available from the partner program. This method should be call after a notification of data ready has been received.

See Also:
#CPIC_Receive

receiveAndRequestToSend

public Lu62Message receiveAndRequestToSend()
                                    throws DSEException
Specified by:
receiveAndRequestToSend in interface Lu62ConversationService
Returns:
com.ibm.dse.services.Lu62Message

removeConfirmedReceivedListener

public void removeConfirmedReceivedListener(ConfirmedReceivedListener newListener)
Generated to support the ConfirmedReceived event.
Specified by:
removeConfirmedReceivedListener in interface Lu62ConversationService
Parameters:
newListener - com.ibm.dse.services.comms.ConfirmedReceivedListener

removeConversationClosedListener

public void removeConversationClosedListener(ConversationClosedListener newListener)
Generated to support the ConversationClosed event.
Specified by:
removeConversationClosedListener in interface Lu62ConversationService
Parameters:
newListener - com.ibm.dse.services.comms.ConversationClosedListener

removeConversationDownListener

public void removeConversationDownListener(ConversationDownListener newListener)
Generated to support the ConversationDown event.
Specified by:
removeConversationDownListener in interface Lu62ConversationService
Parameters:
newListener - com.ibm.dse.services.comms.ConversationDownListener

removeConversationEstablishedListener

public void removeConversationEstablishedListener(ConversationEstablishedListener newListener)
Generated to support the ConversationEstablished event.
Specified by:
removeConversationEstablishedListener in interface Lu62ConversationService
Parameters:
newListener - com.ibm.dse.services.comms.ConversationEstablishedListener

removeConversationNotEstablishedListener

public void removeConversationNotEstablishedListener(ConversationNotEstablishedListener newListener)
Generated to support the ConversationNotEstablished event.
Specified by:
removeConversationNotEstablishedListener in interface Lu62ConversationService
Parameters:
newListener - com.ibm.dse.services.comms.ConversationNotEstablishedListener

removeDataCancelledListener

public void removeDataCancelledListener(DataCancelledListener newListener)
Generated to support the DataCancelled event.
Specified by:
removeDataCancelledListener in interface Lu62ConversationService
Parameters:
newListener - com.ibm.dse.services.comms.DataCancelledListener

removeDataListener

public void removeDataListener(DataListener newListener)
Generated to support the Data event.
Specified by:
removeDataListener in interface Lu62ConversationService
Parameters:
newListener - com.ibm.dse.services.comms.DataListener

removeErrorReceivedListener

public void removeErrorReceivedListener(ErrorReceivedListener newListener)
Generated to support the ErrorReceived event.
Specified by:
removeErrorReceivedListener in interface Lu62ConversationService
Parameters:
newListener - com.ibm.dse.services.comms.ErrorReceivedListener

send

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

Puts data in the local LU's send buffer for transmission to the partner program.

If flushMode enabled then the data is flushed at this moment.

If confirmMode data is flushed at this time and a confirmation is asked to the partner lu.

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

send

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

Puts data in the local LU's send buffer for transmission to the partner program.

If flushMode enabled then the data is flushed at this moment.

If confirmMode data is flushed at this time and a confirmation is asked to the partner lu.

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

send

public void send(java.lang.String aMessage)
          throws DSELu62InternalErrorException,
                 DSELu62InvalidRequestException

Puts data in the local LU's send buffer for transmission to the partner program.

If flushMode enabled then the data is flushed at this moment.

If confirmMode data is flushed at this time and a confirmation is asked to the partner lu.

Specified by:
send in interface Lu62ConversationService
Parameters:
aMessage - The message to send.

sendAndPrepareToReceive

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

Causes data to be sent , with the SEND indicator to the remote LU, witch enters the local LU in RECEIVE state.

Specified by:
sendAndPrepareToReceive in interface Lu62ConversationService
Parameters:
aMessage - The message to send.
See Also:
send(com.ibm.dse.base.Context, com.ibm.dse.base.FormatElement)

sendAndPrepareToReceive

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

Causes data to be sent , with the SEND indicator to the remote LU, witch enters the local LU in RECEIVE state.

Specified by:
sendAndPrepareToReceive in interface Lu62ConversationService
Parameters:
aMessage - The message to send.
See Also:
send(com.ibm.dse.base.Context, com.ibm.dse.base.FormatElement)

sendAndPrepareToReceive

public void sendAndPrepareToReceive(java.lang.String aMessage)
                             throws DSELu62InternalErrorException,
                                    DSELu62InvalidRequestException

Causes data to be sent , with the SEND indicator to the remote LU, witch enters the local LU in RECEIVE state.

Specified by:
sendAndPrepareToReceive in interface Lu62ConversationService
Parameters:
aMessage - The message to send.
See Also:
send(com.ibm.dse.base.Context, com.ibm.dse.base.FormatElement)

sendCancel

public void sendCancel(java.lang.String aMessage)
                throws DSELu62InternalErrorException,
                       DSELu62InvalidRequestException
Cancels the current block of data by sending an error indication to the remote LU and keeping the local LU in a SEND state.
Specified by:
sendCancel in interface Lu62ConversationService
Parameters:
aMessage - The message to send.

sendConfirmed

public void sendConfirmed()
                   throws DSELu62InternalErrorException,
                          DSELu62InvalidRequestException

Replies to a confirmation request from the partner program. It informs the partner program that the local program has not detected an error in the received data.

Specified by:
sendConfirmed in interface Lu62ConversationService

sendError

public void sendError()
               throws DSELu62InternalErrorException,
                      DSELu62InvalidRequestException
Notifies the partner program that the local program has encountered an application-level error. The local program can use the sendError for such purposes as informing the partner program of an error encountered in received data, rejecting a confirmation request, or truncating an incomplete logical record it is sending.
Specified by:
sendError in interface Lu62ConversationService

sendReceive

protected CCMessage sendReceive(java.lang.String aString,
                                long aTimeout)
Send aString to communcication services, and wait aTimeout to receive the data
Parameters:
aString - java.lang.String
aTimeout - long

setAutomaticConversationEstablishment

public void setAutomaticConversationEstablishment(boolean anAutomaticConversationEstablishment)

Sets the automaticConversationEstablishment property (boolean) value.

Specified by:
setAutomaticConversationEstablishment in interface Lu62ConversationService
Parameters:
anAutomaticConversationEstablishment - The new value for the property.
See Also:
getAutomaticConversationEstablishment()

setConfirmMode

public void setConfirmMode(boolean aConfirmMode)

Sets the confirmMode property (boolean) value.

Specified by:
setConfirmMode in interface Lu62ConversationService
Parameters:
aConfirmMode - The new value for the property.
See Also:
getConfirmMode()

setEstablishConversationRetries

public void setEstablishConversationRetries(int establishConversationRetries)
Sets the establishConversationRetries property (int) value.
Parameters:
establishSessionRetries - The new value for the property.
See Also:
getEstablishConversationRetries()

setFlushMode

public void setFlushMode(boolean aFlushMode)

Sets the flushMode property (boolean) value.

Specified by:
setFlushMode in interface Lu62ConversationService
Parameters:
aFlushMode - The new value for the property.
See Also:
getFlushMode()

setInUse

public void setInUse(boolean anInUse)

Sets the inUse property (boolean) value.

Specified by:
setInUse in interface Lu62ConversationService
Parameters:
anInUse - The new value for the property.
See Also:
getInUse()

setLU_Name

public void setLU_Name(java.lang.String aLUName)
                throws DSELu62InternalErrorException,
                       DSELu62InvalidRequestException

Issued by the invoking program to specify the local LU for a conversation. initializeConversation call was issued.

This call cannot be issued after the allocate call has been issued.

Parameters:
aTPName - java.lang.String

setLUName

public void setLUName(java.lang.String aLUName)
               throws DSELu62InternalErrorException,
                      DSELu62InvalidRequestException

Issued by the invoking program to specify the local LU for a conversation. initializeConversation call was issued.

This call cannot be issued after the allocate call has been issued.

Specified by:
setLUName in interface Lu62ConversationService
Parameters:
aTPName - java.lang.String

setManageResponses

public void setManageResponses(boolean aManageResponses)

Sets the manageResponses property (boolean) value.

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

setOutgoing

public void setOutgoing(boolean aOutgoing)

Sets the outgoing property (boolean) value.

Specified by:
setOutgoing in interface Lu62ConversationService
Parameters:
aOutgoing - The new value for the property.
See Also:
getOutgoing()

setPassword

public void setPassword(java.lang.String aPass)

Issued by the invoking program to specify the password. The partner LU uses this value and the user id to verify the identity of the end user that initiated the allocation request.

Parameters:
aUserId - java.lang.String

setSendType

public void setSendType(int aSendType)
                 throws DSELu62InternalErrorException,
                        DSELu62InvalidRequestException

Specifies how data will be sent by the next send call. The default send type is CM_BUFFER_DATA, indicating that data only (and no control information) is to be sent.

Parameters:
aSendType - (int).

the valid values are:

  • CM_BUFFER_DATA: The data pointed to by the send call is stored in a buffer until the buffer fills up or is flushed.
  • CM_SEND_AND_FLUSH: The data pointed to by the send call is to be sent immediately. This is equivalent to send, with the send_type set to CM_BUFFER_DATA, followed by flush.
  • CM_SEND_AND_CONFIRM: The data is to be sent immediately with a request for confirmation. This is equivalent to send, with the send_type set to CM_BUFFER_DATA, followed by Confirm.
  • CM_SEND_AND_PREP_TO_RECEIVE: The data is to be sent immediately along with notification to the partner program that the conversation state for the sending program is changing to RECEIVE. This is equivalent to send, with the send_type set to CM_BUFFER_DATA, followed by prepareToReceive.
  • CM_SEND_AND_DEALLOCATE: The data is to be sent immediately along with deallocation notification. This is equivalent to send, with the send_type set to CM_BUFFER_DATA, followed by Deallocate.

setSymbolicDestinationName

public void setSymbolicDestinationName(java.lang.String aSymbolicDestinationName)

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

Specified by:
setSymbolicDestinationName in interface Lu62ConversationService
Parameters:
aSymbolicDestinationName - The new value for the property.
See Also:
getSymbolicDestinationName()

setSynchronousMode

public void setSynchronousMode(boolean aSynchronousMode)

Sets the synchronousMode property (boolean) value.

Specified by:
setSynchronousMode in interface Lu62ConversationService
Parameters:
aSynchronousMode - The new value for the property.
See Also:
getSynchronousMode()

setTimeBetweenRetries

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

setTpName

public void setTpName(java.lang.String aTpName)

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

Specified by:
setTpName in interface Lu62ConversationService
Parameters:
aTpName - The new value for the property.
See Also:
getTpName()

setUserId

public void setUserId(java.lang.String aUserId)

Issued by the invoking program to specify the user ID. The partner LU uses this value and the password to verify the identity of the end user that initiated the allocation request.

Parameters:
aUserId - java.lang.String

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 DSELu62InternalErrorException
Terminates the conversation. This method terminates the internal thread and closes the conversation ABNORMALY if needed (if in RECEIVE state).
Specified by:
terminate in interface Lu62ConversationService
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.

unregister

protected void unregister()
                   throws DSELu62InternalErrorException

Unregisters conversations already registered for allocate.