org.newsml.toolkit
Interface NewsIdentifier

All Superinterfaces:
BaseNode

public interface NewsIdentifier
extends BaseNode

A globally-unique identifier for a news item.

The combination of the provider ID, date ID, news item ID, and revision ID make the news item unique; different revisions of the same item will differ only in the revision ID.

Note that the NewsIdentifier does not have a Duid or Euid.

TODO:

Version:
2.0
Author:
Reuters PLC

Method Summary
 Text getDateId()
          Get the date portion of the news identifier.
 NewsItemId getNewsItemId()
          Get the news item ID for the story.
 ProviderId getProviderId()
          Get the provider portion of the news identifier.
 Text getPublicIdentifier()
          Get a serialized version of the ID in a single string.
 RevisionId getRevisionId()
          Get the revision ID for the news item.
 
Methods inherited from interface org.newsml.toolkit.BaseNode
getAttr, getChild, getChild, getChild, getChild, getChildCount, getChildCount, getParent, getPath, getSession, getXMLName, getXPath, insertAfter, insertAfter, insertAfter, insertAfter, insertAfterDuid, insertAfterDuid, insertBefore, insertBefore, insertBefore, insertBefore, insertBeforeDuid, insertBeforeDuid, insertChild, insertChild, insertFirst, insertFirst, insertLast, insertLast, removeChild, removeChild, removeSelf, replaceChild, replaceChild, replaceChild, replaceChild, replaceChild, replaceChild, setAttr, setAttr, toXML, toXML, unsetAttr, unsetAttr, writeXML, writeXML
 

Method Detail

getProviderId

public ProviderId getProviderId()
Get the provider portion of the news identifier.

Recommended practice is to use a domain name for the provider ID; this will be available through the FormalNameNode.getName() method. Note that the formal name returned will never have a scheme attached.

Returns:
A node representing the provider (not null).
See Also:
getDateId(), getNewsItemId(), getRevisionId()

getDateId

public Text getDateId()
Get the date portion of the news identifier.

The date ID will always appear in ISO 8601 Basic Format, containing only the year, month, and day-of-the-month portions (CCYYMMDD), as in "20001122" for November 22, 2000. Once a news item is created, its date ID will not change, even if new revision come out on subsequent days.

Returns:
Text containing the date identifier.
See Also:
getProviderId(), getNewsItemId(), getRevisionId()

getNewsItemId

public NewsItemId getNewsItemId()
Get the news item ID for the story.

The news item ID may appear in any format desired by the sender. The name part of the ID is be unique for each date; in other words, the combination of date ID and news item ID is unique for each provider ID.

Returns:
A node representing the news item ID (not null).
See Also:
getProviderId(), getDateId(), getRevisionId()

getRevisionId

public RevisionId getRevisionId()
Get the revision ID for the news item.
Returns:
The revision ID (not null).

getPublicIdentifier

public Text getPublicIdentifier()
Get a serialized version of the ID in a single string.

The string will appear in the format urn:newsml:{ProviderId}:{DateId}:{NewsItemId}:{RevisionId}{RevisionId@Update} (note that "newsml" is not a registered URN namespace as of 2000-11-22, so this usage is non-standard). This information, though required, is redundant with the rest of the NewsIdentifier interface, and applications should take precautions if there is a conflict between this string and the four analysed parts of the news identifier.

Returns:
Text containing the serialized news identifier (not null)