|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.oroinc.net.nntp.NewGroupsOrNewsQuery
The NewGroupsOrNewsQuery class is used to issue NNTP NEWGROUPS and NEWNEWS queries, implemented by listNewNewsGroups and listNewNews respectively. It prevents you from having to format date, time, distribution, and newgroup arguments.
You might use the class as follows:
query = new NewsGroupsOrNewsQuery(new GregorianCalendar(97, 11, 15), false); query.addDistribution("comp"); NewsgroupInfo[] newsgroups = client.listNewgroups(query);This will retrieve the list of newsgroups starting with the comp. distribution prefix created since midnight 11/15/97.
NNTPClient
Constructor Summary | |
NewGroupsOrNewsQuery(java.util.Calendar date,
boolean gmt)
Creates a new query using the given time as a reference point. |
Method Summary | |
void |
addDistribution(java.lang.String distribution)
Add a distribution group to the query. |
void |
addNewsgroup(java.lang.String newsgroup)
Add a newsgroup to the list of newsgroups being queried. |
java.lang.String |
getDate()
Return the NNTP query formatted date (year, month, day in the form YYMMDD. |
java.lang.String |
getDistributions()
Return the comma separated list of distributions. |
java.lang.String |
getNewsgroups()
Return the comma separated list of newsgroups. |
java.lang.String |
getTime()
Return the NNTP query formatted time (hour, minutes, seconds in the form HHMMSS. |
boolean |
isGMT()
Return whether or not the query date should be treated as GMT. |
void |
omitNewsgroup(java.lang.String newsgroup)
Add a newsgroup to the list of newsgroups being queried, but indicate that group should not be checked for new news. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public NewGroupsOrNewsQuery(java.util.Calendar date, boolean gmt)
date
- The date since which new groups or news have arrived.gmt
- True if the date should be considered as GMT, false if not.Method Detail |
public void addNewsgroup(java.lang.String newsgroup)
*
wildcard, as in
comp.lang.*
or comp.lang.java.*
. Adding
at least one newsgroup is mandatory for the NEWNEWS command.
newsgroup
- The newsgroup to add to the list of groups to be
checked for new news.public void omitNewsgroup(java.lang.String newsgroup)
*
wildcard, as in
comp.lang.*
or comp.lang.java.*
.
The following would create a query that searched for new news in all comp.lang.java newsgroups except for comp.lang.java.advocacy.
query.addNewsgroup("comp.lang.java.*"); query.omitNewsgroup("comp.lang.java.advocacy");
newsgroup
- The newsgroup to add to the list of groups to be
checked for new news, but which should be omitted from
the search for new news..public void addDistribution(java.lang.String distribution)
distribution
- A distribution to add to the query.public java.lang.String getDate()
public java.lang.String getTime()
public boolean isGMT()
public java.lang.String getDistributions()
public java.lang.String getNewsgroups()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |