org.apache.commons.net.nntp

Class NewsgroupInfo


public final class NewsgroupInfo
extends java.lang.Object

NewsgroupInfo stores information pertaining to a newsgroup returned by the NNTP GROUP, LIST, and NEWGROUPS commands, implemented by selectNewsgroup , listNewsgroups , and listNewNewsgroups respectively.

Author:
Daniel F. Savarese

See Also:
NNTPClient

Field Summary

static int
MODERATED_POSTING_PERMISSION
A constant indicating that a newsgroup is moderated.
static int
PERMITTED_POSTING_PERMISSION
A constant indicating that a newsgroup is public and unmoderated.
static int
PROHIBITED_POSTING_PERMISSION
A constant indicating that a newsgroup is closed for general posting.
static int
UNKNOWN_POSTING_PERMISSION
A constant indicating that the posting permission of a newsgroup is unknown.
private int
__estimatedArticleCount
private int
__firstArticle
private int
__lastArticle
private String
__newsgroup
private int
__postingPermission

Method Summary

(package private) void
_setArticleCount(int count)
(package private) void
_setFirstArticle(int first)
(package private) void
_setLastArticle(int last)
(package private) void
_setNewsgroup(String newsgroup)
(package private) void
_setPostingPermission(int permission)
int
getArticleCount()
Get the estimated number of articles in the newsgroup.
int
getFirstArticle()
Get the number of the first article in the newsgroup.
int
getLastArticle()
Get the number of the last article in the newsgroup.
String
getNewsgroup()
Get the newsgroup name.
int
getPostingPermission()
Get the posting permission of the newsgroup.

Field Details

MODERATED_POSTING_PERMISSION

public static final int MODERATED_POSTING_PERMISSION
A constant indicating that a newsgroup is moderated. **

Field Value:
1


PERMITTED_POSTING_PERMISSION

public static final int PERMITTED_POSTING_PERMISSION
A constant indicating that a newsgroup is public and unmoderated. **

Field Value:
2


PROHIBITED_POSTING_PERMISSION

public static final int PROHIBITED_POSTING_PERMISSION
A constant indicating that a newsgroup is closed for general posting.

Field Value:
3


UNKNOWN_POSTING_PERMISSION

public static final int UNKNOWN_POSTING_PERMISSION
A constant indicating that the posting permission of a newsgroup is unknown. For example, the NNTP GROUP command does not return posting information, so NewsgroupInfo instances obtained from that command willhave an UNKNOWN_POSTING_PERMISSION.

Field Value:
0


__estimatedArticleCount

private int __estimatedArticleCount


__firstArticle

private int __firstArticle


__lastArticle

private int __lastArticle


__newsgroup

private String __newsgroup


__postingPermission

private int __postingPermission

Method Details

_setArticleCount

(package private)  void _setArticleCount(int count)


_setFirstArticle

(package private)  void _setFirstArticle(int first)


_setLastArticle

(package private)  void _setLastArticle(int last)


_setNewsgroup

(package private)  void _setNewsgroup(String newsgroup)


_setPostingPermission

(package private)  void _setPostingPermission(int permission)


getArticleCount

public int getArticleCount()
Get the estimated number of articles in the newsgroup. The accuracy of this value will depend on the server implementation.

Returns:
The estimated number of articles in the newsgroup.


getFirstArticle

public int getFirstArticle()
Get the number of the first article in the newsgroup.

Returns:
The number of the first article in the newsgroup.


getLastArticle

public int getLastArticle()
Get the number of the last article in the newsgroup.

Returns:
The number of the last article in the newsgroup.


getNewsgroup

public String getNewsgroup()
Get the newsgroup name.

Returns:
The name of the newsgroup.


getPostingPermission

public int getPostingPermission()
Get the posting permission of the newsgroup. This will be one of the POSTING_PERMISSION constants.

Returns:
The posting permission status of the newsgroup.