Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.forum.nntp.spi
Class FForumNewsGroupAdapter

java.lang.Object
  extended by com.jivesoftware.forum.nntp.spi.FForumNewsGroupAdapter
All Implemented Interfaces:
NewsGroup

public class FForumNewsGroupAdapter
extends java.lang.Object
implements NewsGroup

Converts a Forum to an NNTP NewsGroup. The passed in Forum object is by the system on a once-per-NNTP-protocol-command basis. New NNTP commands will retrieve a fresh Forum 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 Forum (e.g. typical name and article numbers defining the range of available articles).


Constructor Summary
FForumNewsGroupAdapter(Forum forum)
          Create a new adapter to wrap the given forum.
 
Method Summary
 Article getArticle(int articleNumber)
          Obtain an article by it's group number.
 int getArticleCount()
          Obtain an estimate on the number of articles in the group.
 java.lang.String getDescription()
          Obtain the bried summary description of the group.
 int getFirstArticleNumber()
          Obtain the first valid group article number in this group.
 Forum getForum()
          Returns the underlying Forum object.
 long getID()
          Retruns the ID of the newsgroup.
 int getLastArticleNumber()
          Obtain the last valid group article number in this group.
 java.lang.String getName()
          Obtain the group name from it's Forum name.
 boolean isModerated()
          Returns true if the news group is moderated.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FForumNewsGroupAdapter

public FForumNewsGroupAdapter(Forum forum)
Create a new adapter to wrap the given forum.

Parameters:
forum - the forum to wrap.
Method Detail

getForum

public Forum getForum()
Returns the underlying Forum object.

Returns:
the underlying Forum object.

getName

public java.lang.String getName()
Obtain the group name from it's Forum name. All non-ascii, non-alphanumeric input MUST be escaped (currently to the underscore ('_') character). In addition each category name under the root category should be prepended to the group name and these names should be cached for efficiency.

Specified by:
getName in interface NewsGroup
Returns:
the name of the news group.

getDescription

public java.lang.String getDescription()
Description copied from interface: NewsGroup

Obtain the bried summary description of the group.

Provides a brief description of the news group. NNTP limits line lengths to 512 ASCII characters including the trailing <CR-LF> terminator. Thus there are 510 characters for a line. So the group name + 1 space character, plus the description must equal 510 characters. If the description exceeds this length, the server will truncate the description to fit.

Specified by:
getDescription in interface NewsGroup
Returns:
a description of the group

isModerated

public boolean isModerated()
Description copied from interface: NewsGroup

Returns true if the news group is moderated.

Moderated news groups allow posting, but articles are sent to a moderator who must approve the articles before they appear in their group(s).

Specified by:
isModerated in interface NewsGroup
Returns:
true if the group is moderated.

getFirstArticleNumber

public int getFirstArticleNumber()
Description copied from interface: NewsGroup

Obtain the first valid group article number in this group.

Specified by:
getFirstArticleNumber in interface NewsGroup
Returns:
The number of the first article in the group

getLastArticleNumber

public int getLastArticleNumber()
Description copied from interface: NewsGroup

Obtain the last valid group article number in this group.

Specified by:
getLastArticleNumber in interface NewsGroup
Returns:
the last valid article number in the group.

getArticleCount

public int getArticleCount()
Description copied from interface: NewsGroup

Obtain an estimate on the number of articles in the group.

This count does not have to be 100% accurate and can be simply the difference between the last and first group number. However, if the server can provide more accurate numbers it will provide a more consistent user experience. Otherwise, the group summary will show one number, but when the reader actually downloads the articles that number will change to reflect the actual count.

Specified by:
getArticleCount in interface NewsGroup
Returns:
an estimate on the number of articles in the group.

getArticle

public Article getArticle(int articleNumber)
                   throws ArticleNotFoundException
Description copied from interface: NewsGroup

Obtain an article by it's group number.

Specified by:
getArticle in interface NewsGroup
Parameters:
articleNumber - the group's article number.
Returns:
the article corresponding to that group number.
Throws:
ArticleNotFoundException - if no article corresponds to the given number.

getID

public long getID()
Description copied from interface: NewsGroup
Retruns the ID of the newsgroup.

Specified by:
getID in interface NewsGroup
Returns:
the ID of the newsgroup.

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.