Class SolaceJcsmpBaseTranslatorImp

  • All Implemented Interfaces:
    SolaceJcsmpMessageTranslator
    Direct Known Subclasses:
    SolaceJcsmpBytesMessageTranslator, SolaceJcsmpBytesXmlMessageTranslator, SolaceJcsmpTextMessageTranslator, SolaceJcsmpXmlContentMessageTranslator

    public abstract class SolaceJcsmpBaseTranslatorImp
    extends java.lang.Object
    implements SolaceJcsmpMessageTranslator

    Once a message has been consumed from Solace, this translator will generate an AdaptrisMessage from the payload and headers of the consumed message.

    Reverse translation when producing a message to a Solace end-point will create a Solace XMLMessage again from the payload and metadata of the AdaptrisMessage

    The payload mapping is straight forward, but the metadata and header mapping does require a little configuration. In the advanced settings you can specify metadata keys against each Solace message property; when consuming we will copy the value from the Solace message into the specified metadata key and when producing we will source the value for the Solace header from the specified metadata key.

    User data is slightly different however, when consuming we will copy all Solace User data into metadata, when producing you will set a metadata filter where we will copy metadata keys and values into the outgoing Solace message User data.

    In the adapter configuration file this class is aliased as solace-jcsmp-bytes-message-translator which is the preferred alternative to the fully qualified classname when building your configuration.

    • Constructor Detail

      • SolaceJcsmpBaseTranslatorImp

        public SolaceJcsmpBaseTranslatorImp()
    • Method Detail

      • performPayloadTranslation

        protected abstract com.solacesystems.jcsmp.XMLMessage performPayloadTranslation​(AdaptrisMessage source)
      • performPayloadTranslation

        protected abstract void performPayloadTranslation​(com.solacesystems.jcsmp.XMLMessage source,
                                                          AdaptrisMessage destination)
      • performMetadataMappings

        protected void performMetadataMappings​(com.solacesystems.jcsmp.XMLMessage message,
                                               AdaptrisMessage adaptrisMessage)
                                        throws java.lang.Exception
        Throws:
        java.lang.Exception
      • performHeaderMappings

        protected void performHeaderMappings​(AdaptrisMessage message,
                                             com.solacesystems.jcsmp.XMLMessage xmlMessage)
                                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getDeliveryMode

        public java.lang.String getDeliveryMode()
        The mode of delivery; "PERSISTENT / NONPERSISTENT"
      • setDeliveryMode

        public void setDeliveryMode​(java.lang.String deliveryMode)
        The mode of delivery; "PERSISTENT / NONPERSISTENT"
        Parameters:
        deliveryMode -
      • getMappings

        @Deprecated
        @NotNull
        public @NotNull java.util.List<SolaceJcsmpMetadataMapping> getMappings()
        Deprecated.
        since 4.3 Use per-message-properties instead.
        A list of mappings between Adaptris message metadata and Solace headers.
      • setMappings

        @Deprecated
        public void setMappings​(@NotNull
                                @NotNull java.util.List<SolaceJcsmpMetadataMapping> mappings)
        Deprecated.
        since 4.3 Use per-message-properties instead.
        A list of mappings between Adaptris message metadata and Solace headers.
        Parameters:
        mappings -
      • getApplyPerMessagePropertiesOnProduce

        public boolean getApplyPerMessagePropertiesOnProduce()
        Apply per message properties resolution when we produce a JCSMP message.
      • setApplyPerMessagePropertiesOnProduce

        public void setApplyPerMessagePropertiesOnProduce​(boolean applyPerMessagePropertiesOnProduce)
        Apply per message properties resolution when we produce a JCSMP message.
      • getApplyPerMessagePropertiesOnConsume

        public boolean getApplyPerMessagePropertiesOnConsume()
        Copy the JCSMP message properties into metadata when we consume a message.
      • setApplyPerMessagePropertiesOnConsume

        public void setApplyPerMessagePropertiesOnConsume​(boolean applyPerMessagePropertiesOnConsume)
        Copy the JCSMP message properties into metadata when we consume a message.
      • setMetadataFilter

        public void setMetadataFilter​(MetadataFilter metadataFilter)