IP*Works!

ipworks
Class Nntp

java.lang.Object
  |
  +--ipworks.Nntp

public class Nntp
extends java.lang.Object

The NNTP class is used to read and post articles on Usenet news servers.

The NNTP class implements a standard Usenet news reader as specified in RFC 977. It can be used to browse Usenet news groups and read and post articles.

The class operates mainly by setting action codes to the Action property. The CurrentGroup property sets the current newsgroup. From then on, news articles from that group can be read by setting the article number in CurrentArticle and then setting the appropriate Action code. Properties like ArticleCount , FirstArticle , LastArticle provide information about the current state.

The headers and text of the articles are received respectively through the Header and Transfer events. The GroupOverview event returns information about a range of articles ( OverviewRange ) in CurrentGroup , and the GroupList event is used when listing newsgroup names. The PITrail event provides a trace of the interaction with the server.

The class supports posting of articles through the ArticleText and AttachedFile properties. The article text is specified in one or both of the above, and then the appropriate Action code is sent. Article headers are given in a series of properties like From , Subject , Organization , etc. that map directly to the article header with the same name.


Field Summary
static int a_Connect
           
static int a_Disconnect
           
static int a_GetArticle
           
static int a_GetArticleBody
           
static int a_GetArticleHeaders
           
static int a_GroupOverview
           
static int a_Idle
           
static int a_ListGroups
           
static int a_ListNewGroups
           
static int a_PostArticle
           
static int a_ResetHeaders
           
 
Constructor Summary
Nntp()
           
 
Method Summary
 void addNntpEventListener(NntpEventListener l)
           
 void fireEndTransfer()
          Fired when the article text completes transferring.
 void fireError(int errorCode, java.lang.String description)
          Information about errors during data delivery.
 void fireGroupList(java.lang.String group, int firstArticle, int lastArticle, boolean canPost)
          Fired while group data transfers (during group listings).
 void fireGroupOverview(int articleNumber, java.lang.String subject, java.lang.String from, java.lang.String articleDate, java.lang.String messageId, java.lang.String references, int articleSize, int articleLines, java.lang.String otherHeaders)
          Fired for each line of article overview data (during group overviews).
 void fireHeader(java.lang.String field, java.lang.String value)
          Fired for every article header being retrieved during article retrieval.
 void firePITrail(int direction, java.lang.String message)
          Traces the commands sent to the mail server, and the respective replies.
 void fireStartTransfer()
          Fired when the article text starts transferring.
 void fireTransfer(int bytesTransferred, byte[] text)
          Fired while the article text gets transferred (to or from the NewsServer ).
 int getAction()
          An action code for the component.
 int getArticleCount()
          The estimated number of articles in CurrentGroup .
 java.lang.String getArticleText()
          The full text of the article to post (without headers).
 java.lang.String getAttachedFile()
          A file name which contents to append to ArticleText when posting articles.
 java.lang.String getCheckDate()
          The date (format YYMMDD HHMMSS) since when to check for creation of new groups.
 java.lang.String getCurrentArticle()
          The number or message-id of the current article.
 java.lang.String getCurrentGroup()
          The name of the current group (action property).
 int getFirstArticle()
          The number of the first article in CurrentGroup.
 java.lang.String getFrom()
          The email address of the author (for posting articles).
 int getLastArticle()
          The number of the last article in CurrentGroup .
 java.lang.String getLastReply()
          The last reply from the server.
 java.lang.String getLocalHost()
          The name of the local host.
 int getMaxHeaderLength()
          Maximum length for headers to avoid line folding (default 80).
 java.lang.String getNewsgroups()
          A comma separated list of newsgroups where to post the article.
 int getNewsPort()
          The server port for NNTP (default 119).
 java.lang.String getNewsServer()
          The name or address of a news server.
 java.lang.String getOrganization()
          The organization of the author (for posting articles).
 java.lang.String getOtherHeaders()
          An RFC850 compliant string consisting of extra headers (for posting articles).
 java.lang.String getOverviewRange()
          A range for the Group Overview action (first-last).
 java.lang.String getPassword()
          A login password to login with in the NewsServer .
 java.lang.String getReferences()
          Articles the posted article follows up to.
 java.lang.String getReplyTo()
          The address to reply to (for posting articles).
 java.lang.String getSubject()
          The article subject (for posted articles).
 java.lang.String getUser()
          A user id login as in the NewsServer .
 void removeNntpEventListener(NntpEventListener l)
           
 void setAction(int action)
          An action code for the component.
 void setArticleText(java.lang.String articleText)
          The full text of the article to post (without headers).
 void setAttachedFile(java.lang.String attachedFile)
          A file name which contents to append to ArticleText when posting articles.
 void setCheckDate(java.lang.String checkDate)
          The date (format YYMMDD HHMMSS) since when to check for creation of new groups.
 void setCommand(java.lang.String command)
          Can be used to send additional commands directly to the NNTP server.
 void setCurrentArticle(java.lang.String currentArticle)
          The number or message-id of the current article.
 void setCurrentGroup(java.lang.String currentGroup)
          The name of the current group (action property).
 void setFrom(java.lang.String from)
          The email address of the author (for posting articles).
 void setMaxHeaderLength(int maxHeaderLength)
          Maximum length for headers to avoid line folding (default 80).
 void setNewsgroups(java.lang.String newsgroups)
          A comma separated list of newsgroups where to post the article.
 void setNewsPort(int newsPort)
          The server port for NNTP (default 119).
 void setNewsServer(java.lang.String newsServer)
          The name or address of a news server.
 void setOrganization(java.lang.String organization)
          The organization of the author (for posting articles).
 void setOtherHeaders(java.lang.String otherHeaders)
          An RFC850 compliant string consisting of extra headers (for posting articles).
 void setOverviewRange(java.lang.String overviewRange)
          A range for the Group Overview action (first-last).
 void setPassword(java.lang.String password)
          A login password to login with in the NewsServer .
 void setReferences(java.lang.String references)
          Articles the posted article follows up to.
 void setReplyTo(java.lang.String replyTo)
          The address to reply to (for posting articles).
 void setSubject(java.lang.String subject)
          The article subject (for posted articles).
 void setUser(java.lang.String user)
          A user id login as in the NewsServer .
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

a_Idle

public static final int a_Idle

a_Connect

public static final int a_Connect

a_Disconnect

public static final int a_Disconnect

a_ListGroups

public static final int a_ListGroups

a_ListNewGroups

public static final int a_ListNewGroups

a_GroupOverview

public static final int a_GroupOverview

a_GetArticle

public static final int a_GetArticle

a_GetArticleHeaders

public static final int a_GetArticleHeaders

a_GetArticleBody

public static final int a_GetArticleBody

a_PostArticle

public static final int a_PostArticle

a_ResetHeaders

public static final int a_ResetHeaders
Constructor Detail

Nntp

public Nntp()
Method Detail

getAction

public int getAction()
An action code for the component. Setting the Action property to a valid action code makes the class perform the associated action. If the action completes successfully, execution continues normally, and Action is reset to 0 (Idle). If an error happens, then an IPWorksException exception is raised.

The following are the possible values for the Action property and the corresponding descriptions:

a_Idle
Default action. It can also be used to interrupt the current operation.
a_Connect
Connect to the news server. If the User and/or Password are set, then corresponding AUTHINFO commands are sent to the NewsServer as well.
a_Disconnect
Disconnect from the NewsServer . First the class attempts to send a QUIT command, and if that fails, the connection is broken.
a_ListGroups
Asks the server to list all its newsgroups. Use this action with caution as listing groups may take quite long over dialup lines. The group names and other information are returned via the GroupList event. If a connection to the NewsServer doesn't already exist, a new one is created.
a_ListNewGroups
Asks the server to list all the newsgroups created since CheckDate . The group names (if any) and other information are returned via the GroupList event. If a connection to the NewsServer doesn't already exist, a new one is created.
a_GroupOverview
Receive an overview for the articles in range OverviewRange in the CurrentGroup . The overview data are delivered via the GroupOverview event. If a connection to the NewsServer doesn't already exist, a new one is created.
a_GetArticle
Get the headers and body of the article specified in CurrentArticle . The headers are delivered via the Header event, and the article body via the Transfer event. If a connection to the NewsServer doesn't already exist, a new one is created.
a_GetArticleHeaders
Get only the headers of the article specified in CurrentArticle . The headers are delivered via the Header event. If a connection to the NewsServer doesn't already exist, a new one is created.
a_GetArticleBody
Get only the body of the article specified in CurrentArticle . The body via the Transfer event. If a connection to the NewsServer doesn't already exist, a new one is created.
a_PostArticle
Post the current article and attached file (if any). If a connection to the NewsServer doesn't already exist, a new one is created.
a_ResetHeaders
Resets all the article headers to "" (empty string). Use this property before posting a new article, so that headers from the previous article are not carried over to the next one.


