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:
- news server name/address
- sustained session
- news article number
- news article ID
- newsgroup
- article to post
- date/time for new news and new group queries
Events: (none)
Methods:
- logon
- logoff
- retrieve article
- retrieve article header
- retrieve article body
- select group
- post article
- list newsgroups
- list new newsgroups
- list new articles
- go to next article
- go to previous article
Copyright (c) Taligent, Inc. 1996 - 1997.
Copyright (c) IBM Corporation 1996 - 1997.
All Rights Reserved.
- See Also:
- NNTPClient
-
NNTPSession()
- Default Constructor creates an NNTP client.
-
getArticleId()
- Returns the current article ID.
-
getArticleText()
- Retrieve current article for posting.
-
getGroup()
- Returns the current news group.
-
getQueryDate()
- Returns the current query date.
-
getQueryTime()
- Returns the current query time.
-
getServer()
- Returns the current server.
-
isSustainedSession()
- Query sustained session.
-
listNewArticles()
- List new news articles.
-
listNewNewsgroups()
- List new newsgroups.
-
listNewsgroups()
- List all available newsgroups.
-
logoff()
- Logoff from news server.
-
logon()
- Logon to the news server.
-
main(String[])
-
-
nextArticle()
- Point to next article.
-
postArticle()
- Post current article.
-
previousArticle()
- Point to previous article.
-
retrieveArticle()
- Retrieve the article specified by the article from the news server.
-
retrieveArticleBody()
- Retrieve body of article from the news server.
-
retrieveArticleHeader()
- Retrieve article header from the news server.
-
selectGroup()
- Select a group and make it current.
-
setArticleId(String)
- Set article to retrieve by ID.
-
setArticleText(String)
- Set article for posting.
-
setGroup(String)
- Set group to be the target of ensuing commands.
-
setQueryDate(String)
- Set date for new news and new newsgroups query.
-
setQueryTime(String)
- Set time for new news and new newsgroups query.
-
setServer(String)
- Set news server name.
-
setSustainedSession(boolean)
- Set sustained session.
-
showBeanClient()
- Display the client for this bean.
NNTPSession
public NNTPSession()
- Default Constructor creates an NNTP client.
setServer
public void setServer(String server)
- Set news server name.
- Parameters:
- server - is the name of the news server for this NNTP client.
getServer
public String getServer()
- Returns the current server.
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.
isSustainedSession
public boolean isSustainedSession()
- Query sustained session.
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.
getArticleId
public String getArticleId()
- Returns the current article ID.
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
getGroup
public String getGroup()
- Returns the current news group.
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.
getArticleText
public String getArticleText()
- Retrieve current article for posting.
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.
getQueryDate
public String getQueryDate()
- Returns the current query date.
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.
getQueryTime
public String getQueryTime()
- Returns the current query time.
logon
public void logon() throws IOException
- Logon to the news server.
logoff
public void logoff() throws IOException
- Logoff from news server.
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
retrieveArticleHeader
public BufferedReader retrieveArticleHeader() throws IOException
- Retrieve article header from the news server.
- Returns:
- the text of the article's header, in a BufferedReader
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
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
postArticle
public void postArticle() throws IOException
- Post current article.
listNewsgroups
public String[] listNewsgroups() throws IOException
- List all available newsgroups.
- Returns:
- An array of newsgroup titles
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
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.
nextArticle
public void nextArticle() throws IOException
- Point to next article.
previousArticle
public void previousArticle() throws IOException
- Point to previous article.
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.
main
public static void main(String argv[])
All Packages Class Hierarchy This Package Previous Next Index