org.apache.james.nntpserver.repository
Interface NNTPGroup


public interface NNTPGroup

Contract exposed by a NewsGroup


Method Summary
 NNTPArticle addArticle(java.io.InputStream newsStream)
          Adds an article to the group based on the data in the stream.
 NNTPArticle getArticle(int number)
          Gets the article with the specified article number.
 java.util.Iterator getArticles()
          Retrieves an iterator of all articles in this newsgroup
 java.util.Iterator getArticlesSince(java.util.Date dt)
          Retrieves an iterator of articles in this newsgroup that were posted on or after the specified date.
 java.lang.String getDescription()
          Gets the description of the newsgroup
 int getFirstArticleNumber()
          Gets the first article number in the group.
 int getLastArticleNumber()
          Gets the last article number in the group.
 java.lang.String getListFormat()
          Retrieves the group information in a format consistent with a LIST or LIST ACTIVE return line
 java.lang.String getListNewsgroupsFormat()
          Retrieves the group information in a format consistent with a LIST NEWSGROUPS return line
 java.lang.String getName()
          Gets the name of the newsgroup
 int getNumberOfArticles()
          Gets the number of articles in the group.
 boolean isPostAllowed()
          Returns whether posting is allowed to this newsgroup
 

Method Detail

getName

java.lang.String getName()
Gets the name of the newsgroup

Returns:
the newsgroup name

getDescription

java.lang.String getDescription()
Gets the description of the newsgroup

Returns:
the newsgroup description

isPostAllowed

boolean isPostAllowed()
Returns whether posting is allowed to this newsgroup

Returns:
whether posting is allowed to this newsgroup

getNumberOfArticles

int getNumberOfArticles()
Gets the number of articles in the group.

Returns:
the number of articles in the group.

getFirstArticleNumber

int getFirstArticleNumber()
Gets the first article number in the group.

Returns:
the first article number in the group.

getLastArticleNumber

int getLastArticleNumber()
Gets the last article number in the group.

Returns:
the last article number in the group.

getArticle

NNTPArticle getArticle(int number)
Gets the article with the specified article number.

Parameters:
number - the article number
Returns:
the article

getArticlesSince

java.util.Iterator getArticlesSince(java.util.Date dt)
Retrieves an iterator of articles in this newsgroup that were posted on or after the specified date.

Parameters:
dt - the Date that acts as a lower bound for the list of articles
Returns:
the article iterator

getArticles

java.util.Iterator getArticles()
Retrieves an iterator of all articles in this newsgroup

Returns:
the article iterator

getListFormat

java.lang.String getListFormat()
Retrieves the group information in a format consistent with a LIST or LIST ACTIVE return line

Returns:
the properly formatted string

getListNewsgroupsFormat

java.lang.String getListNewsgroupsFormat()
Retrieves the group information in a format consistent with a LIST NEWSGROUPS return line

Returns:
the properly formatted string

addArticle

NNTPArticle addArticle(java.io.InputStream newsStream)
                       throws java.io.IOException
Adds an article to the group based on the data in the stream.

Parameters:
newsStream - the InputStream containing the article data
Returns:
the newly created article
Throws:
java.io.IOException


Copyright © 2002-2007 The Apache Software Foundation. All Rights Reserved.