setAction

public void setAction(int action)
               throws IPWorksException
An action code for the component. Setting the Action property to a valid action code makes the class perform the associated action. If the action completes successfully, execution continues normally, and Action is reset to 0 (Idle). If an error happens, then an IPWorksException exception is raised.

The following are the possible values for the Action property and the corresponding descriptions:

a_Idle
Default action. It can also be used to interrupt the current operation.
a_Connect
Connect to the news server. If the User and/or Password are set, then corresponding AUTHINFO commands are sent to the NewsServer as well.
a_Disconnect
Disconnect from the NewsServer . First the class attempts to send a QUIT command, and if that fails, the connection is broken.
a_ListGroups
Asks the server to list all its newsgroups. Use this action with caution as listing groups may take quite long over dialup lines. The group names and other information are returned via the GroupList event. If a connection to the NewsServer doesn't already exist, a new one is created.
a_ListNewGroups
Asks the server to list all the newsgroups created since CheckDate . The group names (if any) and other information are returned via the GroupList event. If a connection to the NewsServer doesn't already exist, a new one is created.
a_GroupOverview
Receive an overview for the articles in range OverviewRange in the CurrentGroup . The overview data are delivered via the GroupOverview event. If a connection to the NewsServer doesn't already exist, a new one is created.
a_GetArticle
Get the headers and body of the article specified in CurrentArticle . The headers are delivered via the Header event, and the article body via the Transfer event. If a connection to the NewsServer doesn't already exist, a new one is created.
a_GetArticleHeaders
Get only the headers of the article specified in CurrentArticle . The headers are delivered via the Header event. If a connection to the NewsServer doesn't already exist, a new one is created.
a_GetArticleBody
Get only the body of the article specified in CurrentArticle . The body via the Transfer event. If a connection to the NewsServer doesn't already exist, a new one is created.
a_PostArticle
Post the current article and attached file (if any). If a connection to the NewsServer doesn't already exist, a new one is created.
a_ResetHeaders
Resets all the article headers to "" (empty string). Use this property before posting a new article, so that headers from the previous article are not carried over to the next one.


getArticleCount

public int getArticleCount()
The estimated number of articles in CurrentGroup . The value of this property is 0 if there is no current group ( CurrentGroup is ""). Otherwise, it is the number of articles in the group as shown by the news server when CurrentGroup is set. For most news servers, this is an estimated value of the number of the articles, rather than the exact value.


getArticleText

public java.lang.String getArticleText()
The full text of the article to post (without headers). The ArticleText property contains the full text of the article to post.

It is advisable that the text contained in this property be a collection of lines with lengths less than or equal to 80 bytes separated by CRLF ("\\r\\n"). The text in the article lines must contain 7-bit characters so that the article can be successfully transferred through the various Usenet news servers on the Internet.

The class automatically escapes lines that start with a "." by adding another "." as specified in RFC 822. The article text is unescaped by the news server, so the process is fully transparent.


setArticleText

public void setArticleText(java.lang.String articleText)
                    throws IPWorksException
The full text of the article to post (without headers). The ArticleText property contains the full text of the article to post.

It is advisable that the text contained in this property be a collection of lines with lengths less than or equal to 80 bytes separated by CRLF ("\\r\\n"). The text in the article lines must contain 7-bit characters so that the article can be successfully transferred through the various Usenet news servers on the Internet.

The class automatically escapes lines that start with a "." by adding another "." as specified in RFC 822. The article text is unescaped by the news server, so the process is fully transparent.


getAttachedFile

public java.lang.String getAttachedFile()
A file name which contents to append to ArticleText when posting articles. The content of AttachedFile is appended to the text in ArticleText (if any) and sent to the news server. This property is useful for posting arbitrarily large articles and/or sending MIME attachments.

It is advisable that the text contained in the file be a collection of lines with lengths less than or equal to 80 bytes separated by CRLF ("\\r\\n") . The text in the message lines must contain only 7-bit characters so that the message may be successfully sent through the various Usenet news servers on the Internet.

The class automatically escapes lines that start with a "." by adding another as specified in RFC 822. The article text is unescaped by the news server, so the process is fully transparent.


setAttachedFile

public void setAttachedFile(java.lang.String attachedFile)
                     throws IPWorksException
A file name which contents to append to ArticleText when posting articles. The content of AttachedFile is appended to the text in ArticleText (if any) and sent to the news server. This property is useful for posting arbitrarily large articles and/or sending MIME attachments.

It is advisable that the text contained in the file be a collection of lines with lengths less than or equal to 80 bytes separated by CRLF ("\\r\\n") . The text in the message lines must contain only 7-bit characters so that the message may be successfully sent through the various Usenet news servers on the Internet.

The class automatically escapes lines that start with a "." by adding another as specified in RFC 822. The article text is unescaped by the news server, so the process is fully transparent.


getCheckDate

public java.lang.String getCheckDate()
The date (format YYMMDD HHMMSS) since when to check for creation of new groups. The value of this property is used as an argument for the 'List New Groups' action. See the description of the Action property for more information.


setCheckDate

public void setCheckDate(java.lang.String checkDate)
                  throws IPWorksException
The date (format YYMMDD HHMMSS) since when to check for creation of new groups. The value of this property is used as an argument for the 'List New Groups' action. See the description of the Action property for more information.


setCommand

public void setCommand(java.lang.String command)
                throws IPWorksException
Can be used to send additional commands directly to the NNTP server. Check the LastReply property and/or trap the PITrail events comming from the server to get the response.


getCurrentArticle

public java.lang.String getCurrentArticle()
The number or message-id of the current article. The CurrentArticle property specifies either a message id or an article number uniquely identifying a particular article. It is then used as an argument to actions like 'Get Article' . Please refer to the description of the Action property for more information.


setCurrentArticle

public void setCurrentArticle(java.lang.String currentArticle)
                       throws IPWorksException
The number or message-id of the current article. The CurrentArticle property specifies either a message id or an article number uniquely identifying a particular article. It is then used as an argument to actions like 'Get Article' . Please refer to the description of the Action property for more information.


getCurrentGroup

public java.lang.String getCurrentGroup()
The name of the current group (action property). When the CurrentGroup property is set to a valid group name, the class sends an NNTP GROUP commands to the NewsServer and enters the specified group. If this action is successful, then FirstArticle , LastArticle , and ArticleCount are set to the reported values for the group. CurrentGroup is then used for all references to articles (until changed to another group).


setCurrentGroup

public void setCurrentGroup(java.lang.String currentGroup)
                     throws IPWorksException
The name of the current group (action property). When the CurrentGroup property is set to a valid group name, the class sends an NNTP GROUP commands to the NewsServer and enters the specified group. If this action is successful, then FirstArticle , LastArticle , and ArticleCount are set to the reported values for the group. CurrentGroup is then used for all references to articles (until changed to another group).


getFirstArticle

public int getFirstArticle()
The number of the first article in CurrentGroup. The value of this property is 0 if there is no current group ( CurrentGroup is "").


getFrom

public java.lang.String getFrom()
The email address of the author (for posting articles). The string in From is posted with a From article header to the news server.

If the resulting From header is longer than MaxHeaderLength , then it is folded according to RFC 850 specifications.


setFrom

public void setFrom(java.lang.String from)
             throws IPWorksException
The email address of the author (for posting articles). The string in From is posted with a From article header to the news server.

If the resulting From header is longer than MaxHeaderLength , then it is folded according to RFC 850 specifications.


getLastArticle

public int getLastArticle()
The number of the last article in CurrentGroup . The value of this property is 0 if there is no current group ( CurrentGroup is "").


getLastReply

public java.lang.String getLastReply()
The last reply from the server. This is the last reply received from the server. It can be used for information purposes. The same information and more can also be retrieved through the PITrail event.


getLocalHost

public java.lang.String getLocalHost()
The name of the local host. When connected, the IP address of the interface through which the connection was made. The LocalHost property contains the name of the local host as obtained by the gethostname() Winsock call.

If the class is connected, the LocalHost property shows the IP address of the interface through which the connection is made in internet dotted format (aaa.bbb.ccc.ddd). In most cases, this is the address of the local host, except for multihomed hosts (machines with more than one IP interface).


getMaxHeaderLength

public int getMaxHeaderLength()
Maximum length for headers to avoid line folding (default 80). The MaxHeaderLength specifies the maximum line length supported by the news delivery system. Any headers longer than MaxHeaderLength are folded as specified in RFC 850.

It is generally a good idea to use a MaxHeaderLength of less than 100 bytes, although different news servers have different requirements for header lengths.


setMaxHeaderLength

public void setMaxHeaderLength(int maxHeaderLength)
                        throws IPWorksException
Maximum length for headers to avoid line folding (default 80). The MaxHeaderLength specifies the maximum line length supported by the news delivery system. Any headers longer than MaxHeaderLength are folded as specified in RFC 850.

It is generally a good idea to use a MaxHeaderLength of less than 100 bytes, although different news servers have different requirements for header lengths.


getNewsgroups

public java.lang.String getNewsgroups()
A comma separated list of newsgroups where to post the article. The string in Newsgroups is posted with a Newsgroups article header to the news server. It specifies the list of groups where the article is posted (comma separated).

If the Newsgroups property contains "" (empty string), then the value of the CurrentGroup property is used to specify the target newsgroup for the posted article.

If the resulting Newsgroups header is longer than MaxHeaderLength , then it is folded according to RFC 850 specifications.


setNewsgroups

public void setNewsgroups(java.lang.String newsgroups)
                   throws IPWorksException
A comma separated list of newsgroups where to post the article. The string in Newsgroups is posted with a Newsgroups article header to the news server. It specifies the list of groups where the article is posted (comma separated).

If the Newsgroups property contains "" (empty string), then the value of the CurrentGroup property is used to specify the target newsgroup for the posted article.

If the resulting Newsgroups header is longer than MaxHeaderLength , then it is folded according to RFC 850 specifications.


getNewsPort

public int getNewsPort()
The server port for NNTP (default 119). A valid port number (a value between 1 and 65535) is required for the connection to take place. The property must be set before a connection is attempted and cannot be changed while a connection is in progress. Any attempt to change the NewsPort while connected will fail with an error.


setNewsPort

public void setNewsPort(int newsPort)
                 throws IPWorksException
The server port for NNTP (default 119). A valid port number (a value between 1 and 65535) is required for the connection to take place. The property must be set before a connection is attempted and cannot be changed while a connection is in progress. Any attempt to change the NewsPort while connected will fail with an error.


getNewsServer

public java.lang.String getNewsServer()
The name or address of a news server. The NewsServer property specifies the IP address (IP number in dotted internet format) or Domain Name for the news server. It is set before a connection is attempted and cannot be changed once a connection is in progress.

If the NewsServer property is set to a Domain Name, a DNS request is initiated and upon successful termination of the request, the NewsServer property is set to the corresponding address. If the search is not successful, an error is returned.


setNewsServer

public void setNewsServer(java.lang.String newsServer)
                   throws IPWorksException
The name or address of a news server. The NewsServer property specifies the IP address (IP number in dotted internet format) or Domain Name for the news server. It is set before a connection is attempted and cannot be changed once a connection is in progress.

If the NewsServer property is set to a Domain Name, a DNS request is initiated and upon successful termination of the request, the NewsServer property is set to the corresponding address. If the search is not successful, an error is returned.


getOrganization

public java.lang.String getOrganization()
The organization of the author (for posting articles). If the Organization property contains a non-empty string, an Organization article header is created for the article. This header shows the organization of the author and is used for information purposes only.

If the resulting Organization header is longer than MaxHeaderLength , then it is folded according to RFC 850 specifications.


setOrganization

public void setOrganization(java.lang.String organization)
                     throws IPWorksException
The organization of the author (for posting articles). If the Organization property contains a non-empty string, an Organization article header is created for the article. This header shows the organization of the author and is used for information purposes only.

If the resulting Organization header is longer than MaxHeaderLength , then it is folded according to RFC 850 specifications.


getOtherHeaders

public java.lang.String getOtherHeaders()
An RFC850 compliant string consisting of extra headers (for posting articles). The OtherHeaders property contains a string of headers to be appended to the message headers created from other properties like From , Subject , etc.

The headers must be of the format "header: value" as specified in RFC 850. Header lines should be separated by CRLF ("\\r\\n").

Use this property with caution. If OtherHeaders contains invalid headers, article posting might not be successful.

The OtherHeaders property is useful for extending the functionality of the class. A good example is posting of MIME attachments.


setOtherHeaders

public void setOtherHeaders(java.lang.String otherHeaders)
                     throws IPWorksException
An RFC850 compliant string consisting of extra headers (for posting articles). The OtherHeaders property contains a string of headers to be appended to the message headers created from other properties like From , Subject , etc.

The headers must be of the format "header: value" as specified in RFC 850. Header lines should be separated by CRLF ("\\r\\n").

Use this property with caution. If OtherHeaders contains invalid headers, article posting might not be successful.

The OtherHeaders property is useful for extending the functionality of the class. A good example is posting of MIME attachments.


getOverviewRange

public java.lang.String getOverviewRange()
A range for the Group Overview action (first-last). The OverviewRange specifies a range of articles for which to retrieve article overviews from the server. The format is 'first-last' where first is "" (empty string) or a positive number, and last is "" (empty string), a positive number, or the token end .

The default value of the property is '-', meaning 'all articles in the group' .


setOverviewRange

public void setOverviewRange(java.lang.String overviewRange)
                      throws IPWorksException
A range for the Group Overview action (first-last). The OverviewRange specifies a range of articles for which to retrieve article overviews from the server. The format is 'first-last' where first is "" (empty string) or a positive number, and last is "" (empty string), a positive number, or the token end .

The default value of the property is '-', meaning 'all articles in the group' .


getPassword

public java.lang.String getPassword()
A login password to login with in the NewsServer . If the Password property is set to a non-empty string, then when connecting to the NewsServer an AUTHINFO PASS command is sent in order to provide authentication information for the user. This command is not part of the NNTP protocol, but it is widely by many news servers.


setPassword

public void setPassword(java.lang.String password)
                 throws IPWorksException
A login password to login with in the NewsServer . If the Password property is set to a non-empty string, then when connecting to the NewsServer an AUTHINFO PASS command is sent in order to provide authentication information for the user. This command is not part of the NNTP protocol, but it is widely by many news servers.


getReferences

public java.lang.String getReferences()
Articles the posted article follows up to. If the References property contains a non-empty string, a References article header is created for the article. This header shows the article-ids the posted article refers to.

The references must be separated by commas with no spaces in between.

If the resulting References header is longer than MaxHeaderLength , then it is folded according to RFC 850 specifications.


setReferences

public void setReferences(java.lang.String references)
                   throws IPWorksException
Articles the posted article follows up to. If the References property contains a non-empty string, a References article header is created for the article. This header shows the article-ids the posted article refers to.

The references must be separated by commas with no spaces in between.

If the resulting References header is longer than MaxHeaderLength , then it is folded according to RFC 850 specifications.


getReplyTo

public java.lang.String getReplyTo()
The address to reply to (for posting articles). If the ReplyTo property contains a non-empty string, a Reply-To article header is created for the article. This header shows the address to use for replies (useful if this address is different from the one in From ).

If the resulting Reply-To header is longer than MaxHeaderLength , then it is folded according to RFC 850 specifications.


setReplyTo

public void setReplyTo(java.lang.String replyTo)
                throws IPWorksException
The address to reply to (for posting articles). If the ReplyTo property contains a non-empty string, a Reply-To article header is created for the article. This header shows the address to use for replies (useful if this address is different from the one in From ).

If the resulting Reply-To header is longer than MaxHeaderLength , then it is folded according to RFC 850 specifications.


getSubject

public java.lang.String getSubject()
The article subject (for posted articles). The string in Subject is posted with a Subject article header to the news server.

If the resulting Subject header is longer than MaxHeaderLength , then it is folded according to RFC 850 specifications.


setSubject

public void setSubject(java.lang.String subject)
                throws IPWorksException
The article subject (for posted articles). The string in Subject is posted with a Subject article header to the news server.

If the resulting Subject header is longer than MaxHeaderLength , then it is folded according to RFC 850 specifications.


getUser

public java.lang.String getUser()
A user id login as in the NewsServer . If the User property is set to a non-empty string, then when connecting to the NewsServer an AUTHINFO USER command is sent in order to provide authentication information for the user. Although this command is not part of the NNTP protocol, it is widely used by news servers for authentication purposes.


setUser

public void setUser(java.lang.String user)
             throws IPWorksException
A user id login as in the NewsServer . If the User property is set to a non-empty string, then when connecting to the NewsServer an AUTHINFO USER command is sent in order to provide authentication information for the user. Although this command is not part of the NNTP protocol, it is widely used by news servers for authentication purposes.


fireEndTransfer

public void fireEndTransfer()
Fired when the article text completes transferring. (Called internally to dispatch the event.)
See Also:
NntpEndTransferEvent

fireError

public void fireError(int errorCode,
                      java.lang.String description)
Information about errors during data delivery. (Called internally to dispatch the event.)
See Also:
NntpErrorEvent

fireGroupList

public void fireGroupList(java.lang.String group,
                          int firstArticle,
                          int lastArticle,
                          boolean canPost)
Fired while group data transfers (during group listings). (Called internally to dispatch the event.)
See Also:
NntpGroupListEvent

fireGroupOverview

public void fireGroupOverview(int articleNumber,
                              java.lang.String subject,
                              java.lang.String from,
                              java.lang.String articleDate,
                              java.lang.String messageId,
                              java.lang.String references,
                              int articleSize,
                              int articleLines,
                              java.lang.String otherHeaders)
Fired for each line of article overview data (during group overviews). (Called internally to dispatch the event.)
See Also:
NntpGroupOverviewEvent

fireHeader

public void fireHeader(java.lang.String field,
                       java.lang.String value)
Fired for every article header being retrieved during article retrieval. (Called internally to dispatch the event.)
See Also:
NntpHeaderEvent

firePITrail

public void firePITrail(int direction,
                        java.lang.String message)
Traces the commands sent to the mail server, and the respective replies. (Called internally to dispatch the event.)
See Also:
NntpPITrailEvent

fireStartTransfer

public void fireStartTransfer()
Fired when the article text starts transferring. (Called internally to dispatch the event.)
See Also:
NntpStartTransferEvent

fireTransfer

public void fireTransfer(int bytesTransferred,
                         byte[] text)
Fired while the article text gets transferred (to or from the NewsServer ). (Called internally to dispatch the event.)
See Also:
NntpTransferEvent

addNntpEventListener

public void addNntpEventListener(NntpEventListener l)
                          throws java.util.TooManyListenersException

removeNntpEventListener

public void removeNntpEventListener(NntpEventListener l)

IP*Works!

Copyright (c) 1995-2000 by /n software inc. - All rights reserved.