public class MessageIdMapper extends FieldMapper
Note that if you wish to use the InterlokMessage.getUniqueId()
as the messageId field (or vice-versa) on
the MQMessage then be aware that messageId field is not a string, so you will require a
ByteTranslator. Generally speaking, the AdaptrisMessage's unique ID will follow the same
format as UUID.randomUUID() which means that neither
HexStringByteTranslator or Base64ByteTranslator will be
suitable.
In the adapter configuration file this class is aliased as wmq-message-id-mapper which is the preferred alternative to the fully qualified classname when building your configuration.
FieldMapper.Field
logR
Constructor and Description |
---|
MessageIdMapper() |
MessageIdMapper(java.lang.String mqField) |
MessageIdMapper(java.lang.String mqField,
ByteTranslator bt) |
Modifier and Type | Method and Description |
---|---|
void |
copy(AdaptrisMessage msg,
com.ibm.mq.MQMessage mqMsg)
Copy information from the AdaptrisMessage object into the MQMessage object.
|
void |
copy(com.ibm.mq.MQMessage mq,
AdaptrisMessage m)
Copy information from the MQMessage object into the AdaptrisMessage object.
|
createField, getByteTranslator, getConvertNull, getMqFieldName, setByteTranslator, setConvertNull, setMqFieldName
public MessageIdMapper()
public MessageIdMapper(java.lang.String mqField)
mqField
- the mqfieldnamepublic MessageIdMapper(java.lang.String mqField, ByteTranslator bt)
mqField
- the mqfieldnamebt
- the byte translator.public void copy(AdaptrisMessage msg, com.ibm.mq.MQMessage mqMsg) throws java.io.IOException, com.ibm.mq.MQException, CoreException
FieldMapper
copy
in class FieldMapper
msg
- the AdaptrisMessage Object.mqMsg
- the MQMessage object.java.io.IOException
- wrapping any IOExceptioncom.ibm.mq.MQException
- for any MQ related ExceptionsCoreException
- for any framework related exceptionsFieldMapper.copy(com.adaptris.core.AdaptrisMessage, com.ibm.mq.MQMessage)
public void copy(com.ibm.mq.MQMessage mq, AdaptrisMessage m) throws java.io.IOException, com.ibm.mq.MQException, CoreException
FieldMapper
copy
in class FieldMapper
mq
- the MQMessage object.m
- the AdaptrisMessage Object.java.io.IOException
- wrapping any IOExceptioncom.ibm.mq.MQException
- for any MQ related ExceptionsCoreException
- for any framework related exceptionsFieldMapper.copy(com.ibm.mq.MQMessage, com.adaptris.core.AdaptrisMessage)