All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class Acme.Nnrpd.NewsDb

java.lang.Object
   |
   +----Acme.Nnrpd.NewsDb

public abstract class NewsDb
extends Object
Netnews database template.

This is an abstract API representing a news database. Just the back-end, no user interface stuff at all.

Fetch the software.
Fetch the entire Acme package.


Constructor Index

 o NewsDb()
Constructor.

Method Index

 o authorize(String, String)
Attempt authorization.
 o close()
Shut down the news database.
 o getArticle(NewsDbGroup, int)
Get an article by group and number.
 o getArticle(String)
Get an article by message-id.
 o getDbStamp()
Get the database stamp.
 o getGroup(String)
Get a group by name.
 o getGroups()
Get an enumeration of all the groups.
 o getGroups(long)
Get an enumeration of all groups created after a given time.
 o getGroups(long, String)
Get an enumeration of all groups created after a given time that match the given distributions pattern.
 o getHeader(String, NewsDbGroup, int)
Get a specified header from an article by group and number.
 o getHeaders(String[], NewsDbGroup, int, int)
Get specified headers from a range of articles by group and number.
 o getMessageIds(String, long)
Get an enumeration of all message-ids received after a given time in groups matching the given pattern.
 o getMessageIds(String, long, String)
Get an enumeration of all message-ids received after a given time in groups matching the given pattern, that also match the This is similar to the NNTP "NEWNEWS" command.
 o getPostingOk()
Whether posting is allowed.
 o post(String)
Post an article.

Constructors

 o NewsDb
 public NewsDb() throws NewsDbException
Constructor.

Throws: NewsDbException
if something goes wrong

Methods

 o getDbStamp
 protected long getDbStamp() throws NewsDbException
Get the database stamp. This is used internally when dealing with multiple news databases, to make sure that an obect returned from one is not passed to another.

Throws: NewsDbException
if something goes wrong
 o authorize
 public abstract boolean authorize(String user,
                                   String password) throws NewsDbException
Attempt authorization. This is similar to the NNTP "AUTHINFO" command.

Throws: NewsDbException
if something goes wrong
 o getPostingOk
 public abstract boolean getPostingOk() throws NewsDbException
Whether posting is allowed.

Throws: NewsDbException
if something goes wrong
 o getGroup
 public abstract NewsDbGroup getGroup(String groupName) throws NewsDbException
Get a group by name. This is similar to the NNTP "GROUP" command.

Throws: NewsDbException
if something goes wrong
 o getArticle
 public abstract NewsDbArticle getArticle(NewsDbGroup group,
                                          int artNum) throws NewsDbException
Get an article by group and number. This is similar to the NNTP "ARTICLE" command.

Throws: NewsDbException
if something goes wrong
 o getArticle
 public abstract NewsDbArticle getArticle(String messageId) throws NewsDbException
Get an article by message-id. This is similar to the NNTP "ARTICLE" command.

Throws: NewsDbException
if something goes wrong
 o getHeader
 public String getHeader(String name,
                         NewsDbGroup group,
                         int artNum) throws NewsDbException
Get a specified header from an article by group and number.

Throws: NewsDbException
if something goes wrong
 o getHeaders
 public abstract String[][] getHeaders(String names[],
                                       NewsDbGroup group,
                                       int firstArtNum,
                                       int lastArtNum) throws NewsDbException
Get specified headers from a range of articles by group and number. Some implementations have special faster methods for getting headers from articles, e.g. an XOVER command to a remote server or a local overview database. If no such fast method is available, this returns null and the caller should fall back on conventional means.

Throws: NewsDbException
if something goes wrong
 o getGroups
 public abstract Enumeration getGroups() throws NewsDbException
Get an enumeration of all the groups. This is similar to the NNTP "LIST active" command.

Throws: NewsDbException
if something goes wrong
 o getGroups
 public abstract Enumeration getGroups(long since) throws NewsDbException
Get an enumeration of all groups created after a given time. This is similar to the NNTP "NEWGROUPS" command.

Throws: NewsDbException
if something goes wrong
 o getGroups
 public abstract Enumeration getGroups(long since,
                                       String distsPat) throws NewsDbException
Get an enumeration of all groups created after a given time that match the given distributions pattern. This is similar to the NNTP "NEWGROUPS" command.

Throws: NewsDbException
if something goes wrong
 o getMessageIds
 public abstract Enumeration getMessageIds(String groupsPat,
                                           long since) throws NewsDbException
Get an enumeration of all message-ids received after a given time in groups matching the given pattern. This is similar to the NNTP "NEWNEWS" command.

Throws: NewsDbException
if something goes wrong
 o getMessageIds
 public abstract Enumeration getMessageIds(String groupsPat,
                                           long since,
                                           String distsPat) throws NewsDbException
Get an enumeration of all message-ids received after a given time in groups matching the given pattern, that also match the This is similar to the NNTP "NEWNEWS" command. given distributions pattern.

Throws: NewsDbException
if something goes wrong
 o post
 public abstract void post(String artText) throws NewsDbException
Post an article. This is similar to the NNTP "POST" command.

Throws: NewsDbException
if something goes wrong
 o close
 public abstract void close()
Shut down the news database.


All Packages  Class Hierarchy  This Package  Previous  Next  Index

ACME Java  ACME Labs