|
Jive Forums API (5.5.20.2-oracle) Developer Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jivesoftware.forum.nntp.spi.FMessageArticleAdapter
public class FMessageArticleAdapter
A set-and-forget wrapper that adapts a forum message to an NNTP article. The passed in message will be used by the article in a per-NNTP-protocol-command basis. New NNTP commands will retrieve a fresh ForumMessage and wrap a new adapter (so don't worry about saving state, caching, or stale data for the given message). It will be common for the NNTP system to call several access methods on the message (e.g. will get the subject, author, and message-id).
Constructor Summary | |
---|---|
FMessageArticleAdapter(DbForumMessage msg)
Create an NNTP Article by wrapping the given forum message. |
Method Summary | |
---|---|
java.lang.String |
getAuthor()
Format an author field as a Header response. |
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()
Populate the header information with essential information (author, subject, groups, date, references). |
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 article's Message-ID. |
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()
Adds the previous forum message ID as a reference or an empty string if no forum message proceeds this one in the thread. |
java.lang.String |
getSubject()
Obtain the subject of the article. |
void |
sendArticle(NNTPResponseBuffer response)
Sends the entire article. |
void |
sendBody(NNTPResponseBuffer response)
Populate the body text. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FMessageArticleAdapter(DbForumMessage msg)
Create an NNTP Article by wrapping the given forum message.
msg
- The message to wrapMethod Detail |
---|
public int getNumber()
Article
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.
getNumber
in interface Article
public java.lang.String getMessageID()
getMessageID
in interface Article
public java.lang.String getSubject()
Article
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.
getSubject
in interface Article
public java.lang.String getAuthor()
getAuthor
in interface Article
public java.lang.String getDate()
Article
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.
getDate
in interface Article
public java.lang.String getReferences()
getReferences
in interface Article
public java.lang.String getNewsGroups()
Article
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.
getNewsGroups
in interface Article
public int getByteCount()
Article
getByteCount
in interface Article
public int getLineCount()
Article
getLineCount
in interface Article
public void sendArticle(NNTPResponseBuffer response) throws java.io.IOException
sendArticle
in interface Article
response
- the response buffer to send the article to
java.io.IOException
- if there was a failure writin the response to
the underlying connectionpublic void sendBody(NNTPResponseBuffer response) throws java.io.IOException
sendBody
in interface Article
response
- the response buffer to send the body of the article to
java.io.IOException
- if there was a failure writin the response to
the underlying connectionpublic java.lang.String getHead()
getHead
in interface Article
|
Jive Forums Project Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |