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.

Note: After publishing a message, do not reuse the message (e.g. change the content, republish) as this can cause issues.

  • Method Details

    • getTags

      List<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

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

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

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

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

      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(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(String fieldName, 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(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.