Class StandardRendezvousTranslator

java.lang.Object
com.adaptris.core.tibrv.StandardRendezvousTranslator
All Implemented Interfaces:
AdaptrisMessageTranslator, RendezvousTranslator

public class StandardRendezvousTranslator extends Object implements RendezvousTranslator

Implementation of RendezvousTranslator which stores AdaptrisMessage's payload against a TibrvMsg field of type TibrvMsg.OPAQUE, and unique ID and char encoding against fields of type TibrvMsg.STRING. AdaptrisMessage metadata is store in a child TibrvMsg as Tibrv.STRINGs using the metadata key as the 'name.

The names against which these elements are stored / expected to be found in TibrvMsg are configurable and defaulted in the constructor.

  • Constructor Details

    • StandardRendezvousTranslator

      public StandardRendezvousTranslator()

      Creates a new instance. Default names are char-enc, metadata, payoad, unique-id.

  • Method Details

    • registerMessageFactory

      public void registerMessageFactory(AdaptrisMessageFactory f)
      Specified by:
      registerMessageFactory in interface AdaptrisMessageTranslator
      See Also:
    • currentMessageFactory

      public AdaptrisMessageFactory currentMessageFactory()
      Specified by:
      currentMessageFactory in interface AdaptrisMessageTranslator
      See Also:
    • translate

      public com.tibco.tibrv.TibrvMsg translate(AdaptrisMessage msg, String sendSubject) throws Exception
      Description copied from interface: RendezvousTranslator

      Create a new TibrvMsg based on the passed AdaptrisMessage and sendSubject.

      Specified by:
      translate in interface RendezvousTranslator
      Parameters:
      msg - the AdaptrisMessage to translate
      sendSubject - the send subject to use
      Returns:
      a new TibrvMsg
      Throws:
      Exception - if any occur
      See Also:
    • translate

      public AdaptrisMessage translate(com.tibco.tibrv.TibrvMsg tibrvMsg) throws Exception
      Description copied from interface: RendezvousTranslator

      Create a new AdaptrisMessage based on the passed TibrvMsg.

      Specified by:
      translate in interface RendezvousTranslator
      Parameters:
      tibrvMsg - the TibrvMsg to translate
      Returns:
      a new AdaptrisMessage
      Throws:
      Exception - if any occur
      See Also:
    • toString

      public String toString()
      Overrides:
      toString in class Object
      See Also:
    • getCharEncName

      public String getCharEncName()

      Returns the name that (optional) character encoding details are stored against in TibrvMsg.

      Returns:
      the name that (optional) character encoding details are stored against in TibrvMsg
    • setCharEncName

      public void setCharEncName(String s)

      Sets the name that (optional) character encoding details are stored against in TibrvMsg. May not be null or empty.

      Parameters:
      s - the name that (optional) character encoding details are stored against in TibrvMsg
    • getPayloadName

      public String getPayloadName()

      Returns the name that the payload is stored against in TibrvMsg.

      Returns:
      the name that the payload is stored against in TibrvMsg
    • setPayloadName

      public void setPayloadName(String s)

      Sets the name that the payload is stored against in TibrvMsg. May not be null or empty.

      Parameters:
      s - the name that the payload is stored against in TibrvMsg
    • getUniqueIdName

      public String getUniqueIdName()

      Returns the name that the message unique ID is stored against in TibrvMsg.

      Returns:
      the name that the message unique ID is stored against in TibrvMsg
    • setUniqueIdName

      public void setUniqueIdName(String s)

      Sets the name that the message unique ID is stored against in TibrvMsg. May not be null or empty.

      Parameters:
      s - the name that the message unique ID is stored against in TibrvMsg
    • getMetadataName

      public String getMetadataName()

      Returns the name that the child TibrvMsg containing metadata is stored against in the parent TibrvMsg.

      Returns:
      the name that the child TibrvMsg containing metadata is stored against in the parent TibrvMsg
    • setMetadataName

      public void setMetadataName(String s)

      Sets the name that the child TibrvMsg containing metadata is stored against in the parent TibrvMsg. May not be null or empty.

      Parameters:
      s - the name that the child TibrvMsg containing metadata is stored against in the parent TibrvMsg