Interface NewsMessage

  • All Superinterfaces:
    Message

    public interface NewsMessage
    extends Message

    An instance of NewsMessage defines the headline text that provides a brief description of a news story (see StoryMessage).

     

    An object implementing this interface cannot be instantiated directly, but can be constructed using the MessageFactory.createNewsMessage(String, String, String, String) method of the MessageFactory that is available on the Publisher interface.

     

    If this NewsMessage has a corresponding story for the headline, call the setStoryReference(String) method to uniquely identify that story. To record any keywords that can be used to locate the story in a search result call getTags(). This method returns a reference to a list of the keywords (if any) in the NewsMessage. You can then add additional keywords to the list.

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      Field getField​(java.lang.String fieldName)
      Gets a custom field from a news message
      java.lang.String getHeadline()
      Gets the headline of the news message.
      java.lang.String getNewsDateTime()
      Gets the date and time that the headline was created.
      java.lang.String getPermission()
      Gets a permission string relating to this news message.
      java.lang.String getStoryReference()
      Gets a reference that identifies the story associated with the headline.
      java.util.List<java.lang.String> getTags()
      Gets a reference to the set of keywords or terms that describe the news item.
      void setField​(java.lang.String fieldName, java.lang.String value)
      Sets a custom field on this news message
      void setPermission​(java.lang.String permission)
      Sets a permission string relating to this news message.
      void setStoryReference​(java.lang.String reference)
      Sets a reference that identifies the story associated with the headline.
    • Method Detail

      • getTags

        java.util.List<java.lang.String> getTags()
        Gets a reference to the set of keywords or terms that describe the news item.
        Returns:
        The keywords. This is a modifiable list to which you can add additional keywords if required.
      • getHeadline

        java.lang.String getHeadline()
        Gets the headline of the news message.
        Returns:
        The headline.
      • getStoryReference

        java.lang.String getStoryReference()
        Gets a reference that identifies the story associated with the headline.
        Returns:
        The reference.
      • setStoryReference

        void setStoryReference​(java.lang.String reference)
        Sets a reference that identifies the story associated with the headline.
        Parameters:
        reference - The reference.
      • getNewsDateTime

        java.lang.String getNewsDateTime()
        Gets the date and time that the headline was created.
        Returns:
        A String representation of the date and time.
      • getPermission

        java.lang.String getPermission()

        Gets a permission string relating to this news message.

         

        Liberator can use the contents of this property to determine whether this headline should be sent to a client.

        Returns:
        The permission string.
      • setPermission

        void setPermission​(java.lang.String permission)

        Sets a permission string relating to this news message.

         

        Liberator can use the contents of this property to determine whether this headline should be sent to a client.

        Parameters:
        permission - The permission string.
      • setField

        void setField​(java.lang.String fieldName,
                      java.lang.String value)

        Sets a custom field on this news message

        Parameters:
        fieldName - the name of the field - does not need to be specified in fields.conf
        value - value for the field
      • getField

        Field getField​(java.lang.String fieldName)

        Gets a custom field from a news message

        Parameters:
        fieldName - the name of the field
        Returns:
        The custom field corresponding to the field name. If field doesn't exist, then null.