Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.forum.nntp
Interface Article

All Known Implementing Classes:
FMessageArticleAdapter

public interface Article

Represents an article on the system.

Articles should be able to return the entire article or just the body or headers. Articles must exist within the context of one or more news groups. Articles are one of three interfaces (NewsGroup, Article and NewsGroupProvider) that backend storage providers must implement.

See Also:
NewsGroup, Article

Method Summary
 java.lang.String getAuthor()
          Obtain the author of the article (name <email>).
 int getByteCount()
          Returns the number of bytes in the article including line terminating <CR-LF> pairs the two extra <CR-LF> pairs separating message body and article body.
 java.lang.String getDate()
          Obtain the Date the article was posted.
 java.lang.String getHead()
          Obtain the headers of the article.
 int getLineCount()
          Returns the number of lines in the article including headers and blank line between headers and body.
 java.lang.String getMessageID()
          Obtain the message-ID associated with the article.
 java.lang.String getNewsGroups()
          Obtain the comma separated list newsgroups this article is posted to.
 int getNumber()
          Obtain the article number of the article.
 java.lang.String getReferences()
          Obtain the references of the article.
 java.lang.String getSubject()
          Obtain the subject of the article.
 void sendArticle(NNTPResponseBuffer response)
          Send the entire article.
 void sendBody(NNTPResponseBuffer response)
          Send the body of the article.
 

Method Detail

getNumber

int getNumber()

Obtain the article number of the article. The article number is only relevant when the article was obtained from within the context of an article pointer with valid group. Accessing this method outside of that context, of after the article pointer has been moved can result in exceptions.

Returns:
the article number.

getMessageID

java.lang.String getMessageID()

Obtain the message-ID associated with the article.

All message-ID's MUST be surrounded by angle brackets. All articles are identified by a globally unique message-ID. Articles without a message ID header can be supplied with a single digit "0" (zero) within angle brackets. The same article in different newsgroups will have the same message ID (but not the same message number) allowing readers to skip articles previously read in other groups.

Returns:
the messsage ID for the article.

getSubject

java.lang.String getSubject()

Obtain the subject of the article.

This method MUST NOT include any tab or end of line characters. Any such character in this field must be converted to spaces.

Returns:
the message subject found in the Subject: header

getAuthor

java.lang.String getAuthor()

Obtain the author of the article (name <email>).

This method MUST NOT include any tab characters. Any tab character in this field must be converted to spaces.

Returns:
The message author found in the From: header

getDate

java.lang.String getDate()

Obtain the Date the article was posted.

Dates must be formatted as standard RFC 822 dates:

Thu Sep 26, 2003 10:43:11 US/Pacific

This method MUST NOT include any tab characters. Any tab character in this field must be converted to spaces.

Returns:
the message date found in the Date: header.

getReferences

java.lang.String getReferences()

Obtain the references of the article.

This method MUST NOT include any tab characters. Any tab character in this field must be converted to spaces.

Returns:
the message references found in the References: header, delimited by commas.

getNewsGroups

java.lang.String getNewsGroups()

Obtain the comma separated list newsgroups this article is posted to. The list should be generated from the Newsgroups: header of the article (a required header field of all NNTP articles).

This method MUST NOT include any tab characters. Any tab character in this field must be converted to spaces.

Returns:
the groups the article was posted to found in the Newsgroups: header, delimited by commas.

getByteCount

int getByteCount()
Returns the number of bytes in the article including line terminating <CR-LF> pairs the two extra <CR-LF> pairs separating message body and article body.

Returns:
the size of the message in bytes.

getLineCount

int getLineCount()
Returns the number of lines in the article including headers and blank line between headers and body.

Returns:
the number of lines in the article.

sendBody

void sendBody(NNTPResponseBuffer response)
              throws java.io.IOException

Send the body of the article.

The body text may contain any ASCII text. It should not contain the end of article trailing '.'. One will be supplied by the server and any isolated '.' will be escaped as per NNTP rules.

Parameters:
response - the response buffer to send the body of the article to.
Throws:
java.io.IOException

sendArticle

void sendArticle(NNTPResponseBuffer response)
                 throws java.io.IOException

Send the entire article.

The articlre text may contain any ASCII text. It should not contain the end of article trailing '.'. One will be supplied by the server and any isolated '.' will be escaped as per NNTP rules.

Parameters:
response - the response buffer to send the body of the article to.
Throws:
java.io.IOException

getHead

java.lang.String getHead()

Obtain the headers of the article.

The headers text may contain any ASCII text. It should not contain the end of article trailing '.'. Headers must follow RFC-822 message header format:


 From: sender 
 Subject: The message subject
 Newsgroups: jive.general, jive.support
 

Each line should be terminated with a pair, there MUST not be any blank lines. The server will use the headers to respond to HEAD commands, as well as used in conjunction with getBody() to construct the complete article dump.

Returns:
the headers of the article.

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.