org.apache.james.nntpserver.repository
Interface NNTPGroup


public interface NNTPGroup

Contract exposed by a NewsGroup

Author:
Harmeet Bedi

Method Summary
 NNTPArticle addArticle(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.
 Iterator getArticles()
          Retrieves an iterator of all articles in this newsgroup
 Iterator getArticlesSince(Date dt)
          Retrieves an iterator of articles in this newsgroup that were posted on or after the specified date.
 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.
 String getListFormat()
          Retrieves the group information in a format consistent with a LIST or LIST ACTIVE return line
 String getListNewsgroupsFormat()
          Retrieves the group information in a format consistent with a LIST NEWSGROUPS return line
 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

public String getName()
Gets the name of the newsgroup

Returns:
the newsgroup name

getDescription

public String getDescription()
Gets the description of the newsgroup

Returns:
the newsgroup description

isPostAllowed

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

Returns:
whether posting is allowed to this newsgroup

getNumberOfArticles

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

Returns:
the number of articles in the group.

getFirstArticleNumber

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

Returns:
the first article number in the group.

getLastArticleNumber

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

Returns:
the last article number in the group.

getArticle

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

Parameters:
number - the article number
Returns:
the article

getArticlesSince

public Iterator getArticlesSince(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

public Iterator getArticles()
Retrieves an iterator of all articles in this newsgroup

Returns:
the article iterator

getListFormat

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

Returns:
the properly formatted string

getListNewsgroupsFormat

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

Returns:
the properly formatted string

addArticle

public NNTPArticle addArticle(InputStream newsStream)
                       throws 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
IOException


"Copyright © 1999-2002 Apache Jakarta Project. All Rights Reserved."