IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

com.ibm.btt.services.mq
Class MQConnection

java.lang.Object
  extended by com.ibm.btt.base.BTTProcessorNotifier
      extended by com.ibm.btt.base.Service
          extended by com.ibm.btt.services.mq.MQConnection
All Implemented Interfaces:
ProcessorNotifier, CommonCommunicationsService, MQConnectionService, java.io.Externalizable, java.io.Serializable, java.lang.Runnable

public class MQConnection
extends Service
implements java.lang.Runnable, MQConnectionService

This class maps an MQ connection to a MQManager with the defined queues.

See Also:
Serialized Form

Field Summary
protected  QueueListener aQueueListener
           
 java.lang.String channelQName
          The Channel Reply Queue name.
static java.lang.String COMPID
           
static java.lang.String DATA
           
static java.lang.String DEADLETTERQ
          DeadLetter Queue representation field.
 java.lang.String deadLetterQName
          The DeadLetter Queue name.
 MqDeadLetterQueueThread deadLetterQueueThread
          MqDeadLetterQueueThread field.
static java.lang.reflect.Field encode
           
protected  Hashtable eventParameter
           
protected  Hashtable eventParameterD
           
protected  java.lang.String EXCEPTION
           
protected  com.ibm.mq.MQGetMessageOptions gmo
           
protected  boolean isDeadLetterThreadAlive
           
static java.lang.String LISTEN_THREAD
          Listen Thread representation field.
protected  Hashtable messageQTable
           
protected  Hashtable messageTable
           
 java.lang.String QMgrName
          The QueueManager name.
static java.lang.String QMGRNAME
           
static java.lang.String QUEUE
           
protected  int receiveReturnCode
           
 Semaphore receiveSem
          The receiver semaphore.
 java.lang.String ReplyDynamicQName
           
 java.lang.String ReplyModelQName
           
protected  boolean ReplyQueueAccessed
           
static java.lang.String REPLYTOQ
           
 java.lang.String ReplyToQName
          The Reply Queue name.
protected  com.ibm.mq.MQQueue ReplyToQueue
           
static java.lang.String RESET
           
 java.lang.String SendDynamicQName
           
 java.lang.String SendModelQName
           
protected  boolean SendQueueAccessed
           
static java.lang.String SENDTOQ
           
 java.lang.String SendToQName
          The Send Queue name.
protected  com.ibm.mq.MQQueue SendToQueue
           
protected  com.ibm.mq.MQMessage tempMqMessage
           
 
Fields inherited from class com.ibm.btt.base.Service
externalizer, name
 
Fields inherited from class com.ibm.btt.base.BTTProcessorNotifier
handlersList
 
Fields inherited from interface com.ibm.btt.services.mq.MQConnectionService
CODEPAGE, DSEUSER, MQ_CHANNEL_NAME_LENGTH, MQCACH_CHANNEL_NAME, MQCC_OK, MQCCSI_DEFAULT, MQCFC_LAST, MQCFH_STRUC_LENGTH, MQCFH_VERSION_1, MQCFIN_STRUC_LENGTH, MQCFST_STRUC_LENGTH_FIXED, MQCFT_COMMAND, MQCFT_INTEGER, MQCFT_STRING, MQCHS_BINDING, MQCHS_INACTIVE, MQCHS_INITIALIZING, MQCHS_PAUSED, MQCHS_REQUESTING, MQCHS_RETRYING, MQCHS_RUNNING, MQCHS_STARTING, MQCHS_STOPPED, MQCHS_STOPPING, MQCMD_INQUIRE_CHANNEL_STATUS, MQCMD_RESET_CHANNEL, MQCMD_START_CHANNEL, MQCMD_STOP_CHANNEL, MQIACH_CHANNEL_STATUS, MQIACH_MSG_SEQUENCE_NUMBER, MQRC_NONE, MQRCCF_CHANNEL_IN_USE, NORC
 
Fields inherited from interface com.ibm.btt.services.comms.CommonCommunicationsService
CLOSED, DATASENT, ERROR, OPENED, RECEIVERC, TIMEOUT
 
Constructor Summary
MQConnection()
          Maintains a connection to a MQManager with the defined queues.
MQConnection(java.lang.String aName)
          Maintains a connection to a MQManager with the defined queues.
 
