All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class Acme.Nnrpd.ProxyNewsDb

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

public class ProxyNewsDb
extends NewsDb
Proxy netnews database.

This is a news database that forwards requests to a remote news server.

Fetch the software.
Fetch the entire Acme package.


Constructor Index

 o ProxyNewsDb(String, int)
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 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 a given distributions pattern.
 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 given distributions pattern.
 o getPostingOk()
Whether posting is allowed.
 o post(String)
Post an article.

Constructors

 o ProxyNewsDb
 public ProxyNewsDb(String proxyHost,
                    int oCacheSize) throws NewsDbException
Constructor. The proxyHost string should be "hostname:portnum", or just a hostname in which case the default netnews port will be used.

Parameters:
proxyHost - the remote news server to connect to
oCacheSize - how many overview entries to save in the cache
Throws: NewsDbException
if something goes wrong

Methods

 o authorize
 public boolean authorize(String user,
                          String password) throws NewsDbException
Attempt authorization.

Throws: NewsDbException
if something goes wrong
Overrides:
authorize in class NewsDb
 o getPostingOk
 public boolean getPostingOk() throws NewsDbException
Whether posting is allowed.

Throws: NewsDbException
if something goes wrong
Overrides:
getPostingOk in class NewsDb
 o getGroup
 public synchronized NewsDbGroup getGroup(String groupName) throws NewsDbException
Get a group by name.

Throws: NewsDbException
if something goes wrong
Overrides:
getGroup in class NewsDb
 o getArticle
 public synchronized NewsDbArticle getArticle(NewsDbGroup group,
                                              int artNum) throws NewsDbException
Get an article by group and number.

Throws: NewsDbException
if something goes wrong
Overrides:
getArticle in class NewsDb
 o getArticle
 public synchronized NewsDbArticle getArticle(String messageId) throws NewsDbException
Get an article by message-id.

Throws: NewsDbException
if something goes wrong
Overrides:
getArticle in class NewsDb
 o getHeaders
 public synchronized 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
Overrides:
getHeaders in class NewsDb
 o getGroups
 public Enumeration getGroups() throws NewsDbException
Get an enumeration of all the groups.

Throws: NewsDbException
if something goes wrong
Overrides:
getGroups in class NewsDb
 o getGroups
 public synchronized Enumeration getGroups(long since) throws NewsDbException
Get an enumeration of all groups created after a given time.

Throws: NewsDbException
if something goes wrong
Overrides:
getGroups in class NewsDb
 o getGroups
 public synchronized Enumeration getGroups(long since,
                                           String distsPat) throws NewsDbException
Get an enumeration of all groups created after a given time that match a given distributions pattern.

Throws: NewsDbException
if something goes wrong
Overrides:
getGroups in class NewsDb
 o getMessageIds
 public 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.

Throws: NewsDbException
if something goes wrong
Overrides:
getMessageIds in class NewsDb
 o getMessageIds
 public 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 given distributions pattern.

Throws: NewsDbException
if something goes wrong
Overrides:
getMessageIds in class NewsDb
 o post
 public synchronized void post(String artText) throws NewsDbException
Post an article.

Throws: NewsDbException
if something goes wrong
Overrides:
post in class NewsDb
 o close
 public synchronized void close()
Shut down the news database.

Overrides:
close in class NewsDb

All Packages  Class Hierarchy  This Package  Previous  Next  Index

ACME Java  ACME Labs