All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class COM.ibm.beans.net.NNTPSession

java.lang.Object
   |
   +----COM.ibm.beans.net.NNTPSession

public class NNTPSession
extends Object
implements Serializable
Java Bean that manages a NNTP session with a news server.

Properties:

Events: (none)

Methods:

 Copyright (c) Taligent, Inc.  1996 - 1997.
 Copyright (c) IBM Corporation 1996 - 1997.
 All Rights Reserved.
 

See Also:
NNTPClient

Constructor Index

 o NNTPSession()
Default Constructor creates an NNTP client.

Method Index

 o getArticleId()
Returns the current article ID.
 o getArticleText()
Retrieve current article for posting.
 o getGroup()
Returns the current news group.
 o getQueryDate()
Returns the current query date.
 o getQueryTime()
Returns the current query time.
 o getServer()
Returns the current server.
 o isSustainedSession()
Query sustained session.
 o listNewArticles()
List new news articles.
 o listNewNewsgroups()
List new newsgroups.
 o listNewsgroups()
List all available newsgroups.
 o logoff()
Logoff from news server.
 o logon()
Logon to the news server.
 o main(String[])
 o nextArticle()
Point to next article.
 o postArticle()
Post current article.
 o previousArticle()
Point to previous article.
 o retrieveArticle()
Retrieve the article specified by the article from the news server.
 o retrieveArticleBody()
Retrieve body of article from the news server.
 o retrieveArticleHeader()
Retrieve article header from the news server.
 o selectGroup()
Select a group and make it current.
 o setArticleId(String)
Set article to retrieve by ID.
 o setArticleText(String)
Set article for posting.
 o setGroup(String)
Set group to be the target of ensuing commands.
 o setQueryDate(String)
Set date for new news and new newsgroups query.
 o setQueryTime(String)
Set time for new news and new newsgroups query.
 o setServer(String)
Set news server name.
 o setSustainedSession(boolean)
Set sustained session.
 o showBeanClient()
Display the client for this bean.

Constructors

 o NNTPSession
 public NNTPSession()
Default Constructor creates an NNTP client.

Methods

 o setServer
 public void setServer(String server)
Set news server name.

Parameters:
server - is the name of the news server for this NNTP client.
 o getServer
 public String getServer()
Returns the current server.

 o setSustainedSession
 public void setSustainedSession(boolean sustained)
Set sustained session. Default is true.

Parameters:
sustained - if true, the NNTP session requires explicit logon and logoff. If false, the session performs it's own logon and logoff.

A sustained session requires an explicit logon prior to invoking NNTP services and an explicit logoff afterwards. An unsustained session performs its own logon and logoff.

 o isSustainedSession
 public boolean isSustainedSession()
Query sustained session.

 o setArticleId
 public void setArticleId(String artId)
Set article to retrieve by ID. Each article is given a unique id by the server, and is sent when a listing of the articles is returned.

Parameters:
artId - is the unique article id of the article.
 o getArticleId
 public String getArticleId()
Returns the current article ID.

 o setGroup
 public void setGroup(String group)
Set group to be the target of ensuing commands.

Parameters:
group - is the name of the news group that should be set as the target of ensuing commands
 o getGroup
 public String getGroup()
Returns the current news group.

 o setArticleText
 public void setArticleText(String article)
Set article for posting. The article should contain both headers and body. See RFC1036 for the format to use.

Parameters:
article - is the text of the article to be posted to the current news group.
 o getArticleText
 public String getArticleText()
Retrieve current article for posting.

 o setQueryDate
 public void setQueryDate(String date)
Set date for new news and new newsgroups query.

Parameters:
date - is the date to be used for retrieving new articles and news groups from the server. It is in the YYmmdd format.
 o getQueryDate
 public String getQueryDate()
Returns the current query date.

 o setQueryTime
 public void setQueryTime(String time)
Set time for new news and new newsgroups query.

Parameters:
time - is the time to be used for retrieving new articles and news groups from the server. It is in the HHmmss format.
 o getQueryTime
 public String getQueryTime()
Returns the current query time.

 o logon
 public void logon() throws IOException
Logon to the news server.

 o logoff
 public void logoff() throws IOException
Logoff from news server.

 o retrieveArticle
 public BufferedReader retrieveArticle() throws IOException
Retrieve the article specified by the article from the news server.

Returns:
the text of the article specified, in a BufferedReader
 o retrieveArticleHeader
 public BufferedReader retrieveArticleHeader() throws IOException
Retrieve article header from the news server.

Returns:
the text of the article's header, in a BufferedReader
 o retrieveArticleBody
 public BufferedReader retrieveArticleBody() throws IOException
Retrieve body of article from the news server.

Returns:
the text of the article's body, in a BufferedReader
 o selectGroup
 public String selectGroup() throws IOException
Select a group and make it current.

Returns:
A string containing two tokens; the first is the last message number in the group and the second is its first message number
 o postArticle
 public void postArticle() throws IOException
Post current article.

 o listNewsgroups
 public String[] listNewsgroups() throws IOException
List all available newsgroups.

Returns:
An array of newsgroup titles
 o listNewNewsgroups
 public String[] listNewNewsgroups() throws IOException
List new newsgroups. Set the query date and time prior to invoking this method.

Returns:
An array of newsgroup titles
 o listNewArticles
 public String[] listNewArticles() throws IOException
List new news articles. Set the query date and time prior to invoking this method.

Returns:
An array of news article numbers and IDs.
 o nextArticle
 public void nextArticle() throws IOException
Point to next article.

 o previousArticle
 public void previousArticle() throws IOException
Point to previous article.

 o showBeanClient
 public void showBeanClient()
Display the client for this bean. The default implementation of this method will show the default Customizer for this bean, viz. the NNTPSessionCustomizer. To show a different UI for this bean, this method must be overridden appropriately.

 o main
 public static void main(String argv[])

All Packages  Class Hierarchy  This Package  Previous  Next  Index