Method Summary
 void addQueueListener(QueueListener newListener)
          Adds a listener to the queue.
 void ccClose()
          Closes the communications channel and returns control immediately.
 void ccOpen()
          Opens the communications chanel and returns control immediately.
 CCMessage ccReceiveData(long aTimeout)
          Reads the data that has been received.
 void ccSendData(java.lang.String aString)
          Sends the data through the communications channel and returns control immediately.
 CCMessage ccSendReceive(java.lang.String aString, long aTimeout)
          Sends a String to the communication services and waits for to receive data until the timeout limit is exceeded.
 void closeConnection()
          Disconnects from the queue manager and removes the used queues.
 void disconnectQueueManager()
          Disconnects the queueManagers related to send, receive, channel, and DeadLetter operations.
 void establishConnection()
          Establishes a connection with an MQManager and opens the send and receive queues.
 void fireMessageReceived(QueueEvent event)
          Supports listener events.
 java.lang.String getAliasQueueManagerNameSend()
          Gets the aliasQueueManagerNameSend
 java.lang.String getApplicationName()
          Gets the applicationName property (java.lang.String) value.
 boolean getAutomaticConnectionEstablishment()
          Gets the automaticSessionEstablishment property (java.lang.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.
 int getCcsid()
           
 java.lang.String getchannelName()
          Gets the channel property (java.lang.String) value.
 int getChannelStatus(java.lang.String channelName)
          Returns the channel status from the inquired channel.
 int getCharSet()
          Gets the charSet property value.
 java.lang.String getDeadLetterQName()
          Gets the deadLetterQName property value.
 int getEncoding()
          Gets the encoding property value.
 int getEstablishConnectionRetries()
          Gets the establishConnectionRetries property value.
 int getExpiry()
          Gets the expiry property value.
 java.lang.String getFormat()
          Gets the format property value.
 com.ibm.mq.MQMessage getFromDeadLetterQueue()
          Gets a message from the DeadLetterQueue.
 com.ibm.mq.MQMessage getFromGetReplyQueue()
          Gets a message from the replyqueue.
 com.ibm.mq.MQMessage getFromGetReplyQueue(byte[] aCorrelationId)
          Gets a message with a correlation identifier ("aCorrelationId") from the reply queue.
 int getGetMessageOptionsOptions()
          Gets the get message options (int) value.
 java.lang.String getHostName()
          Gets the hostName property (java.lang.String) value.
 boolean getInUse()
          Gets the inUse property value.
 boolean getMatchCorrelationId()
          Gets the matchCorrelationId property value.
 int getMessageType()
          Gets the messageType property value.
 int getPersistence()
          Gets the persistence property value.
 int getPortNumber()
          Gets the port number(int) value.
 int getPutMessageOptionsOptions()
          Gets the put message options (int) value.
 java.lang.String getQmgrReply()
          Gets the QmgrReply property value.
 java.lang.String getQueueManagerName()
          Gets the queue manager name value.
 int getReceiveReturnCode()
          Gets the receiveReturnCode property value.
 java.lang.String getReplyDynamicQName()
          Gets the replyDynamicQName property value.
 java.lang.String getReplyToQName()
          Gets the replyToQName property value.
 int getReplyToQOpenOptions()
          Gets the ReplyToQ open options (int) value.
 java.lang.String getSendDynamicQName()
          Gets the SendDynamicQName property value.
 int getSendReturnCode()
          Gets the sendReturnCode property value.
 java.lang.String getSendToQName()
          Gets the sendToQName property value.
 int getSendToQOpenOptions()
           Gets the SendToQ open options value.
 boolean getServer()
          Gets the server property value.
 java.lang.String getStatus()
          connection status value.
 boolean getSynchronousMode()
          Gets the synchronousMode property value.
 int getTimeBetweenRetries()
          Gets the timeBetweenRetries property value.
 int getTimeout()
          Gets the timeout property value.
 java.lang.String getUserId()
          Gets the userId property value.
protected  void initializeCounter()
          Sets the EstablishConnectionSessionCounter property to its default value.
 java.lang.Object initializeFrom(Tag aTag)
          Actualizes all attributes that are defined in XML files.
 void initInstance()
          Initiates all handlers that have a default treatment.
 void initManagers()
          Initiates all handlers that have a default treatment.
 boolean isCloseMessage(java.lang.Object aMessage)
          Checks if close Message has been received.
 boolean isDeadLetterQReset()
          Checks whether the DeadLetter queue manager is open.
 boolean isFree()
          Returns whether the session is free.
 boolean isOffline()
          Returns whether the session is offline.
 boolean isResetStatus()
          
 int parseInt(java.lang.String param)
          Parses the input string into its associated MQ code.
 byte[] putToPutSendQueue(com.ibm.mq.MQMessage aMessage)
          Puts aMessage (an MQMessage) into the putSendQueue and returns the correlation identifier for this message.
 byte[] putToPutSendQueue(java.lang.String aData)
          Puts an MQMessage into the putSendQueue, creates the aData and message default options, and returns the correlation ID of this message.
protected  void receive()
          Performs the receive method used by thread listeners when working in asynchronous mode.
 java.lang.Object receive(byte[] aCorrelationId)
          Performs the receive method.
 java.lang.Object receive(byte[] aCorrelationId, long aTimeout)
          Performs the receive method.
 void receiveFromDeadLetterQueue()
           Performs the receive method, which is used by listen threads when it is working in asynchronous mode
 void removeQueueListener(QueueListener newListener)
          Removes queue listener.
 int resetChannel(java.lang.String channelName)
          Resets the message sequence number for a channel.
 int resetChannel(java.lang.String channelName, int msgSeqNumber)
          Resets the message sequence number for a channel to a specified value.
 DSECCException returnException(java.lang.Exception e)
          Maps the MQException to the DSECCException.
 java.lang.String returnStringFromMessage(java.lang.Object aMessage)
          Obtains the msgText(String) from a MQMessage.
 void run()
          Runs the listener for messages.
 byte[] send(Context aContext, FormatElement aFormat)
          Performs the send method.
 byte[] send(Context aContext, java.lang.String aFormatName)
          Performs the send method.
 byte[] send(java.lang.Object inputMessage)
          Performs the send method.
 byte[] send(java.lang.String inputMessage)
          Performs the send method.
 void setAliasQueueManagerNameSend(java.lang.String aliasQueueManagerNameSend)
          Sets the aliasQueueManagerNameSend
 void setApplicationName(java.lang.String newApplicationName)
          Sets the applicationName property (java.lang.String) value.
 void setAutomaticConnectionEstablishment(boolean automaticEstablishment)
          Sets the automaticConnectionEstablishment property (boolean) value.
 void setCcsid(int ccsid)
           
 void setChannelName(java.lang.String chname)
          Sets the Channel property (java.lang.String) value.
 void setCharSet(int newCharSet)
          Sets the charSet property value.
 void setDeadLetterMessageOptionsMatchOptions(int options)
          Sets DeadLetterQueue match Options property (MQGetMessageOptions) value.
 void setDeadLetterMessageOptionsWaitInterval(int options)
          Sets DeadLetterQueue option waitInterval property (MQGetMessageOptions) value.
 void setDeadLetterQName(java.lang.String dlname)
          Sets the deadLetterQName property (java.lang.String) value.
 void setEncoding(int newEncoding)
          Sets the encoding property value.
 void setEstablishConnectionRetries(int establishConnectionRetries)
          Sets the establishSessionRetries property (int) value.
 void setExpiry(int newExpiry)
          Sets the expiry property value.
 void setFormat(java.lang.String newFormat)
          Sets the format property (java.lang.String) value.
 void setGetMessageOptionsMatchOptions(int options)
          Sets GetMessageOptions match Options property (MQGetMessageOptions) value.
 void setGetMessageOptionsOptions(int options)
          Sets GetMessageOptions Options field property (int) value.
 void setGetMessageOptionsWaitInterval(int options)
          Sets GetMessageOptions WaitInterval field property (MQGetMessageOptions) value.
 void setHostName(java.lang.String hname)
          Sets the Host name property (java.lang.String) value.
 void setInUse(boolean anInUse)
          Sets the inUse property (boolean) value.
 void setMatchCorrelation(boolean newValue)
          Sets the matchCorrelation property (boolean) value.
 void setMessageType(int newMessageType)
          Sets the messageType property value.
 void setPersistence(int newPersistence)
          Sets the persistence property value.
 void setPortNumber(int pnum)
          Sets the Port number property (int) value.
 void setPutMessageOptionsOptions(int options)
          Sets PutMessageOptions Options field property (int) value.
 void setQmgrName(java.lang.String qmgrname)
          Sets the QMgrName property (java.lang.String) value.
 void setQmgrReply(java.lang.String newQmgrReply)
          Sets the QmgrReply property (java.lang.String) value.
 void setReplyDynamicQName(java.lang.String rqname)
          Sets the ReplyDynamicQName property (java.lang.String) value.
 void setReplyQName(java.lang.String rqname)
          Sets the ReplyToQName property (java.lang.String) value.
 void setReplyToQOpenOptions(int options)
          Sets ReplyToQOpenOptions field property (int) value.
 void setSendDynamicQName(java.lang.String sqname)
          Sets the SendDynamicQName property (java.lang.String) value.
 void setSendQName(java.lang.String sqname)
          Sets the SendToQName property (java.lang.String) value.
 void setSendToQOpenOptions(int options)
          Sets SendToQOpenOptions field property (int) value.
 void setServer(boolean aBoolean)
          Sets the server property (boolean) value.
 void setSynchronousMode(boolean aSynchronousMode)
          Sets the synchronousMode property (boolean) value.
 void setTimeBetweenRetries(int timeBetweenRetries)
          Sets the timeBetweenRetries property (int) value.
 void setTimeout(int newTimeout)
          Sets the timeout property value.
 void setUserId(java.lang.String newUserId)
          Sets the userId property (java.lang.String) value.
 int startChannel(java.lang.String channelName)
          Starts the specified channel.
 int stopChannel(java.lang.String channelName)
          Stops the specified channel.
 void terminate()
          Terminates the conversation.
 java.lang.String toString()
          Returns a visual representation of this object.
 
Methods inherited from class com.ibm.btt.base.Service
externalizer, getExternalizer, getTagName, readExternal, readExternal, readObject, removeExternal, setExternalizer, toStrings, toTags, writeExternal, writeExternal
 
Methods inherited from class com.ibm.btt.base.BTTProcessorNotifier
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
 
Methods inherited from interface com.ibm.btt.base.ProcessorNotifier
addHandler, getHandlersList, getName, removeHandler, setName, signalEvent, signalEvent
 
Methods inherited from interface com.ibm.btt.base.Externalizable
getName, setName
 

Field Detail

COMPID

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

SendToQueue

protected com.ibm.mq.MQQueue SendToQueue

ReplyToQueue

protected com.ibm.mq.MQQueue ReplyToQueue

gmo

protected com.ibm.mq.MQGetMessageOptions gmo

receiveSem

public Semaphore receiveSem
The receiver semaphore.


LISTEN_THREAD

public static final java.lang.String LISTEN_THREAD
Listen Thread representation field.

See Also:
Constant Field Values

DEADLETTERQ

public static final java.lang.String DEADLETTERQ
DeadLetter Queue representation field.

See Also:
Constant Field Values

aQueueListener

protected transient QueueListener aQueueListener

receiveReturnCode

protected int receiveReturnCode

ReplyQueueAccessed

protected boolean ReplyQueueAccessed

SendQueueAccessed

protected boolean SendQueueAccessed

tempMqMessage

protected com.ibm.mq.MQMessage tempMqMessage

eventParameter

protected Hashtable eventParameter

eventParameterD

protected Hashtable eventParameterD

messageTable

protected Hashtable messageTable

messageQTable

protected Hashtable messageQTable

EXCEPTION

protected java.lang.String EXCEPTION

QMgrName

public java.lang.String QMgrName
The QueueManager name. The value is externalized in the XML files.


SendToQName

public java.lang.String SendToQName
The Send Queue name. The value is externalized in the XML files.


ReplyToQName

public java.lang.String ReplyToQName
The Reply Queue name. The value is externalized in the XML files.


channelQName

public java.lang.String channelQName
The Channel Reply Queue name. The value must be externalized in the XML files.


deadLetterQName

public java.lang.String deadLetterQName
The DeadLetter Queue name.


ReplyDynamicQName

public java.lang.String ReplyDynamicQName

ReplyModelQName

public java.lang.String ReplyModelQName

SendDynamicQName

public java.lang.String SendDynamicQName

SendModelQName

public java.lang.String SendModelQName

deadLetterQueueThread

public MqDeadLetterQueueThread deadLetterQueueThread
MqDeadLetterQueueThread field.


RESET

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

DATA

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

QUEUE

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

QMGRNAME

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

SENDTOQ

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

REPLYTOQ

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

encode

public static java.lang.reflect.Field encode

isDeadLetterThreadAlive

protected boolean isDeadLetterThreadAlive
Constructor Detail

MQConnection

public MQConnection()
Maintains a connection to a MQManager with the defined queues.


MQConnection

public MQConnection(java.lang.String aName)
             throws java.io.IOException
Maintains a connection to a MQManager with the defined queues.

Parameters:
aName - java.lang.String
Throws:
java.io.IOException - .
Method Detail

addQueueListener

public void addQueueListener(QueueListener newListener)
Adds a listener to the queue.

Specified by:
addQueueListener in interface MQConnectionService
Parameters:
newListener - com.ibm.btt.services.mq.QueueListener

ccClose

public void ccClose()
             throws DSECCException
Closes the communications channel and returns control immediately. If the communications channel was started correctly, the method signals the ChannelClosed event.

Specified by:
ccClose in interface CommonCommunicationsService
Parameters:
aString - java.lang.String
Throws:
DSECCException - .

ccOpen

public void ccOpen()
            throws DSECCException
Opens the communications chanel and returns control immediately. If the communications channel starts correctly, the method signals the ChannelOpened event.

Specified by:
ccOpen in interface CommonCommunicationsService
Throws:
DSECCException - .

ccReceiveData

public CCMessage ccReceiveData(long aTimeout)
                        throws DSECCException
Reads the data that has been received. If the data is not ready, the method waits until the timeout limit is exceeded.

Specified by:
ccReceiveData in interface CommonCommunicationsService
Parameters:
aTimeout - long
Throws:
DSECCException.
DSECCException

ccSendData

public void ccSendData(java.lang.String aString)
                throws DSECCException
Sends the data through the communications channel and returns control immediately. When this method receives a response, it signals one of two events: DataReceived event (when it received data) or ErrorReceived(when it received an error).

Specified by:
ccSendData in interface CommonCommunicationsService
Parameters:
aString - java.lang.String
Throws:
DSECCException

ccSendReceive

public CCMessage ccSendReceive(java.lang.String aString,
                               long aTimeout)
                        throws DSECCException
Sends a String to the communication services and waits for to receive data until the timeout limit is exceeded.

Specified by:
ccSendReceive in interface CommonCommunicationsService
Parameters:
aString - java.lang.String
aTimeout - long
Throws:
DSECCException

closeConnection

public void closeConnection()
                     throws com.ibm.mq.MQException
Disconnects from the queue manager and removes the used queues.

Specified by:
closeConnection in interface MQConnectionService
Throws:
com.ibm.mq.MQException.
com.ibm.mq.MQException

disconnectQueueManager

public void disconnectQueueManager()
                            throws com.ibm.mq.MQException
Disconnects the queueManagers related to send, receive, channel, and DeadLetter operations.

Throws:
com.ibm.mq.MQException

establishConnection

public void establishConnection()
                         throws com.ibm.mq.MQException
Establishes a connection with an MQManager and opens the send and receive queues.

Specified by:
establishConnection in interface MQConnectionService
Throws:
com.ibm.mq.MQException

fireMessageReceived

public void fireMessageReceived(QueueEvent event)
Supports listener events.

Specified by:
fireMessageReceived in interface MQConnectionService
Parameters:
event - com.ibm.btt.services.mq.QueueEvent

getAliasQueueManagerNameSend

public java.lang.String getAliasQueueManagerNameSend()
Gets the aliasQueueManagerNameSend

Returns:
Returns a String

getApplicationName

public java.lang.String getApplicationName()
Gets the applicationName property (java.lang.String) value.

Returns:
java.lang.String
See Also:
setApplicationName(java.lang.String)

getAutomaticConnectionEstablishment

public boolean getAutomaticConnectionEstablishment()
Gets the automaticSessionEstablishment property (java.lang.Boolean) value.

Specified by:
getAutomaticConnectionEstablishment in interface MQConnectionService
Returns:
- The automaticSessionEstablishment property value
See Also:
#setAutomaticSessionEstablishment

getCcClosedEventName

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

Specified by:
getCcClosedEventName in interface CommonCommunicationsService

getCcDataReceivedEventName

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

Specified by:
getCcDataReceivedEventName in interface CommonCommunicationsService

getCcErrorReceivedEventName

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

Specified by:
getCcErrorReceivedEventName in interface CommonCommunicationsService

getCcOpenedEventName

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

Specified by:
getCcOpenedEventName in interface CommonCommunicationsService

getchannelName

public java.lang.String getchannelName()
Gets the channel property (java.lang.String) value.

Returns:
- The channel property value

getChannelStatus

public int getChannelStatus(java.lang.String channelName)
                     throws com.ibm.mq.MQException
Returns the channel status from the inquired channel.

Parameters:
channelName - - The name of the inquired channel
Throws:
com.ibm.mq.MQException.
com.ibm.mq.MQException

getCharSet

public int getCharSet()
Gets the charSet property value.

Returns:
int
See Also:
setCharSet(int)

getDeadLetterQName

public java.lang.String getDeadLetterQName()
Gets the deadLetterQName property value.

Specified by:
getDeadLetterQName in interface MQConnectionService
Returns:
- The deadLetterQName property value

getEncoding

public int getEncoding()
Gets the encoding property value.

Returns:
int
See Also:
setEncoding(int)

getEstablishConnectionRetries

public int getEstablishConnectionRetries()
Gets the establishConnectionRetries property value. If it is negative, the session tries to reestablish the connection an unlimited number of times. Otherwise, the number of attempts is limited to the value of this property.

Returns:
- The establishConnectionRetries property value
See Also:
setEstablishConnectionRetries(int)

getExpiry

public int getExpiry()
Gets the expiry property value.

Returns:
int
See Also:
setExpiry(int)

getFormat

public java.lang.String getFormat()
Gets the format property value.

Returns:
java.lang.String
See Also:
setFormat(java.lang.String)

getFromDeadLetterQueue

public com.ibm.mq.MQMessage getFromDeadLetterQueue()
                                            throws com.ibm.mq.MQException
Gets a message from the DeadLetterQueue.

Returns:
the MQMessage read
Throws:
com.ibm.mq.MQException

getFromGetReplyQueue

public com.ibm.mq.MQMessage getFromGetReplyQueue()
                                          throws com.ibm.mq.MQException,
                                                 java.io.IOException
Gets a message from the replyqueue.

Returns:
the MQMessage read.
Throws:
MQException.
com.ibm.mq.MQException
java.io.IOException

getFromGetReplyQueue

public com.ibm.mq.MQMessage getFromGetReplyQueue(byte[] aCorrelationId)
                                          throws com.ibm.mq.MQException,
                                                 java.io.IOException
Gets a message with a correlation identifier ("aCorrelationId") from the reply queue.

Returns:
- The MQMessage
Throws:
com.ibm.mq.MQException
java.io.IOException

getGetMessageOptionsOptions

public int getGetMessageOptionsOptions()
Gets the get message options (int) value.

Returns:
- The GetMessageOptions value

getHostName

public java.lang.String getHostName()
Gets the hostName property (java.lang.String) value.

Returns:
- The hostName property value

getInUse

public boolean getInUse()
Gets the inUse property value.

Returns:
- Returns true if the instance is in use
See Also:
setInUse(boolean)

getMatchCorrelationId

public boolean getMatchCorrelationId()
Gets the matchCorrelationId property value. If true, the service matches the message correlation identifier on the receive method. If false, the service uses message identifier as the selection match criteria.

Returns:
boolean - The matchCorrelationId property value
See Also:
#setmatchCorrelationId

getMessageType

public int getMessageType()
Gets the messageType property value.

Returns:
int
See Also:
setMessageType(int)

getPersistence

public int getPersistence()
Gets the persistence property value.

Returns:
int
See Also:
setPersistence(int)

getPortNumber

public int getPortNumber()
Gets the port number(int) value.

Returns:
The port value

getPutMessageOptionsOptions

public int getPutMessageOptionsOptions()
Gets the put message options (int) value.

Returns:
The putMessageOptions value

getQmgrReply

public java.lang.String getQmgrReply()
Gets the QmgrReply property value.

Returns:
java.lang.String
See Also:
setQmgrReply(java.lang.String)

getQueueManagerName

public java.lang.String getQueueManagerName()
Gets the queue manager name value.

Returns:
- The Queue manager name value

getReceiveReturnCode

public int getReceiveReturnCode()
Gets the receiveReturnCode property value.

Returns:
int

getReplyDynamicQName

public java.lang.String getReplyDynamicQName()
Gets the replyDynamicQName property value.

Returns:
- The replyDynamicQName property value

getReplyToQName

public java.lang.String getReplyToQName()
Gets the replyToQName property value.

Returns:
- The replyToQName property value

getReplyToQOpenOptions

public int getReplyToQOpenOptions()
Gets the ReplyToQ open options (int) value.

Returns:
- The ReplyToQOpenOptions value

getSendDynamicQName

public java.lang.String getSendDynamicQName()
Gets the SendDynamicQName property value.

Returns:
- The SendDynamicQName property value

getSendReturnCode

public int getSendReturnCode()
Gets the sendReturnCode property value.

Returns:
int

getSendToQName

public java.lang.String getSendToQName()
Gets the sendToQName property value.

Returns:
- The sendToQName property value

getSendToQOpenOptions

public int getSendToQOpenOptions()

Gets the SendToQ open options value.

Returns:
- The SendToQOpenOptions value

getServer

public boolean getServer()
Gets the server property value.

Returns:
- The automaticSessionEstablishment property value

getStatus

public java.lang.String getStatus()
connection status value. The possible values are:
  • RESET : not connected
  • OPENED : connected and open

Specified by:
getStatus in interface MQConnectionService
Returns:
- The sessionStatus property value
See Also:
#setSessionStatus

getSynchronousMode

public boolean getSynchronousMode()
Gets the synchronousMode property value. If the synchronousMode is true, the method does not signal an event or Java event.

Returns:
- The confirmMode property value
See Also:
#setConfirmMode

getTimeBetweenRetries

public int getTimeBetweenRetries()
Gets the timeBetweenRetries property value. It is the time (specified in seconds in services XML file but stored in milliseconds) between each unsuccessful attempt to establish session.

Returns:
- The timeBetweenRetries property value
See Also:
setTimeBetweenRetries(int)

getTimeout

public int getTimeout()

Gets the timeout property value.

Returns:
int
See Also:
setTimeout(int)

getUserId

public java.lang.String getUserId()
Gets the userId property value.

Returns:
java.lang.String
See Also:
setUserId(java.lang.String)

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 XML files. If automaticConversationEstablishment is true, the establishConversation is issued.

Overrides:
initializeFrom in class Service
Parameters:
aTag - com.ibm.btt.base.Tag
Returns:
java.lang.Object
Throws:
java.io.IOException
DSEException

initInstance

public void initInstance()
                  throws DSECCException,
                         DSEInvalidArgumentException
Initiates all handlers that have a default treatment. It also creates the listenThread.

Throws:
DSEInvalidArgumentException
DSEException
DSECCException

initManagers

public void initManagers()
                  throws com.ibm.mq.MQException
Initiates all handlers that have a default treatment. It also creates the listenThread.

Throws:
DSEInvalidArgumentException
DSEException
com.ibm.mq.MQException

isCloseMessage

public boolean isCloseMessage(java.lang.Object aMessage)
Checks if close Message has been received.

Returns:
boolean - Returns true if the close Message has been received

isDeadLetterQReset

public boolean isDeadLetterQReset()
Checks whether the DeadLetter queue manager is open.

Returns:
- Returns true if status of the DeadLetter queue is Reset.

isFree

public boolean isFree()
Returns whether the session is free.

Specified by:
isFree in interface CommonCommunicationsService
Returns:
boolean - Returns true if the session is free

isOffline

public boolean isOffline()
Returns whether the session is offline.

Specified by:
isOffline in interface CommonCommunicationsService
Returns:
boolean - Returns true if the session is offline

isResetStatus

public boolean isResetStatus()
Returns:
boolean - Returns true if any of the queues have a status of Reset.

parseInt

public int parseInt(java.lang.String param)
Parses the input string into its associated MQ code.

Parameters:
param - java.lang.String
Returns:
int

putToPutSendQueue

public byte[] putToPutSendQueue(com.ibm.mq.MQMessage aMessage)
                         throws com.ibm.mq.MQException
Puts aMessage (an MQMessage) into the putSendQueue and returns the correlation identifier for this message.

Parameters:
aMessage - The message to put into the send queue
Returns:
- The correlationId for the Message inserted into the send queue
Throws:
com.ibm.mq.MQException

putToPutSendQueue

public byte[] putToPutSendQueue(java.lang.String aData)
                         throws com.ibm.mq.MQException,
                                java.io.IOException
Puts an MQMessage into the putSendQueue, creates the aData and message default options, and returns the correlation ID of this message.

Parameters:
aMessage - - The message to put into the send queue
Returns:
- The correlationId for the message inserted into the send queue
Throws:
MQException.
java.io.IOException.
com.ibm.mq.MQException
java.io.IOException

receive

protected void receive()
                throws java.io.IOException
Performs the receive method used by thread listeners when working in asynchronous mode.

Throws:
java.io.IOException

receive

public java.lang.Object receive(byte[] aCorrelationId)
                         throws com.ibm.mq.MQException,
                                java.io.IOException
Performs the receive method.

Specified by:
receive in interface MQConnectionService
Returns:
java.lang.String
Throws:
com.ibm.mq.MQException
java.io.IOException

receive

public java.lang.Object receive(byte[] aCorrelationId,
                                long aTimeout)
                         throws com.ibm.mq.MQException,
                                java.io.IOException
Performs the receive method.

Specified by:
receive in interface MQConnectionService
Parameters:
correlationId(byte[]) - The message correlation identifier to get the correct message.
timeout(long) -
Returns:
java.lang.String
Throws:
com.ibm.mq.MQException
java.io.IOException

receiveFromDeadLetterQueue

public void receiveFromDeadLetterQueue()

Performs the receive method, which is used by listen threads when it is working in asynchronous mode


removeQueueListener

public void removeQueueListener(QueueListener newListener)
Removes queue listener.

Specified by:
removeQueueListener in interface MQConnectionService
Parameters:
newListener - com.ibm.btt.services.mq.QueueListener

resetChannel

public int resetChannel(java.lang.String channelName)
                 throws com.ibm.mq.MQException
Resets the message sequence number for a channel. The possible return values are:

Parameters:
channelName - The name of the channel to be reset.
Returns:
- Returns the status of the reset
Throws:
com.ibm.mq.MQException.
com.ibm.mq.MQException

resetChannel

public int resetChannel(java.lang.String channelName,
                        int msgSeqNumber)
                 throws com.ibm.mq.MQException
Resets the message sequence number for a channel to a specified value. The possible return values are:

Parameters:
channelName - The name of the channel to be reset
msgSeqNumber - The new sequence number
Returns:
- Returns the status of the reset
Throws:
com.ibm.mq.MQException.
com.ibm.mq.MQException

returnException

public DSECCException returnException(java.lang.Exception e)
Maps the MQException to the DSECCException.

Returns:
DSECCException

returnStringFromMessage

public java.lang.String returnStringFromMessage(java.lang.Object aMessage)
                                         throws DSECCException
Obtains the msgText(String) from a MQMessage.

Returns:
String msgText
Throws:
DSECCException

run

public void run()
Runs the listener for messages.

Specified by:
run in interface java.lang.Runnable

send

public byte[] send(Context aContext,
                   FormatElement aFormat)
            throws DSEException,
                   com.ibm.mq.MQException,
                   java.io.IOException
Performs the send method.

Parameters:
aContext - com.ibm.btt.base.Context - The context element object
aFormat - com.ibm.btt.base.FormatElement - The format element object
Returns:
byte[] correlationId
Throws:
DSEException
com.ibm.mq.MQException
java.io.IOException

send

public byte[] send(Context aContext,
                   java.lang.String aFormatName)
            throws DSEException,
                   com.ibm.mq.MQException
Performs the send method.

Parameters:
aContext - com.ibm.btt.base.Context - The format element
aFormatName - java.lang.String - The format element name
Returns:
byte[] correlationId
Throws:
com.ibm.mq.MQException
DSEException

send

public byte[] send(java.lang.Object inputMessage)
            throws com.ibm.mq.MQException
Performs the send method.

Specified by:
send in interface MQConnectionService
Parameters:
aString - java.lang.String
Returns:
byte[] - The correlationId
Throws:
com.ibm.mq.MQException

send

public byte[] send(java.lang.String inputMessage)
            throws com.ibm.mq.MQException,
                   java.io.IOException
Performs the send method.

Specified by:
send in interface MQConnectionService
Parameters:
aString - java.lang.String
Returns:
byte[] - The correlationId
Throws:
com.ibm.mq.MQException
java.io.IOException

setAliasQueueManagerNameSend

public void setAliasQueueManagerNameSend(java.lang.String aliasQueueManagerNameSend)
Sets the aliasQueueManagerNameSend

Parameters:
aliasQueueManagerNameSend - The aliasQueueManagerNameSend to set

setApplicationName

public void setApplicationName(java.lang.String newApplicationName)
Sets the applicationName property (java.lang.String) value.

Parameters:
newApplicationName - java.lang.String
See Also:
getApplicationName()

setAutomaticConnectionEstablishment

public void setAutomaticConnectionEstablishment(boolean automaticEstablishment)
Sets the automaticConnectionEstablishment property (boolean) value.

Parameters:
automaticEstablishment - The new value for the property
See Also:
getAutomaticConnectionEstablishment()

setChannelName

public void setChannelName(java.lang.String chname)
Sets the Channel property (java.lang.String) value.

Parameters:
The - Channel(java.lang.String) property value

setCharSet

public void setCharSet(int newCharSet)
Sets the charSet property value.

Parameters:
newCharSet - int
See Also:
getCharSet()

setDeadLetterMessageOptionsMatchOptions

public void setDeadLetterMessageOptionsMatchOptions(int options)
Sets DeadLetterQueue match Options property (MQGetMessageOptions) value.

Parameters:
options(int) - The DeadLetter message matchOptions

setDeadLetterMessageOptionsWaitInterval

public void setDeadLetterMessageOptionsWaitInterval(int options)
Sets DeadLetterQueue option waitInterval property (MQGetMessageOptions) value.

Parameters:
options(int) - The waitInterval DeadLetter message option

setDeadLetterQName

public void setDeadLetterQName(java.lang.String dlname)
Sets the deadLetterQName property (java.lang.String) value.

Parameters:
The - deadLetterQName(java.lang.String) property value

setEncoding

public void setEncoding(int newEncoding)
Sets the encoding property value.

Parameters:
newEncoding - int
See Also:
getEncoding()

setEstablishConnectionRetries

public void setEstablishConnectionRetries(int establishConnectionRetries)
Sets the establishSessionRetries property (int) value.

Parameters:
establishSessionRetries - The new value for the property
See Also:
#getEstablishSessionRetries

setExpiry

public void setExpiry(int newExpiry)

Sets the expiry property value.

Parameters:
newExpiry - int
See Also:
getExpiry()

setFormat

public void setFormat(java.lang.String newFormat)
Sets the format property (java.lang.String) value.

Parameters:
newFormat - java.lang.String

setGetMessageOptionsMatchOptions

public void setGetMessageOptionsMatchOptions(int options)
Sets GetMessageOptions match Options property (MQGetMessageOptions) value.

Parameters:
options(int) - The GetMessageOptions matchoptions

setGetMessageOptionsOptions

public void setGetMessageOptionsOptions(int options)
Sets GetMessageOptions Options field property (int) value.

Parameters:
options(int) - The GetMessageOptions options

setGetMessageOptionsWaitInterval

public void setGetMessageOptionsWaitInterval(int options)
Sets GetMessageOptions WaitInterval field property (MQGetMessageOptions) value.

Parameters:
options(int) - The WaitInterval GetMessageOptions option

setHostName

public void setHostName(java.lang.String hname)
Sets the Host name property (java.lang.String) value.

Parameters:
The - hostName(java.lang.String) property value

setInUse

public void setInUse(boolean anInUse)
Sets the inUse property (boolean) value.

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

setMatchCorrelation

public void setMatchCorrelation(boolean newValue)
Sets the matchCorrelation property (boolean) value.

Parameters:
newValue - The new value for the property
See Also:
#getmatchCorrelation

setMessageType

public void setMessageType(int newMessageType)
Sets the messageType property value.

Parameters:
newMessageType - int

setPersistence

public void setPersistence(int newPersistence)
Sets the persistence property value.

Parameters:
newPersistence - int
See Also:
getPersistence()

setPortNumber

public void setPortNumber(int pnum)
Sets the Port number property (int) value.

Parameters:
The - port(int) property value

setPutMessageOptionsOptions

public void setPutMessageOptionsOptions(int options)
Sets PutMessageOptions Options field property (int) value.

Parameters:
options - The PutMessageOptions options

setQmgrName

public void setQmgrName(java.lang.String qmgrname)
Sets the QMgrName property (java.lang.String) value.

Parameters:
The - QMgrName property value

setQmgrReply

public void setQmgrReply(java.lang.String newQmgrReply)
Sets the QmgrReply property (java.lang.String) value.

Parameters:
newQmgrReply - java.lang.String

setReplyDynamicQName

public void setReplyDynamicQName(java.lang.String rqname)
Sets the ReplyDynamicQName property (java.lang.String) value.

Parameters:
The - replyDynamicQName property value

setReplyQName

public void setReplyQName(java.lang.String rqname)
Sets the ReplyToQName property (java.lang.String) value.

Parameters:
The - replyToQName property value

setReplyToQOpenOptions

public void setReplyToQOpenOptions(int options)
Sets ReplyToQOpenOptions field property (int) value.

Parameters:
options - The ReplyToQ open options

setSendDynamicQName

public void setSendDynamicQName(java.lang.String sqname)
Sets the SendDynamicQName property (java.lang.String) value.

Parameters:
The - SendDynamicQName property value

setSendQName

public void setSendQName(java.lang.String sqname)
Sets the SendToQName property (java.lang.String) value.

Parameters:
The - sendToQName property value

setSendToQOpenOptions

public void setSendToQOpenOptions(int options)

Sets SendToQOpenOptions field property (int) value.

Parameters:
options - The SendToQ open options

setServer

public void setServer(boolean aBoolean)
Sets the server property (boolean) value.

Parameters:
aBoolean - The new boolean value for the property
See Also:
getAutomaticConnectionEstablishment()

setSynchronousMode

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

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

setTimeout

public void setTimeout(int newTimeout)
Sets the timeout property value.

Parameters:
newTimeout - int
See Also:
getTimeout()

setUserId

public void setUserId(java.lang.String newUserId)
Sets the userId property (java.lang.String) value.

Parameters:
newUserId - java.lang.String

getCcsid

public int getCcsid()

setCcsid

public void setCcsid(int ccsid)

startChannel

public int startChannel(java.lang.String channelName)
                 throws com.ibm.mq.MQException
Starts the specified channel. The possible return values are:

Parameters:
channelName - The name of the channel to be started
Returns:
- Returns the status of the request
Throws:
com.ibm.mq.MQException

stopChannel

public int stopChannel(java.lang.String channelName)
                throws com.ibm.mq.MQException

Stops the specified channel. The possible return values are:

Parameters:
channelName - The name of the channel to be stopped
Returns:
- Returns the status of the stop request
Throws:
com.ibm.mq.MQException.
com.ibm.mq.MQException

terminate

public void terminate()
Terminates the conversation. This method terminates the internal thread and closes the conversation ABNORMALY if is in RECEIVE state.

Specified by:
terminate in interface ProcessorNotifier
Specified by:
terminate in interface MQConnectionService
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's visual representation

IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2009