public class MessageIdMapper extends PropertyMapper
Note that if you wish to use the InterlokMessage.getUniqueId()
as the Id field (or vice-versa) on the
MSMQMessage then be aware that Id field is not a string, so you will be required to configure a
ByteTranslator. Additionally, a standard AdaptrisMessage unique-id will be too long to fit
the 20 byte restriction for a MSMQ MessageID even after using CharsetByteTranslator or
SimpleByteTranslator so unless you have generated the unique-id in some other fashion, you
should not try and map the AdaptrisMessage unique-id to the Id field when producing the message.
In the adapter configuration file this class is aliased as msmq-message-id-mapper which is the preferred alternative to the fully qualified classname when building your configuration.
logR
Constructor and Description |
---|
MessageIdMapper() |
MessageIdMapper(java.lang.String field) |
MessageIdMapper(java.lang.String field,
ByteTranslator bt) |
Modifier and Type | Method and Description |
---|---|
void |
map(AdaptrisMessage msg,
Message msmq)
Copy information from the AdaptrisMessage object into the MQMessage object.
|
void |
map(Message msmq,
AdaptrisMessage m)
Copy information from the MQMessage object into the AdaptrisMessage object.
|
createProperty, getByteTranslator, getConvertNull, getPropertyName, setByteTranslator, setConvertNull, setPropertyName
public MessageIdMapper()
public MessageIdMapper(java.lang.String field)
field
- the mqfieldnamepublic MessageIdMapper(java.lang.String field, ByteTranslator bt)
field
- the mqfieldnamebt
- the byte translator.public void map(AdaptrisMessage msg, Message msmq) throws MSMQException, CoreException
PropertyMapper
map
in class PropertyMapper
msg
- the AdaptrisMessage Object.msmq
- the MQMessage object.MSMQException
- for any MSMQ related ExceptionsCoreException
- for any framework related exceptionspublic void map(Message msmq, AdaptrisMessage m) throws MSMQException, CoreException
PropertyMapper
map
in class PropertyMapper
msmq
- the MQMessage object.m
- the AdaptrisMessage Object.MSMQException
- for any MSMQ related ExceptionsCoreException
- for any framework related exceptionsCopyright Adaptris