Interface MappingMessage

  • All Superinterfaces:
    Message

    public interface MappingMessage
    extends Message

    Interface for sending MappingMessages.

    Mapping messages allow a DataSource to inform the Liberator that it should request a different subject.

    A MappingMessage is created with a subject and a mapping. When a request for subject is received, the Liberator will request mapping. Updates for mapping will be routed transparently by the Liberator to all peers originally requesting subject.

    Mapping requests for /FX/GBPUSD/5 to /FX/GBPUSD/10:

     

    Publisher publisher = dataSource.getPublisher();

     

    MessageFactory messageFactory = publisher.getMessageFactory();

     

    MappingMessage mappingMessage = messageFactory.createMappingMessage("/FX/GBPUSD/5", "/FX/GBPUSD/10");

     

    publisher.publishMappingMessage(mappingMessage);

     

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.String getMapping()
      Gets the mapped-to subject for the message.
      java.lang.String getSubject()
      Gets the subject of this message.
      java.lang.String getVersion()
      Gets the version of the message.
      boolean isImage()
      Gets a boolean value indicating whether this Message represents an image or an update.
      void setImage​(boolean image)
      Sets a boolean value indicating whether this Message represents an image of the data or an update to it.
    • Method Detail

      • isImage

        boolean isImage()
        Description copied from interface: Message
        Gets a boolean value indicating whether this Message represents an image or an update. By default, this method returns false indicating that the Message is an update and not an image. To change a message to be an image, call Message.setImage(boolean) passing in the value true.
        Specified by:
        isImage in interface Message
        Returns:
        true if this message is an image of the object, false if it is an update to the existing state of the object.
      • setImage

        void setImage​(boolean image)
        Description copied from interface: Message
        Sets a boolean value indicating whether this Message represents an image of the data or an update to it. By default, a newly created Message is deemed to be an update and not an image.
        Specified by:
        setImage in interface Message
        Parameters:
        image - When set to true, the receiver will clear all previous data for that subject before adding the sent data. When set to false, the receiver adds the sent data to previous data sent to that subject.
      • getSubject

        java.lang.String getSubject()
        Description copied from interface: Message
        Gets the subject of this message.
        Specified by:
        getSubject in interface Message
        Returns:
        The subject.
      • getVersion

        java.lang.String getVersion()
        Gets the version of the message.
        Returns:
        Message version as a string.
      • getMapping

        java.lang.String getMapping()
        Gets the mapped-to subject for the message.
        Returns:
        The mapped to subject.