Websphere MQ Everyplace

examples.mqbridge.transformers
Class MQeBaseTransformer

java.lang.Object
  |
  +--examples.mqbridge.transformers.MQeBaseTransformer
All Implemented Interfaces:
MQeTransformerInterface

public class MQeBaseTransformer
extends java.lang.Object
implements MQeTransformerInterface

A simple MQ to MQe transformer class.


Field Summary
static int MQMT_MQE_FIELDS
          An MQe encoded message that did not originate from MQe.
static int MQMT_MQE_FIELDS_FROM_MQE
          An MQe encoded message that originated from MQe
static short[] version
          Version number of this class
 
Constructor Summary
MQeBaseTransformer()
           
 
Method Summary
 void activate(java.util.StringTokenizer params)
          Tells the transformer of any parameters that were supplied with the transformer definition.
 com.ibm.mq.MQMessage mqSeriesFormatFromMQe(MQeMQMsgObject MQeMsg)
          Convert an MQ-Style MQe message (MQeMQMsgObject) into an MQ message.
 com.ibm.mq.MQMessage mqSeriesFormatFromMQe(MQeMQMsgObject msg, java.lang.String remoteQMgrName, java.lang.String remoteQName)
          Convert a MQ-Style MQe message (MQeMQMsgObject) into a MQ message
 MQeMQMsgObject mqSeriesFormatToMQe(com.ibm.mq.MQMessage MQMsg)
          Convert an MQ message to an MQeMQMsgObject, ie maintain the MQ Series style of the message.
 MQeMsgObject mqSeriesFormatToMQe(com.ibm.mq.MQMessage msg, java.lang.String remoteQMgrName, java.lang.String remoteQName)
          Convert a MQ format message which is not MQe encoded into an MQe format message.
 com.ibm.mq.MQMessage transform(MQeMsgObject msg, MQeMQBridgeQueue queue, com.ibm.mq.MQPutMessageOptions options)
          Convert a MQe format message into a MQ format message.
 MQeMsgObject transform(com.ibm.mq.MQMessage msg, java.lang.String remoteQMgrName, java.lang.String remoteQName)
          Convert a MQ format message into a MQe format message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

version

public static short[] version
Version number of this class


MQMT_MQE_FIELDS_FROM_MQE

public static final int MQMT_MQE_FIELDS_FROM_MQE
An MQe encoded message that originated from MQe

See Also:
Constant Field Values

MQMT_MQE_FIELDS

public static final int MQMT_MQE_FIELDS
An MQe encoded message that did not originate from MQe.

See Also:
Constant Field Values
Constructor Detail

MQeBaseTransformer

public MQeBaseTransformer()
Method Detail

activate

public void activate(java.util.StringTokenizer params)
              throws java.lang.Exception
Tells the transformer of any parameters that were supplied with the transformer definition. This transformer does not use any of the supplied parameters.

Specified by:
activate in interface MQeTransformerInterface
Parameters:
params - StringTokenizer containing the transformer definition parameters.
Returns:
void
Throws:
java.lang.Exception - If the parameters are invalid or the transformer cannot be initialised.

transform

public MQeMsgObject transform(com.ibm.mq.MQMessage msg,
                              java.lang.String remoteQMgrName,
                              java.lang.String remoteQName)
                       throws java.lang.Exception
Convert a MQ format message into a MQe format message. This method is called by the MQ/MQe bridge.

Specified by:
transform in interface MQeTransformerInterface
Parameters:
msg - The MQSeries message object we are to transform.
remoteQMgrName - The Destination Remote Queue Manager Name (from the MQ Remote Queue Definition)
remoteQName - The Destination Remote Queue Name (from the MQ Remote Queue Definition).
Returns:
The equivalent MQe format message.
Throws:
java.lang.Exception - propagated from the called methods.

transform

public com.ibm.mq.MQMessage transform(MQeMsgObject msg,
                                      MQeMQBridgeQueue queue,
                                      com.ibm.mq.MQPutMessageOptions options)
                               throws java.lang.Exception
Convert a MQe format message into a MQ format message. This method is called by the MQ/MQe bridge.

Specified by:
transform in interface MQeTransformerInterface
Parameters:
msg - The MQe message object we are to transform.
queue - A reference to the MQe queue the put the message. (e.g. For determining default expiry time etc...)
options - A reference to a MQPutMessageOptions object in which any required options for the put should be placed.
Returns:
The equivalent MQ format message.
Throws:
java.lang.Exception - If the parameters are not valid, or if the message is in a format that this transformer does not understand.

mqSeriesFormatToMQe

public MQeMsgObject mqSeriesFormatToMQe(com.ibm.mq.MQMessage msg,
                                        java.lang.String remoteQMgrName,
                                        java.lang.String remoteQName)
                                 throws java.lang.Exception
Convert a MQ format message which is not MQe encoded into an MQe format message.

Parameters:
msg - The MQSeries message object we are to transform.
remoteQMgrName - The Destination Remote Queue Manager Name (from the MQ Remote Queue Definition)
remoteQName - The Destination Remote Queue Name (from the MQ Remote Queue Definition).
Returns:
The equivalent MQe format message.
Throws:
java.lang.Exception - propagated from the called methods.

mqSeriesFormatToMQe

public MQeMQMsgObject mqSeriesFormatToMQe(com.ibm.mq.MQMessage MQMsg)
                                   throws java.lang.Exception
Convert an MQ message to an MQeMQMsgObject, ie maintain the MQ Series style of the message. This is the default when a non MQe-encoded message arrives at the bridge from MQSeries. It can be overridden in a sub-class.

Parameters:
MQMsg - The MQSeries message object we are to transform.
Returns:
The equivalent MQeMQMsgObject message.
Throws:
java.lang.Exception - Propagated from called methods.

mqSeriesFormatFromMQe

public com.ibm.mq.MQMessage mqSeriesFormatFromMQe(MQeMQMsgObject msg,
                                                  java.lang.String remoteQMgrName,
                                                  java.lang.String remoteQName)
                                           throws java.lang.Exception
Convert a MQ-Style MQe message (MQeMQMsgObject) into a MQ message

Parameters:
msg - The MQe message object we are to transform.
remoteQMgrName - The Destination Remote Queue Manager Name
remoteQName - The Destination Remote Queue Name
Returns:
The equivalent MQ format message.
Throws:
java.lang.Exception - If something goes wrong in the transform.

mqSeriesFormatFromMQe

public com.ibm.mq.MQMessage mqSeriesFormatFromMQe(MQeMQMsgObject MQeMsg)
                                           throws java.lang.Exception
Convert an MQ-Style MQe message (MQeMQMsgObject) into an MQ message. This is the default when a MQ Style message arrives at the bridge from MQe. It can be overridden in a sub-class.

Returns:
The equivalent MQ format message.
Throws:
java.lang.Exception - Propagated from called methods.

Websphere MQ Everyplace